Skip to content

fix: upgrade Go builder image to 1.25-bookworm#18

Merged
NeptuneHub merged 2 commits intomainfrom
copilot/update-dockerfile-go-version-again
Mar 1, 2026
Merged

fix: upgrade Go builder image to 1.25-bookworm#18
NeptuneHub merged 2 commits intomainfrom
copilot/update-dockerfile-go-version-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

gin-gonic/gin@v1.12.0 (resolved at build time via go mod tidy) requires Go >= 1.25.0, causing the automated Docker build to fail on the existing golang:1.24-bullseye image.

Change

# Before
FROM golang:1.24-bullseye AS backend-builder

# After
FROM golang:1.25-bookworm AS backend-builder

Upgrades the backend-builder stage base image to golang:1.25-bookworm, satisfying gin v1.12.0's minimum toolchain requirement without pinning any dependency versions.

Original prompt

Problem

The weekly automated Docker build is failing because gin-gonic/gin@v1.12.0 requires Go >= 1.25.0, but the Dockerfile uses golang:1.24-bullseye (Go 1.24.6).

Error:

go: toolchain upgrade needed to resolve github.com/gin-gonic/gin
go: github.com/gin-gonic/gin@v1.12.0 requires go >= 1.25.0 (running go 1.24.6; GOTOOLCHAIN=local)

Since there is no committed go.mod, go mod tidy at build time resolves the latest gin — now v1.12.0 — which Go 1.24 cannot satisfy.

Fix Required

In Dockerfile, STAGE 2 (backend-builder), change the base image from golang:1.24-bullseye to golang:1.25-bookworm.

Change:

FROM golang:1.24-bullseye AS backend-builder

To:

FROM golang:1.25-bookworm AS backend-builder

This is the only change needed. Do NOT add any go get pin lines. Do NOT modify any other part of the Dockerfile.

Note: there is already an open PR (#17) that takes a different approach (pinning gin to v1.10.0). This new PR takes the preferred approach of upgrading the Go image instead, so gin v1.12.0 is fully supported. Please open a separate, new PR for this change.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: NeptuneHub <171392533+NeptuneHub@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Dockerfile to use golang:1.25-bookworm fix: upgrade Go builder image to 1.25-bookworm Mar 1, 2026
@NeptuneHub NeptuneHub marked this pull request as ready for review March 1, 2026 08:32
@NeptuneHub NeptuneHub merged commit 46ff645 into main Mar 1, 2026
2 checks passed
@NeptuneHub NeptuneHub deleted the copilot/update-dockerfile-go-version-again branch March 1, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants