github.com/MetalBlockchain/subnet-evm@v0.4.9/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.18.5-buster AS builder 9 RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64 10 11 WORKDIR /build 12 13 # Copy metal dependencies first (intermediate docker image caching) 14 # Copy metalgo directory if present (for manual CI case, which uses local dependency) 15 COPY go.mod go.sum metalgo* ./ 16 17 # Download metal dependencies using go mod 18 RUN go mod download && go mod tidy -compat=1.18 19 20 # Copy the code into the container 21 COPY . . 22 23 # Pass in SUBNET_EVM_COMMIT as an arg to allow the build script to set this externally 24 ARG SUBNET_EVM_COMMIT 25 ARG CURRENT_BRANCH 26 27 RUN export SUBNET_EVM_COMMIT=$SUBNET_EVM_COMMIT && export CURRENT_BRANCH=$CURRENT_BRANCH && ./scripts/build.sh /build/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy 28 29 # ============= Cleanup Stage ================ 30 FROM metalblockchain/metalgo:$METAL_VERSION AS builtImage 31 32 # Copy the evm binary into the correct location in the container 33 COPY --from=builder /build/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy /metalgo/build/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy