build: add static linking support (#25492)

This adds support for building statically-linked executables using ci.go.

Static linking is enabled by default in Docker builds, making it possible to
use the geth executable in any Docker image, regardless of the Linux
distribution the Dockerfile is based on.

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
0xe3b0c4
2022-08-10 10:30:59 +02:00
committed by GitHub
co-authored by Felix Lange
parent c4cd632f47
commit c0cc6f6362
4 changed files with 41 additions and 15 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ 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 ./cmd/geth
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