Skip to content

fix: harden build pipeline and improve reproducibility#13666

Open
DaviBaum wants to merge 1 commit intodocker:mainfrom
DaviBaum:fix-build-context
Open

fix: harden build pipeline and improve reproducibility#13666
DaviBaum wants to merge 1 commit intodocker:mainfrom
DaviBaum:fix-build-context

Conversation

@DaviBaum
Copy link

Summary

  • Add .dockerignore to keep .git/ and docs/ in the Docker build context, which are required by validate-go-mod, validate-headers, and validate-docs targets
  • Pin osxcross image by digest (sha256:ab016ff...) for reproducible, tamper-resistant builds
  • Use test channel for Docker apt repo to fix apt-key deprecation warnings in CI
  • Fix COPY --from stage name reference in the license-update target

Context

The .git/ directory was excluded from the Docker build context, causing validate-go-mod to fail (it runs git diff to check vendor consistency). Similarly, docs/ was excluded, breaking validate-docs. The .dockerignore now explicitly includes both while still excluding unnecessary files like bin/ and build/.

The osxcross base 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-mod passes
  • make validate-headers passes
  • make validate-docs passes
  • make binary builds successfully

- 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>
@DaviBaum DaviBaum requested a review from a team as a code owner March 25, 2026 01:25
@DaviBaum DaviBaum requested review from glours and ndeloof March 25, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant