ci: use docker github builder to build bin image - #7137
Conversation
eaeb448 to
d632f38
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The migration from the inline bin-image job to a dedicated reusable workflow via docker/github-builder is well-structured. The drafter identified three hypotheses; all three were dismissed after verification:
-
VERSION raw ref —
vars: VERSION=${{ github.ref }}passes a raw git ref (e.g.refs/tags/v27.0.0), butscripts/build/.variablesexplicitly handles all raw ref formats via acasestatement (refs/tags/v*→ strips to clean semver,refs/heads/*→ branch name,refs/pull/*→pr-N). The build scripts were designed for this pattern — not a bug. -
Unrestricted
pull_requesttrigger — Running the cross-platform build on every PR (vs. the old skip-on-PR behavior) is intentional per the PR description: the Docker GitHub Builder distributes across runners and provides PR-time validation without pushing. -
id-token: writeon PR builds — For fork PRs, GitHub Actions automatically restricts OIDC tononeregardless of what the workflow declares. For same-repo PRs,push: falsemeans the reusable workflow should not attempt Docker Hub authentication. The Docker-authored reusable workflow is designed for this pattern.
The SHA-pinned reusable workflow reference (@27ade872c1e2296e62ef15ab3b10d37665e57cf7 # v1.15.0), contents: read global permission, and repository guard (if: github.repository == 'docker/cli') are all good practices correctly carried over.
Dismissed security findings (review manually)
.github/workflows/bin-image.yml:31 —id-token: writegranted on pull_request events (verifier mitigation: fork PRs are protected by GitHub's automatic OIDC restriction; same-repo PRs are protected bypush: falsein the reusable workflow call)
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Dismissed security findings (review manually)
.github/workflows/bin-image.yml:25 —pull_requesttrigger combined withid-token: writepermission (verifier mitigation: Theif: ${{ github.repository == 'docker/cli' }}job guard prevents execution for fork PRs, and GitHub's platform-level controls do not issue OIDC tokens for untrustedpull_requestevents from forks regardless of the permission declaration. This matches an established pattern in Docker org workflows.)
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
d632f38 to
ad8dce1
Compare
|
|
||
| bin-image: | ||
| runs-on: ubuntu-24.04 | ||
| if: ${{ github.event_name != 'pull_request' && github.repository == 'docker/cli' }} |
There was a problem hiding this comment.
would like to change this cond at some point so we can test build of the bin-image on PRs but needs docker/github-builder#266
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The diff replaces the inline multi-step bin-image build with a call to the docker/github-builder reusable workflow. The migration looks functionally correct: the SHA is pinned with a version comment, required permissions (id-token: write) are preserved, OIDC credentials are forwarded via registry-identities, QEMU and cross-compilation targets are carried over, and GHA cache configuration is maintained.
Three low-severity observations were noted but do not warrant blocking this PR:
Lower-confidence findings (not posted inline)
- [low]
.github/workflows/build.yml:120— Deadtype=ref,event=prmeta-tag rule — PR events are already excluded by the job-levelif:guard (unverified / low) - [low]
.github/workflows/build.yml:102— Unverified SHA/tag correspondence fordocker/github-builder— the# v1.15.0comment may not match the pinned commit SHA (unverified / low) - [low]
.github/workflows/build.yml:112—push: trueis now hardcoded rather than conditionally gated ongithub.event_name != 'pull_request'; safe in practice due to the job-levelif:guard, but slightly less defensive (unverified / low)
similar to moby/moby#51838
Use the Docker GitHub Builder to build the bin image. It now distributes across runners but also generates signed SLSA-compliant provenance attestations.