-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathDockerfile.testnet
71 lines (53 loc) · 1.92 KB
/
Dockerfile.testnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Stage 1: Install ignite CLI and rollkit
FROM golang as base
# Install dependencies
RUN apt update && \
apt-get install -y \
build-essential \
ca-certificates \
curl
# Install rollkit
ARG ROLLKIT_VERSION=v0.13.6
RUN curl -sSL https://rollkit.dev/install.sh | sh -s $ROLLKIT_VERSION
# Install ignite
ARG IGNITE_VERSION=v28.4.0
RUN curl https://get.ignite.com/cli@$IGNITE_VERSION! | bash
# Set the working directory
WORKDIR /app
# Cache dependencies.
COPY ./go.mod .
COPY ./go.sum .
RUN go mod download
# Copy all files from the current directory to the container
COPY . .
# Build the chain
RUN ignite chain build && ignite rollkit init
# Initialize the rollkit.toml file
RUN rollkit toml init
# Run rollkit command to initialize the entrypoint executable
RUN rollkit
# Stage 2: Set up the runtime environment
FROM debian:bookworm-slim
# Install jq
RUN apt update && \
apt-get install -y \
jq
# Set the working directory
WORKDIR /root
# Copy over the rollkit binary from the build stage
COPY --from=base /go/bin/rollkit /usr/bin
# Copy the entrypoint and rollkit.toml files from the build stage
COPY --from=base /app/entrypoint ./entrypoint
COPY --from=base /app/rollkit.toml ./rollkit.toml
# Copy the $HOME/.defund directory from the build stage.
# This directory contains all your chain config.
COPY --from=base /app/network/.defund /root/defund
COPY --from=base /root/.defund /root/.defund
# Ensure the entrypoint script is executable
RUN chmod +x ./entrypoint
# Define environment variables for runtime configuration
ENV AUTH_TOKEN=""
ENV DA_NAMESPACE=""
ENV DA_BLOCK_HEIGHT=""
# Keep the container running after it has been started
ENTRYPOINT [ "rollkit", "start", "--rollkit.aggregator", "--rollkit.da_auth_token", "$AUTH_TOKEN", "--rollkit.da_namespace", "$DA_NAMESPACE", "--rollkit.da_start_height", "$DA_BLOCK_HEIGHT", '--minimum-gas-prices="0.02ibc/C3E53D20BC7A4CC993B17C7971F8ECD06A433C10B6A96F4C4C3714F0624C56DA,0.025stake"' ]