Skip to content

pkg: Keep Go-version defaults only in Dockerfiles - #537

Merged
vvoland merged 1 commit into
docker:mainfrom
vvoland:nooverride
Oct 16, 2026
Merged

vvoland merged 1 commit into
docker:mainfrom
vvoland:nooverride

Conversation

@vvoland

@vvoland vvoland commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Go-version defaults were duplicated in Bake and package Dockerfiles,
which could drift and make direct builds differ from Bake builds.

Removed the package-specific defaults from Bake and kept them in the
Dockerfiles, alongside their upstream references.
Bake still accepts explicit GO_VERSION overrides and defers to the
Dockerfile default when the value is unset or empty.
Updated the Go-update workflow to write only Dockerfile defaults.

Direct and Bake builds use the same package-specific Go versions.

@vvoland
vvoland requested review from a team as code owners October 14, 2026 12:51
@vvoland
vvoland requested review from glours and ndeloof and removed request for a team October 14, 2026 12:51
@vvoland vvoland changed the title pkg: Require an explicit Go version in Dockerfiles pkg: Remove duplicate Go-version defaults from Dockerfiles Oct 14, 2026
Comment thread pkg/agent/Dockerfile Outdated
Comment on lines +31 to +32
ARG GO_VERSION="1.27.2"
# An unset GO_VERSION uses the rolling tag for GO_IMAGE_VARIANT.
ARG GO_VERSION

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious; should we do the reverse; keep the Dockerfile as canonical source of truth, and don't set GO_VERSION args if there's nothing to override?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would work as well I guess...
@crazy-max any opinions here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum would prefer to keep it explicit for provenance

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think ideally, we'd just have the default version in Dockerfile, then for cases we need to override, we can set the build-arg.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok changed it

Comment thread pkg/agent/Dockerfile
ARG GO_VERSION="1.27.2"
# An unset GO_VERSION uses the rolling tag for GO_IMAGE_VARIANT.
ARG GO_VERSION
ARG GO_IMAGE_VARIANT="bookworm"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW; we should also make a pass to migrate to "stable" (trixie); bookworm is oldstable.

@vvoland vvoland changed the title pkg: Remove duplicate Go-version defaults from Dockerfiles pkg: Keep Go-version defaults only in Dockerfiles Oct 16, 2026
Go-version defaults were duplicated in Bake and package Dockerfiles,
which could drift and make direct builds differ from Bake builds.

Removed the package-specific defaults from Bake and kept them in the
Dockerfiles, alongside their upstream references.

Bake still accepts explicit GO_VERSION overrides and defers to the
Dockerfile default when the value is unset or empty.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland
vvoland merged commit 052cdf4 into docker:main Oct 16, 2026
2056 of 2058 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants