Skip to content

Add OCI image source label to the Docker image#653

Open
nozomiishii wants to merge 1 commit intorhysd:mainfrom
nozomiishii:add-oci-image-source-label
Open

Add OCI image source label to the Docker image#653
nozomiishii wants to merge 1 commit intorhysd:mainfrom
nozomiishii:add-oci-image-source-label

Conversation

@nozomiishii
Copy link
Copy Markdown

Summary

Add standard OCI image labels to the final stage of Dockerfile so downstream
tooling (Renovate, Dependabot, Docker Hub image page, GHCR "Connect repository")
can auto-resolve this repository as the image source.

Why

When consumers update rhysd/actionlint via Renovate or Dependabot, the
generated PR body currently has no repository link and no release notes
section — these tools read org.opencontainers.image.source from the image
metadata to discover the source repo.

Since actionlint also distributes a Docker image (via docker://rhysd/actionlint
and the pre-commit integration), consumers who pin to a specific Docker tag
for reproducible CI benefit from this change automatically.

Changes

  • Add LABEL org.opencontainers.image.source (points to this repo)
  • Add 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> -version works as before.

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
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.

1 participant