Skip to content

chore: align image labels with OCI image spec#437

Merged
turegjorup merged 1 commit into
release/3.0.0from
feature/oci-image-labels
May 7, 2026
Merged

chore: align image labels with OCI image spec#437
turegjorup merged 1 commit into
release/3.0.0from
feature/oci-image-labels

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Summary

Brings the API and Nginx Dockerfiles into line with the OCI image spec, drops the deprecated LABEL maintainer, and fixes the Nginx image's mislabeled title/description (which was inheriting display-api-service from the source repo).

docker/metadata-action@v6 already injects 8 of the 14 pre-defined org.opencontainers.image.* keys at build time (title, description, url, source, version, created, revision, licenses). This PR adds the four it doesn't emit (authors, vendor, documentation, base.name) directly in the Dockerfiles, and overrides the Nginx-specific title/description in the workflow because metadata-action's --label flags win over Dockerfile LABELs.

Files Changed

  • infrastructure/display-api-service/Dockerfile — drop LABEL maintainer from assets_builder and api_app_builder (builder-stage labels never reach the published image); replace the final stage's LABEL maintainer with a consolidated OCI block.
  • infrastructure/nginx/Dockerfile — same treatment, base.name=nginxinc/nginx-unprivileged:alpine.
  • .github/workflows/build-images.yml — add a labels: input to the Nginx metadata-action step so the published Nginx image gets title=display-api-service-nginx instead of the source-repo default.
  • CHANGELOG.md — entry under [Unreleased].

Out of scope (intentional)

  • org.opencontainers.image.base.digest — meaningless until base images are pinned by digest (TODO already present in the API Dockerfile). Couple with that change.
  • composer.json license vs. LICENSE file mismatch (proprietary vs. MPL-2.0). metadata-action reads from GitHub so the published label is correct, but the source files disagree — separate triage.

Test Plan

  • Build locally: docker buildx build -f infrastructure/display-api-service/Dockerfile --build-context repository-root=. -t oci-check ./infrastructure/display-api-service/
  • docker inspect oci-check --format '{{json .Config.Labels}}' | jq — expect org.opencontainers.image.authors, vendor, documentation, base.name present; no maintainer.
  • Same for the nginx image; expect base.name=nginxinc/nginx-unprivileged:alpine.
  • After CI push, pull ghcr.io/os2display/display-api-service-nginx:<branch-tag> and confirm title=display-api-service-nginx (not display-api-service).

🤖 Generated with Claude Code

- Replace deprecated LABEL maintainer with org.opencontainers.image.authors.
- Add org.opencontainers.image.{vendor,documentation,base.name} in both
  Dockerfiles' final stages — these aren't emitted by docker/metadata-action.
- Drop redundant LABEL maintainer from builder stages (only the final FROM's
  labels reach the published image).
- Override the Nginx image's title/description in build-images.yml so it
  stops inheriting the source-repo defaults; metadata-action's --label
  flags win over Dockerfile LABELs, hence the workflow rather than the
  Dockerfile.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@turegjorup
turegjorup requested a review from tuj May 6, 2026 19:28
@turegjorup turegjorup self-assigned this May 6, 2026
@turegjorup
turegjorup merged commit 665d38c into release/3.0.0 May 7, 2026
17 checks passed
@turegjorup
turegjorup deleted the feature/oci-image-labels branch May 7, 2026 07:56
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.

2 participants