Skip to content

Push images by digest to skip per-arch tags#31

Merged
richturner merged 2 commits intomainfrom
ci/push-by-digest-no-arch-tags
May 6, 2026
Merged

Push images by digest to skip per-arch tags#31
richturner merged 2 commits intomainfrom
ci/push-by-digest-no-arch-tags

Conversation

@Miggets7
Copy link
Copy Markdown
Contributor

@Miggets7 Miggets7 commented May 6, 2026

Closes #30.

Summary

  • Replace per-arch tag scaffolding (develop-amd64, develop-arm64, develop-amd64-slim, develop-arm64-slim, plus versioned variants) with buildx push-by-digest. Per-arch images are now uploaded by content digest only; docker buildx imagetools create assembles the multi-arch tags from those digests. Result: only develop/develop-slim/<version>/<version>-slim/latest/latest-slim ever appear on Docker Hub.
  • Base image build switches to a multi-output buildx invocation (type=docker for daemon load + scan/slim, plus type=image,push-by-digest=true,name-canonical=true,push=true for the registry push, with provenance: false to keep the merged manifest clean).
  • Slim image push uses a 2-line Dockerfile.passthrough (FROM ${SRC}) built through the docker driver builder so --build-context docker-image://local-ci-image-slim:latest resolves from the host daemon (the default docker-container driver can't see daemon-only images).
  • Digests cross job boundaries via actions/upload-artifact@v4.6.2 + actions/download-artifact@v4.3.0. PR builds are unchanged in shape (build + scan + slim run, nothing pushed); create_manifests is still gated on non-PR.

Replace the per-arch tag scaffolding (`develop-amd64`, `develop-arm64`,
`develop-amd64-slim`, `develop-arm64-slim`, plus the versioned variants)
with buildx push-by-digest. Each per-arch image is uploaded to Docker
Hub addressed only by content digest; the digest is then handed to
`docker buildx imagetools create` to assemble the final multi-arch
manifest. Net effect on Docker Hub: only the multi-arch tags
(`develop`, `develop-slim`, `<version>`, `<version>-slim`, `latest`,
`latest-slim`) are ever published — no per-arch tags are created at any
point.

The base image build now uses a multi-output buildx invocation
(`type=docker` for daemon load + `type=image,push-by-digest=true,name-canonical=true,push=true`
for the registry push). slim-toolkit still operates on the daemon
image, then a small `Dockerfile.passthrough` (`FROM \${SRC}`) is built
through the docker driver builder so its `--build-context
docker-image://` reference can resolve from the host daemon, exporting
by digest only. Digests cross job boundaries via `actions/upload-artifact`
+ `actions/download-artifact`. PR builds are unchanged in shape: build
+ scan + slim run, nothing is pushed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Miggets7 Miggets7 requested a review from richturner May 6, 2026 13:38
@richturner richturner merged commit 1035196 into main May 6, 2026
3 checks passed
@richturner richturner deleted the ci/push-by-digest-no-arch-tags branch May 6, 2026 14:54
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.

Reduce number of published tags on docker image

2 participants