Skip to content

Commit 3e4f457

Browse files
committed
feat: optimize Dockerfile.gm for improved caching and build efficiency
1 parent d244a04 commit 3e4f457

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/integration-tests/docker/Dockerfile.gm

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,31 @@ WORKDIR /workspace
1818
ARG IGNITE_EVOLVE_APP_VERSION=main
1919
RUN ignite scaffold chain gm --no-module --skip-git --address-prefix gm
2020
WORKDIR /workspace/gm
21+
22+
# Install evolve plugin - cached separately
2123
RUN ignite app install github.com/ignite/apps/evolve@${IGNITE_EVOLVE_APP_VERSION}
2224
RUN ignite evolve add
2325

24-
# Copy ev-abci repo after scaffolding to avoid cache invalidation on code changes
25-
COPY . /workspace/ev-abci
26-
27-
# Inject App wiring for ev-abci network module before building
26+
# Copy only patch script first - cached if patch doesn't change
2827
COPY .github/integration-tests/patches/app-wiring/patch-app-wiring.sh /workspace/patch-app-wiring.sh
2928
RUN chmod +x /workspace/patch-app-wiring.sh && \
3029
echo "===== Running network module patch =====" && \
3130
bash /workspace/patch-app-wiring.sh
3231

33-
# Align module versions like in CI - cached if EVNODE_VERSION doesn't change
32+
# Copy only go.mod and go.sum files for dependency caching
33+
COPY go.mod go.sum /workspace/ev-abci/
34+
COPY attester/go.mod attester/go.sum /workspace/ev-abci/attester/
35+
36+
# Set up module replacements - cached if versions don't change
3437
ARG EVNODE_VERSION=v1.0.0-beta.2
3538
RUN go mod edit -replace github.com/evstack/ev-node=github.com/evstack/ev-node@${EVNODE_VERSION} \
3639
&& go mod edit -replace github.com/evstack/ev-abci=../ev-abci \
3740
&& go mod tidy
3841

39-
# Build gmd binary - this will rebuild if source code changes
42+
# Copy source code only after dependencies are resolved
43+
COPY . /workspace/ev-abci
44+
45+
# Build gmd binary - this will rebuild only if source code changes
4046
ENV GOBIN=/workspace/bin
4147
RUN ignite chain build --skip-proto && \
4248
test -x "${GOBIN}/gmd"

0 commit comments

Comments
 (0)