github.com/ava-labs/subnet-evm@v0.6.4/Dockerfile (about) 1 # syntax=docker/dockerfile:experimental 2 3 # ============= Setting up base Stage ================ 4 # Set required AVALANCHE_VERSION parameter in build image script 5 ARG AVALANCHE_VERSION 6 7 # ============= Compilation Stage ================ 8 FROM golang:1.21.9-bullseye AS builder 9 10 WORKDIR /build 11 12 # Copy avalanche dependencies first (intermediate docker image caching) 13 # Copy avalanchego directory if present (for manual CI case, which uses local dependency) 14 COPY go.mod go.sum avalanchego* ./ 15 16 # Download avalanche dependencies using go mod 17 RUN go mod download && go mod tidy -compat=1.21 18 19 # Copy the code into the container 20 COPY . . 21 22 # Pass in SUBNET_EVM_COMMIT as an arg to allow the build script to set this externally 23 ARG SUBNET_EVM_COMMIT 24 ARG CURRENT_BRANCH 25 26 RUN export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh /build/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy 27 28 # ============= Cleanup Stage ================ 29 FROM avaplatform/avalanchego:$AVALANCHE_VERSION AS builtImage 30 31 # Copy the evm binary into the correct location in the container 32 COPY --from=builder /build/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy /avalanchego/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy