fix(docker): pin base image versions for reproducible builds - #3789
Open
JasonWH wants to merge 1 commit into
Open
fix(docker): pin base image versions for reproducible builds#3789JasonWH wants to merge 1 commit into
JasonWH wants to merge 1 commit into
Conversation
- golang:alpine → golang:1.25-alpine (align with go.mod's go 1.25.0) - alpine:latest → alpine:3.23 (pin runtime base image) Floating tags make builds non-reproducible and can drift from the Go version declared in go.mod. Pinning both stages keeps builds deterministic and reduces supply-chain risk.
JasonWH
requested review from
FGadvancer,
skiffer-git and
withchao
as code owners
August 24, 2026 03:08
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
Problem
The Dockerfile relies on floating image tags —
golang:alpinefor the build stage andalpine:latestfor the runtime stage. This causes:go.mod—go.moddeclaresgo 1.25.0, butgolang:alpinetracks the latest stable Go, which can move past 1.25 and trigger toolchain downloads or subtle behavior changes.:latest) are a common vector for tag-replay/mutability attacks.Changes
golang:alpinegolang:1.25-alpinealpine:latestalpine:3.23Rationale
golang:1.25-alpinealigns the build toolchain with thego 1.25.0declared ingo.mod, keeping builds deterministic and reproducible.alpine:3.23is the current stable Alpine series. Pinning the minor (rather thanlatest) still receives security patches within the series while preventing unexpected jumps to a new minor.Notes