Repository navigation
ci: publish official multi-arch Docker image to GHCR - #2
Conversation
|
@0xABCD01 plz review |
0xABCD01
left a comment
There was a problem hiding this comment.
Thanks for this — the multi-arch GHCR setup looks good. Minimal workflow permissions, GITHUB_TOKEN login, multi-stage build and the non-root user are all the right calls, and the Dockerfile matches the src layout.
Approving, but one fix before this merges: in docker.yml the latest tag is gated on {{is_default_branch}}. On a tag push the ref is refs/tags/vX.Y.Z, not the default branch, so that condition evaluates false and latest would never get published on releases — which is the main trigger of this workflow. Could you enable it for version tags instead, e.g. enable=${{ startsWith(github.ref, 'refs/tags/v') }}?
Everything else in the diff looks fine to me.
|
Fixed in cd759d8 — the - type=raw,value=latest,enable={{is_default_branch}}
+ type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}So a One pre-existing thing I left alone to keep this diff minimal: |
|
Post-merge note: no image has been published yet. The workflow only runs on a Proposal: cut a new version tag on
That runs both Two caveats:
Happy to open that PR ( |
Summary
Adds an official multi-arch container image published to GHCR, so
cachelintcan be used in CI without installing it viapipon every run.Changes
Dockerfile— multi-stage build onpython:3.12-slim; the wheel is built in a builder stage and only the installed package lands in the final image. Runs as a non-rootcachelintuser (uid 1001).ENTRYPOINT ["cachelint"],WORKDIR /work..github/workflows/docker.yml— triggers onv*tags (same asrelease.yml). Buildslinux/amd64+linux/arm64via QEMU/Buildx and pushes toghcr.io/<owner>/<repo>with tagsvX.Y.Z,vX.Y,latest. Usesdocker/metadata-actionfor tagging andcache-from: type=ghafor incremental builds.README.md— GHCR badge, a "Container image" section withdocker runanddigestexamples, and a CI snippet usingdocker://.Image
linux/amd64,linux/arm64Checklist
pytestpasses locally