Skip to content

Conversation

@crazy-max
Copy link
Contributor

Currently, the release Dockerfile can't be built because GO_VERSION build-arg is not specified:

$ docker buildx build -f .github/workflows/release/Dockerfile .
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.75kB done
#1 WARN: InvalidDefaultArgInFrom: Default value for ARG $GO_IMAGE results in empty or invalid base image name (line 19)
#1 DONE 0.0s

#2 [internal] load metadata for docker.io/library/ubuntu:22.04
#2 CANCELED

#3 [internal] load metadata for docker.io/tonistiigi/xx:1.6.1@sha256:923441d7c25f1e2eb5789f82d987693c47b8ed987c4ab3b075d6ed2b5d6779a3
#3 CANCELED

 1 warning found (use docker --debug to expand):
 - InvalidDefaultArgInFrom: Default value for ARG $GO_IMAGE results in empty or invalid base image name (line 19)
Dockerfile:19
--------------------
  17 |     ARG GO_VERSION
  18 |     ARG GO_IMAGE=golang:${GO_VERSION}
  19 | >>> FROM --platform=$BUILDPLATFORM $GO_IMAGE AS go
  20 |     FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1@sha256:923441d7c25f1e2eb5789f82d987693c47b8ed987c4ab3b075d6ed2b5d6779a3 AS xx
  21 |
--------------------
ERROR: failed to build: failed to solve: failed to parse stage name "golang:": invalid reference format

View build details: docker-desktop://dashboard/build/default/default/ohe02mrurdlxr5g5gbwv49ugs

It should have a default as stated by the InvalidDefaultArgInFrom build check: https://docs.docker.com/reference/build-checks/invalid-default-arg-in-from/

Looking at the release workflow, the GO_VERSION is only used for building the Dockerfile so I think we can just move it to the Dockerfile directly.

Also relates to docker/packaging#321 where we have a use case to retrieve go version from upstream projects using outline build request: docker/packaging#319 (comment)

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max force-pushed the dockerfile-go-version branch from 810a75b to 0eac0ee Compare November 27, 2025 13:42
@github-project-automation github-project-automation bot moved this from Needs Triage to Review In Progress in Pull Request Review Nov 27, 2025
@dmcgowan dmcgowan enabled auto-merge November 27, 2025 14:10
@dmcgowan dmcgowan added this pull request to the merge queue Nov 27, 2025
Merged via the queue into containerd:main with commit 2bc9bdb Nov 27, 2025
89 of 92 checks passed
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in Pull Request Review Nov 27, 2025
@crazy-max crazy-max deleted the dockerfile-go-version branch November 27, 2025 15:24
@austinvazquez austinvazquez added cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch cherry-picked/2.1.x PR commits are cherry picked into the release/2.1 branch cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch labels Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/toolchain Build and Release Toolchain cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch cherry-picked/2.1.x PR commits are cherry picked into the release/2.1 branch cherry-picked/2.2.x PR commits are cherry-picked into release/2.2 branch size/XS

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants