mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 06:23:47 +00:00
build using cross-compilation (#274)
This commit is contained in:
parent
b93ef66540
commit
89b3fdd74c
1 changed files with 4 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ ARG VERSION=""
|
||||||
ARG BUILDNUM=""
|
ARG BUILDNUM=""
|
||||||
|
|
||||||
# Build Geth in a stock Go builder container
|
# Build Geth in a stock Go builder container
|
||||||
FROM golang:1.21-alpine as builder
|
FROM --platform=${BUILDPLATFORM} golang:1.21-alpine as builder
|
||||||
|
|
||||||
RUN apk add --no-cache gcc musl-dev linux-headers git
|
RUN apk add --no-cache gcc musl-dev linux-headers git
|
||||||
|
|
||||||
|
|
@ -14,7 +14,9 @@ COPY go.sum /go-ethereum/
|
||||||
RUN cd /go-ethereum && go mod download
|
RUN cd /go-ethereum && go mod download
|
||||||
|
|
||||||
ADD . /go-ethereum
|
ADD . /go-ethereum
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \
|
ARG TARGETOS
|
||||||
|
ARG TARGETARCH
|
||||||
|
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
|
||||||
cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
|
cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
|
||||||
|
|
||||||
# Pull Geth into a second stage deploy alpine container
|
# Pull Geth into a second stage deploy alpine container
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue