From 7ce3d79abab1142b353161b6ec91755c45b6c0f2 Mon Sep 17 00:00:00 2001 From: casjay Date: Sun, 21 Jun 2026 09:49:24 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20Go=20default=20env=20flags?= =?UTF-8?q?=20to=20build=20and=20final=20stages=20=F0=9F=94=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dockerfile: add GOFLAGS=-buildvcs=false to prevent VCS stamp errors when users mount projects without a .git directory (Go 1.18+ default behaviour) - Dockerfile: add GOTELEMETRY=off to disable Go 1.23+ telemetry in containers - Dockerfile: add GOPROXY=https://proxy.golang.org,direct (explicit default, makes override via --env obvious) - Dockerfile: add GOBIN=/usr/local/bin to the final stage — was set in the build stage but missing from the scratch-based final stage; without it, go install inside the running container lands binaries in /usr/local/share/go/bin instead of /usr/local/bin Dockerfile --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 328c5c3..5a398a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -88,6 +88,9 @@ ENV GOBIN="/usr/local/bin" ENV GOCACHE="/usr/local/share/go/cache" ENV CGO_ENABLED="0" ENV GOTOOLCHAIN="auto" +ENV GOFLAGS="-buildvcs=false" +ENV GOTELEMETRY="off" +ENV GOPROXY="https://proxy.golang.org,direct" USER ${USER} WORKDIR /root @@ -272,9 +275,13 @@ ENV PHP_VERSION="${PHP_VERSION}" ENV DISTRO_VERSION="${IMAGE_VERSION}" ENV WWW_ROOT_DIR="${WWW_ROOT_DIR}" ENV GOPATH="/usr/local/share/go" +ENV GOBIN="/usr/local/bin" ENV GOCACHE="/usr/local/share/go/cache" ENV CGO_ENABLED="0" ENV GOTOOLCHAIN="auto" +ENV GOFLAGS="-buildvcs=false" +ENV GOTELEMETRY="off" +ENV GOPROXY="https://proxy.golang.org,direct" COPY --from=build /. /