-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (64 loc) · 2.12 KB
/
Dockerfile
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
72
73
74
75
76
77
78
79
80
81
82
83
# Using Debian-based image with Go 1.22
# - go 1.22, required by rollkit
# - Debian for building the wasmd binary
FROM golang:1.22 AS build-env
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
make \
sed \
gcc \
libc-dev \
wget \
bash \
curl \
jq \
libc6 \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set working directory for the build
WORKDIR /src
# Download wasmd repo
RUN git clone https://github.com/CosmWasm/wasmd.git
# Set working directory to wasmd
WORKDIR /src/wasmd
# Update Dependencies
RUN git checkout tags/v0.50.0 && \
go mod edit -replace github.com/cosmos/cosmos-sdk=github.com/rollkit/[email protected] && \
go mod tidy -compat=1.17 && \
go mod download
# Comment out lines 902-904 in app.go as temporary fix until CosmWasm/wasmd#1785 is resolved.
RUN sed -i '902,904 s/^/\/\//' ./app/app.go
# Build the wasmd binary
RUN make install
# Grab in the init.sh script from the docs
RUN wget https://rollkit.dev/cosmwasm/init.sh
# Comment out the wasmd start command lines so that we just initialize the environment
RUN sed -i '/wasmd start/s/^/#/' init.sh
RUN bash init.sh
# Stage 2: Create a minimal runtime image
FROM debian:bookworm-slim
# Install only the necessary runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
curl \
ranger \
jq \
vim \
ca-certificates \
libc6 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /root
# Copy the wasmd binary from the build stage
COPY --from=build-env /go/bin/wasmd /usr/bin/wasmd
# Ensure the wasmd binary is executable
RUN chmod +x /usr/bin/wasmd
# Copy the .wasmd directory from the build stage
COPY --from=build-env /root/.wasmd /root/.wasmd
# Copy over wasmd depenendencies
RUN mkdir -p /go/pkg/mod/github.com/!cosm!wasm/[email protected]
COPY --from=build-env /go/pkg/mod/github.com/!cosm!wasm/[email protected]/ /go/pkg/mod/github.com/!cosm!wasm/[email protected]/
EXPOSE 36657 36656 9290
# Keep the container running
CMD tail -F /dev/null