build: pin the Go builder to 1.26.5 and let the toolchain download

The official golang images set GOTOOLCHAIN=local, so a go.mod `go` directive
newer than the base image fails the build at the first go command:

    go: go.mod requires go >= 1.26.5 (running go 1.26.4; GOTOOLCHAIN=local)

Two orthogonal changes. Pinning the base to the exact patch go.mod names makes
the build hermetic — the versions match, so no toolchain is downloaded.
GOTOOLCHAIN=auto is the resilience half: when go.mod next moves ahead of the
pin, the toolchain is fetched and checksum-verified against sum.golang.org
instead of failing the build outright.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-08-01 16:45:09 -07:00
co-authored by Hanzo Dev
parent 6d0887e104
commit 38ed7252ed
+5 -1
View File
@@ -12,7 +12,11 @@ COPY webui/ ./
RUN pnpm build
# ---- Stage 2: Build Go binary ----
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
FROM --platform=$BUILDPLATFORM golang:1.26.5-alpine AS builder
# go.mod pins the toolchain. The golang base image sets GOTOOLCHAIN=local,
# which turns a `go` directive newer than the image into a hard build
# failure instead of a download.
ENV GOTOOLCHAIN=auto
RUN apk add --no-cache git