Skip to content

Fix Dockerfile Go version mismatch#142

Merged
wind-c merged 1 commit intowind-c:mainfrom
63n0:fix-golang-version
Dec 1, 2025
Merged

Fix Dockerfile Go version mismatch#142
wind-c merged 1 commit intowind-c:mainfrom
63n0:fix-golang-version

Conversation

@63n0
Copy link
Copy Markdown
Contributor

@63n0 63n0 commented Nov 30, 2025

This pull request fixes the Docker build failure shown below.

The builder stage uses Go 1.21, while go.mod requires Go 1.24 or higher.
This mismatch causes go mod download to fail during the build.

This PR updates the builder image to Go 1.24 to match the go.mod requirement.

$ sudo docker build .
[+] Building 1.9s (13/17)                                                                  docker:default
 => [internal] load build definition from Dockerfile                                                 0.0s
 => => transferring dockerfile: 384B                                                                 0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                     1.6s
 => [internal] load metadata for docker.io/library/golang:1.21-alpine3.20                            1.5s
 => [internal] load .dockerignore                                                                    0.0s
 => => transferring context: 2B                                                                      0.0s
 => [builder  1/10] FROM docker.io/library/golang:1.21-alpine3.20@sha256:2414035b086e3c42b99654c8b2  0.0s
 => [internal] load build context                                                                    0.0s
 => => transferring context: 10.35kB                                                                 0.0s
 => [stage-1 1/3] FROM docker.io/library/alpine:latest@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be50  0.0s
 => CACHED [builder  2/10] RUN apk update                                                            0.0s
 => CACHED [builder  3/10] RUN apk add git                                                           0.0s
 => CACHED [builder  4/10] WORKDIR /app                                                              0.0s
 => [builder  5/10] COPY go.mod ./                                                                   0.0s
 => [builder  6/10] COPY go.sum ./                                                                   0.0s
 => ERROR [builder  7/10] RUN go mod download                                                        0.1s
------                                                                                                    
 > [builder  7/10] RUN go mod download:
0.135 go: go.mod requires go >= 1.24 (running go 1.21.13; GOTOOLCHAIN=local)
------
Dockerfile:10
--------------------
   8 |     COPY go.mod ./
   9 |     COPY go.sum ./
  10 | >>> RUN go mod download
  11 |     
  12 |     COPY . ./
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c go mod download" did not complete successfully: exit code: 1

@wind-c wind-c merged commit ecdb0d1 into wind-c:main Dec 1, 2025
@wind-c
Copy link
Copy Markdown
Owner

wind-c commented Dec 1, 2025

Thanks! @63n0

@63n0 63n0 deleted the fix-golang-version branch December 1, 2025 13:51
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