Dockerfile.alltools 871 B

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