github.com/theQRL/go-zond@v0.1.1/Dockerfile.alltools (about) 1 # Support setting various labels on the final image 2 ARG COMMIT="" 3 ARG VERSION="" 4 ARG BUILDNUM="" 5 6 # Build Geth in a stock Go builder container 7 FROM golang:1.20-alpine as builder 8 9 RUN apk add --no-cache gcc musl-dev linux-headers git 10 11 # Get dependencies - will also be cached if we won't change go.mod/go.sum 12 COPY go.mod /go-ethereum/ 13 COPY go.sum /go-ethereum/ 14 RUN cd /go-ethereum && go mod download 15 16 ADD . /go-ethereum 17 RUN cd /go-ethereum && go run build/ci.go install -static 18 19 # Pull all binaries into a second stage deploy alpine container 20 FROM alpine:latest 21 22 RUN apk add --no-cache ca-certificates 23 COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/ 24 25 EXPOSE 8545 8546 30303 30303/udp 26 27 # Add some metadata labels to help programatic image consumption 28 ARG COMMIT="" 29 ARG VERSION="" 30 ARG BUILDNUM="" 31 32 LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"