chore(image): label the image so ghcr shows a description - #29
Merged
Conversation
The package page on ghcr.io showed its "add LABEL org.opencontainers.image.description" hint, because the Dockerfile carried no OCI labels at all. Add the five standard ones, taking the description from the repo's own and the license from LICENSE. The label alone is not enough here. The image is built for two platforms, and ghcr reads a multi-arch package's description off the manifest index, not off the per-platform image configs where --label lands - so the page would have stayed blank. Ask metadata-action for index-level annotations and hand them to build-push-action alongside the labels. metadata-action already emitted a description label from the repo metadata, and --label wins over the Dockerfile; the labels in the file are what make a plain `docker build` produce a labelled image too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ghcr.io package page was showing its own hint:
It was right — the Dockerfile carried no OCI labels at all.
What changed
Dockerfile— the five standard OCI labels:title,description,source,url,licenses. The description text is the repo's own GitHub description;licensesisMIT, matchingLICENSE..github/workflows/image.yml— the label alone would not have fixed the page. The image is built forlinux/amd64,linux/arm64, and ghcr reads a multi-arch package's description off the manifest index, not off the per-platform image configs where--labellands. So:DOCKER_METADATA_ANNOTATIONS_LEVELS: index,manifeston themetadata-actionstep, andannotations:passed tobuild-push-actionalongsidelabels:.Worth noting
metadata-actionwas already emitting adescriptionlabel from the repo metadata, and--labelwins over the Dockerfile. The labels in the file are what make a plain localdocker buildproduce a labelled image too — both paths now carry the same text.Verification
Local
docker build, thendocker image inspect --format '{{json .Config.Labels}}':{ "org.opencontainers.image.description": "Grafana + Prometheus board for a repo fleet: template drift, CI on the default branch, open pull requests, and your local working copies.", "org.opencontainers.image.licenses": "MIT", "org.opencontainers.image.source": "https://github.com/Jebel-Quant/monitoring", "org.opencontainers.image.title": "Fleet monitoring", "org.opencontainers.image.url": "https://jebel-quant.github.io/monitoring/" }The index annotations can only be confirmed after this merges and the Image workflow republishes — the package page should then carry the description instead of the hint.
🤖 Generated with Claude Code