From f1d093251affa1f3b0327e7c28ce4da8fc1eb2c1 Mon Sep 17 00:00:00 2001 From: Tom Scanlan Date: Fri, 17 Jul 2026 14:36:34 -0400 Subject: [PATCH] fix(docker): pin templ CLI to the go.mod runtime version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The builder stage ran `go install .../templ@latest`. `@latest` now resolves to v0.3.1020, which requires Go >= 1.25, but the builder is golang:1.24-alpine (GOTOOLCHAIN=local) — so the prod image build fails at `templ generate`. Pin the CLI to v0.3.960 to match go.mod's runtime (requires Go 1.23; builds on the 1.24 builder). Regeneration produces zero diff and `go build ./...` passes. The CI test job was already pinned in #11; this aligns the Dockerfile. --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8897dd2..84f3606 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,8 +22,12 @@ COPY . . # Build frontend assets RUN cd web && npm run build -# Install templ and generate template files -RUN go install github.com/a-h/templ/cmd/templ@latest +# Install templ and generate template files. +# Pin the CLI to the go.mod runtime version (github.com/a-h/templ) so it stays +# buildable on this Go toolchain and `templ generate` matches the runtime. +# `@latest` drifts ahead (v0.3.1020 requires Go >= 1.25, breaking this builder). +# Bump in lockstep with go.mod. +RUN go install github.com/a-h/templ/cmd/templ@v0.3.960 RUN templ generate # Build both binaries