Add OCI image source label to the Docker image#653
Open
nozomiishii wants to merge 1 commit intorhysd:mainfrom
Open
Add OCI image source label to the Docker image#653nozomiishii wants to merge 1 commit intorhysd:mainfrom
nozomiishii wants to merge 1 commit intorhysd:mainfrom
Conversation
Add `org.opencontainers.image.source` and `org.opencontainers.image.licenses` to the final stage of the Dockerfile so downstream tools (Renovate, Dependabot, Docker Hub image page, GHCR "Connect repository") can auto-resolve this repository as the image source. Fixes the missing repository link and release notes section on generated dependency update PRs in consumer repos. Ref: https://github.com/opencontainers/image-spec/blob/main/annotations.md
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.
Summary
Add standard OCI image labels to the final stage of
Dockerfileso downstreamtooling (Renovate, Dependabot, Docker Hub image page, GHCR "Connect repository")
can auto-resolve this repository as the image source.
Why
When consumers update
rhysd/actionlintvia Renovate or Dependabot, thegenerated PR body currently has no repository link and no release notes
section — these tools read
org.opencontainers.image.sourcefrom the imagemetadata to discover the source repo.
Since actionlint also distributes a Docker image (via
docker://rhysd/actionlintand the pre-commit integration), consumers who pin to a specific Docker tag
for reproducible CI benefit from this change automatically.
Changes
LABEL org.opencontainers.image.source(points to this repo)LABEL org.opencontainers.image.licenses="MIT"(matches the project LICENSE)References
Verification
docker build .succeeds locally.docker image inspect <tag> --format '{{json .Config.Labels}}'shows the new labels:{ "org.opencontainers.image.licenses": "MIT", "org.opencontainers.image.source": "https://github.com/rhysd/actionlint" }docker run --rm <tag> -versionworks as before.