mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
update dockerile to use stagex
This commit is contained in:
parent
8a14362bf7
commit
ad19ed83d4
1 changed files with 15 additions and 26 deletions
39
Dockerfile
39
Dockerfile
|
|
@ -1,33 +1,22 @@
|
||||||
# Support setting various labels on the final image
|
FROM stagex/pallet-go:2025.02.0@sha256:fb2a63e3ed8756e845ceb44ff8fe57493ba15fc84f75f09487359932e089eea3 AS build
|
||||||
ARG COMMIT=""
|
WORKDIR /go-ethereum
|
||||||
ARG VERSION=""
|
COPY go.mod go.sum ./
|
||||||
ARG BUILDNUM=""
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
# Build Geth in a stock Go builder container
|
RUN --network=none <<-EOF
|
||||||
FROM golang:1.24-alpine AS builder
|
go run build/ci.go install -static ./cmd/geth
|
||||||
|
mkdir -p /rootfs/usr/share/ca-cetificates
|
||||||
RUN apk add --no-cache gcc musl-dev linux-headers git
|
cp -r /usr/share/ca-certificates/* /rootfs/
|
||||||
|
EOF
|
||||||
# Get dependencies - will also be cached if we won't change go.mod/go.sum
|
|
||||||
COPY go.mod /go-ethereum/
|
|
||||||
COPY go.sum /go-ethereum/
|
|
||||||
RUN cd /go-ethereum && go mod download
|
|
||||||
|
|
||||||
ADD . /go-ethereum
|
|
||||||
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
|
|
||||||
|
|
||||||
# Pull Geth into a second stage deploy alpine container
|
|
||||||
FROM alpine:latest
|
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates
|
|
||||||
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
|
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=build /rootfs/* /
|
||||||
|
COPY --from=build /go-ethereum/build/bin/geth /usr/bin/geth
|
||||||
EXPOSE 8545 8546 30303 30303/udp
|
EXPOSE 8545 8546 30303 30303/udp
|
||||||
|
|
||||||
ENTRYPOINT ["geth"]
|
ENTRYPOINT ["geth"]
|
||||||
|
|
||||||
# Add some metadata labels to help programmatic image consumption
|
|
||||||
ARG COMMIT=""
|
ARG COMMIT=""
|
||||||
ARG VERSION=""
|
ARG VERSION=""
|
||||||
ARG BUILDNUM=""
|
ARG BUILDNUM=""
|
||||||
|
|
||||||
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"
|
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"
|
||||||
Loading…
Reference in a new issue