fix: harden build pipeline and improve reproducibility#13666
Open
DaviBaum wants to merge 1 commit intodocker:mainfrom
Open
fix: harden build pipeline and improve reproducibility#13666DaviBaum wants to merge 1 commit intodocker:mainfrom
DaviBaum wants to merge 1 commit intodocker:mainfrom
Conversation
- Add .dockerignore to keep .git/ and docs/ in build context, which are needed by validate-go-mod, validate-headers, and validate-docs targets - Pin osxcross image by digest for reproducible builds - Use test channel for Docker apt repo to fix apt-key deprecation warnings - Fix COPY --from stage name reference in license-update target Signed-off-by: David Baum <davidbaum461@gmail.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
.dockerignoreto keep.git/anddocs/in the Docker build context, which are required byvalidate-go-mod,validate-headers, andvalidate-docstargetsosxcrossimage by digest (sha256:ab016ff...) for reproducible, tamper-resistant buildsCOPY --fromstage name reference in thelicense-updatetargetContext
The
.git/directory was excluded from the Docker build context, causingvalidate-go-modto fail (it runsgit diffto check vendor consistency). Similarly,docs/was excluded, breakingvalidate-docs. The.dockerignorenow explicitly includes both while still excluding unnecessary files likebin/andbuild/.The
osxcrossbase image was referenced by tag only (15.5-alpine), which is mutable. Pinning by digest ensures builds are reproducible and resistant to supply-chain attacks.Test plan
make validate-go-modpassesmake validate-headerspassesmake validate-docspassesmake binarybuilds successfully