Repository navigation
chore(devcontainer): build with go.mod's Go toolchain (1.27.2) - #1085
Merged
Merged
Conversation
The devcontainer was on go:dev-1.26-bookworm while go.mod and CI moved to toolchain go1.27.2 (#1064) for five stdlib security fixes (GO-2026-6603..6608, fixed in 1.26.9 / 1.27.2). The image sets GOTOOLCHAIN=local, so local builds ignored the pin and used the image's Go: 1.26.4 here. Bumping the tag alone is not enough: dev-1.27-bookworm ships 1.27.1, which is still affected, and the image has no patch-level tags. So also set GOTOOLCHAIN=auto, letting go.mod's toolchain line — the same pin CI uses — select the version, now and on future bumps. Verified by building this Dockerfile and running `go version` against the repo's go.mod: this image GOTOOLCHAIN=auto go1.27.2 (downloaded) base image (control) GOTOOLCHAIN=local go1.27.1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The devcontainer was the last place still on Go 1.26.
go.modand every CI workflow moved totoolchain go1.27.2in #1064 for five standard-library security fixes (GO-2026-6603 … 6608). The devcontainer base image setsGOTOOLCHAIN=local, so local builds ignored that pin and used the image's own Go (1.26.4 in a current container).Two changes to
.devcontainer/Dockerfile, which both the default and the podman configs build from:go:dev-1.26-bookworm→go:dev-1.27-bookworm.ENV GOTOOLCHAIN=auto. The tag bump alone isn't enough:dev-1.27-bookwormcurrently ships 1.27.1, which is still affected by all five advisories (each is fixed only in 1.26.9 / 1.27.2, per vuln.go.dev). MCR publishes no patch-level tags. Withauto,go.mod'stoolchainline, the same pin CI uses, selects the version. That keeps the devcontainer in step with future bumps too, not just this one.Verification
Built this Dockerfile and ran
go versionagainst the repo'sgo.mod:GOTOOLCHAINgo versionautogo1.27.2(downloaded on first use)dev-1.27-bookworm(control)localgo1.27.1The base image sets
GOTOOLCHAINonly as an imageENV; it doesn't write it to/etc/environment. So theENVoverride is enough.Trade-off: the first
gocommand in a new container downloads the 1.27.2 toolchain (about 70 MB, cached afterwards). It disappears once the base tag ships 1.27.2.Existing containers pick this up on Dev Containers: Rebuild Container.
🤖 Generated with Claude Code