Skip to content

Pin gin-gonic/gin to v1.10.0 to fix Go 1.24 build failure#17

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/update-dockerfile-go-version
Draft

Pin gin-gonic/gin to v1.10.0 to fix Go 1.24 build failure#17
Copilot wants to merge 2 commits intomainfrom
copilot/update-dockerfile-go-version

Conversation

Copy link
Contributor

Copilot AI commented Mar 1, 2026

gin-gonic/gin v1.12.0 bumped its minimum Go requirement to 1.25.0. Since there is no committed go.mod, the Dockerfile resolves gin at build time — now landing on v1.12.0 — which the golang:1.24-bullseye builder cannot satisfy.

Change

  • Dockerfile (STAGE 2 — backend-builder): Insert go get github.com/gin-gonic/gin@v1.10.0 between go mod init and go mod tidy to pin gin to the last Go 1.24-compatible release before the dependency graph is resolved.
RUN go mod init music-server-backend || true
RUN go get github.com/gin-gonic/gin@v1.10.0   # ← added
RUN go mod tidy
Original prompt

Problem

The weekly automated Docker build is failing with the following 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)

Root cause: gin-gonic/gin recently released v1.12.0, which bumped its minimum Go version requirement to Go 1.25.0. Because there is no committed go.mod file in the repository, the Dockerfile runs go mod init + go mod tidy at build time, which resolves the latest version of gin — now v1.12.0. The builder image uses golang:1.24-bullseye (Go 1.24.6), which cannot satisfy this requirement, causing the build to fail.

The failing lines in the Dockerfile are:

Dockerfile:13-15
FROM golang:1.24-bullseye AS backend-builder
WORKDIR /src/music-server-backend
RUN go mod init music-server-backend || true
RUN go mod tidy   # <-- fails here

Fix Required

In the Dockerfile, in STAGE 2 (the backend-builder stage), pin gin-gonic/gin to v1.10.0 (the last version compatible with Go 1.24) by adding a go get call before go mod tidy.

Change this section of the Dockerfile:

# STAGE 2: Build Go Backend for Music Server
FROM golang:1.24-bullseye AS backend-builder
WORKDIR /src
COPY --from=source-fetcher /src/AudioMuse-AI-MusicServer .
WORKDIR /src/music-server-backend
RUN go mod init music-server-backend || true
RUN go mod tidy
RUN CGO_ENABLED=1 go build -o music-server .

To this:

# STAGE 2: Build Go Backend for Music Server
FROM golang:1.24-bullseye AS backend-builder
WORKDIR /src
COPY --from=source-fetcher /src/AudioMuse-AI-MusicServer .
WORKDIR /src/music-server-backend
RUN go mod init music-server-backend || true
RUN go get github.com/gin-gonic/gin@v1.10.0
RUN go mod tidy
RUN CGO_ENABLED=1 go build -o music-server .

The only file that needs to be changed is Dockerfile. The new go get line must be inserted between go mod init and go mod tidy so that the pinned version of gin is locked in before tidy resolves the full dependency graph.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: NeptuneHub <171392533+NeptuneHub@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Dockerfile to use Go 1.25.0 for compatibility Pin gin-gonic/gin to v1.10.0 to fix Go 1.24 build failure Mar 1, 2026
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