go-ethereum Docker & Self-Hosted Deployment

GitHub

Go implementation of the Ethereum protocol

51,412 stars Go Go 42 files ยท ~42,884 tokens #blockchain#ethereum#geth#go#p2p
1. Pull Image (DOCKERHUB) docker pull ethereum/go-ethereum:latest
2. Docker Run (1-Click Launch) docker run -d --name go-ethereum -p 8545:8545 --restart always ethereum/go-ethereum:latest
3. Podman Run podman run -d --name go-ethereum -p 8545:8545 --restart always ethereum/go-ethereum:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/ethereum/go-ethereum:latest
5. ORAS Pull (OCI Artifact) oras pull ethereum/go-ethereum:latest
Dockerfile
# Support setting various labels on the final image
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

# Build Geth in a stock Go builder container
FROM golang:1.27-alpine AS builder

RUN apk add --no-cache gcc musl-dev linux-headers git

# 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/

EXPOSE 8545 8546 30303 30303/udp
ENTRYPOINT ["geth"]

# Add some metadata labels to help programmatic image consumption
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""

LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"