-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (47 loc) · 1.79 KB
/
Dockerfile
File metadata and controls
66 lines (47 loc) · 1.79 KB
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
FROM golang:1.26-alpine AS ignite-builder
ARG ENABLE_IBC=true
# Install dependencies needed for ignite and building
RUN apk add --no-cache \
libc6-compat \
curl \
bash
# Set environment variables
ENV EVNODE_VERSION=v1.1.0
ENV IGNITE_VERSION=v29.6.1
ENV IGNITE_EVOLVE_APP_VERSION=main
RUN curl -sSL https://get.ignite.com/cli@${IGNITE_VERSION}! | bash
WORKDIR /workspace
COPY . ./ev-abci
RUN ignite scaffold chain gm --no-module --skip-git --address-prefix gm
WORKDIR /workspace/gm
RUN ignite app install github.com/ignite/apps/evolve@${IGNITE_EVOLVE_APP_VERSION} && \
ignite evolve add && \
ignite evolve add-migrate
RUN go mod edit -replace github.com/evstack/ev-node=github.com/evstack/ev-node@${EVNODE_VERSION} && \
go mod edit -replace github.com/evstack/ev-abci=/workspace/ev-abci && \
go mod tidy && \
go mod download
# TODO: replace this with proper ignite flag to skip IBC registration when available
# Patch out IBC registration (comment out the call and its error handling)
RUN if [ "$ENABLE_IBC" = "false" ]; then \
echo "Disabling IBC registration..."; \
awk 'BEGIN{c=0} /registerIBCModules\(appOpts\)/ {print "// "$0; c=2; next} {if (c>0) {print "// "$0; c--; next} } {print $0}' \
app/app.go > app/app.go.tmp && mv app/app.go.tmp app/app.go; \
else \
echo "IBC enabled, leaving registration intact."; \
fi
RUN ignite chain build --skip-proto
# create lightweight runtime image
FROM alpine:latest
RUN apk add --no-cache ca-certificates
# create non-root user
RUN addgroup -g 10001 -S gm && \
adduser -u 10001 -S gm -G gm
WORKDIR /home/gm
# copy the built binary from the builder stage
COPY --from=ignite-builder /go/bin/gmd /usr/local/bin/gmd
RUN chown -R gm:gm /home/gm
USER gm
# expose common ports
EXPOSE 26657 26656 9090 1317
CMD ["gmd"]