fix: publish distroless Docker image with dockers v2#716
fix: publish distroless Docker image with dockers v2#716Siddhant-K-code wants to merge 1 commit into
Conversation
WalkthroughSwitches the Docker base image from ChangesDistroless Multi-Platform Docker Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the release pipeline to publish a multi-platform Docker image based on a distroless (static, nonroot) base so that CA certificates are present at runtime, fixing TLS failures when the CLI runs in Docker and connects to HTTPS endpoints.
Changes:
- Switch
.goreleaser.Dockerfilefromscratchto distroless static nonroot and adjust the binary copy path. - Replace per-arch
dockers+docker_manifestswith a single multi-platformdockers_v2configuration in GoReleaser v2. - Update the GitHub Actions workflow logic that extracts/publishes the released image digest from GoReleaser artifacts, and document the CA cert behavior in the README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Documents the Docker image’s multi-platform nature and CA certificate availability. |
| .goreleaser.yaml | Migrates Docker publishing configuration to dockers_v2 for multi-platform builds. |
| .goreleaser.Dockerfile | Moves the runtime base image to distroless static nonroot and updates how the binary is copied in. |
| .github/workflows/main.yaml | Adjusts digest extraction to match dockers_v2 “Docker Image” artifacts for provenance/verification steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
SoulPancake
left a comment
There was a problem hiding this comment.
dockers_v2 is currently still experimental.
There will be a stable release with goreleaser v3 launch, so we probably shouldn't use it right now
|
https://github.com/openfga/cli/pull/634/changes#r2828917491 |
c365b63 to
bab9eeb
Compare
|
Good call. I pushed This now stays on the documented That keeps the existing manifest publishing shape, avoids the experimental I also folded in the smaller review notes:
One caveat: GoReleaser v2.16 now marks |
|
Oh wait, I think my earlier concern here is outdated. This note from May means I think it should be fine to move to dockers_v2 after all.Sorry for the back and forth on this, Let's do |
bab9eeb to
c7f6dc4
Compare
|
Yep, that changes the decision. I pushed I kept the other review fixes in place:
I also updated the PR description and added the v2.16 reference. Local focused |
SoulPancake
left a comment
There was a problem hiding this comment.
dockers_v2 produces multiplatform image artifacts
docker_signs still targets the artifacts: manifests
So will this work with dockers_v2? I think it might remain unsigned
Maybe we should do something like this https://github.com/enix/x509-certificate-exporter/blob/a1a454659e5f8b403f7eeb33ad97f167a9e22e4d/.goreleaser.yaml#L304
Summary
scratchtogcr.io/distroless/static-debian13:nonrootso public CA roots are available in the container.dockers+docker_manifestswith GoReleaserdockers_v2, which is no longer experimental as of GoReleaser v2.16.linux/amd64andlinux/arm64in the artifact metadata.Docs
Validation
Ran:
make buildgo test ./...goreleaser release --clean --config .goreleaser.yaml --snapshot --skip sign,publish,announce,dockerdockers_v2GoReleaser validation with a local fake Docker shimjqcheck against a representative multi-platformDocker ImageartifactReviewer command with Docker available:
goreleaser release --clean --config .goreleaser.yaml --snapshot --skip sign,publish,announceReference: https://goreleaser.com/blog/goreleaser-v2.16/#docker-v2-is-no-longer-experimental
Fixes #639