github.com/MetalBlockchain/subnet-evm@v0.6.3/Dockerfile (about) 1 # syntax=docker/dockerfile:experimental 2 3 # ============= Setting up base Stage ================ 4 # Set required METAL_VERSION parameter in build image script 5 ARG METAL_VERSION 6 7 # ============= Compilation Stage ================ 8 FROM golang:1.21.7-bullseye AS builder 9 10 WORKDIR /build 11 12 # Copy metal dependencies first (intermediate docker image caching) 13 # Copy metalgo directory if present (for manual CI case, which uses local dependency) 14 COPY go.mod go.sum metalgo* ./ 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 metalblockchain/metalgo:$METAL_VERSION AS builtImage 30 31 # Copy the evm binary into the correct location in the container 32 COPY --from=builder /build/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy /metalgo/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy