Skip to content

chore: add OCI standard labels to Dockerfile templates#2570

Open
Erwan-loot wants to merge 2 commits intonextcloud:masterfrom
Erwan-loot:chore/add-oci-labels
Open

chore: add OCI standard labels to Dockerfile templates#2570
Erwan-loot wants to merge 2 commits intonextcloud:masterfrom
Erwan-loot:chore/add-oci-labels

Conversation

@Erwan-loot
Copy link
Copy Markdown

Context

Add OCI (Open Container Initiative) standard labels to Dockerfile-debian.template and Dockerfile-alpine.template for better image metadata and container registry compatibility.

Type

Improvement — metadata only, no functional changes.

Labels Added

Label Value Source
org.opencontainers.image.title Nextcloud Static
org.opencontainers.image.description A safe home for all your data. Access & share your files, calendars, contacts, mail & more from any device, on your terms. Static
org.opencontainers.image.url https://nextcloud.com Static
org.opencontainers.image.source https://github.com/nextcloud/docker Static
org.opencontainers.image.documentation https://hub.docker.com/_/nextcloud Static
org.opencontainers.image.vendor Nextcloud GmbH Static
org.opencontainers.image.licenses AGPL-3.0-or-later Static
org.opencontainers.image.version %%VERSION%% → e.g. 33.0.2 Template variable (existing sed substitution)

The %%VERSION%% placeholder is already used in ENV NEXTCLOUD_VERSION %%VERSION%% and is replaced globally by update.sh, so it works in the LABEL instruction with no changes required to update.sh.

The LABEL block is placed after the final COPY instructions and before ENTRYPOINT, which avoids cache invalidation for the expensive build steps above.

Benefits

  • Registry Compatibility: GHCR, Docker Hub, and other registries display these labels in their UI
  • Dependency Bot Changelogs: Renovate and Dependabot use org.opencontainers.image.source to link release notes in update PRs
  • Image Provenance: Track source code and version information for security audits
  • Standardization: Follow OCI best practices for container image metadata

Changes

  • Dockerfile-debian.template — added 8-label LABEL block before ENTRYPOINT
  • Dockerfile-alpine.template — added 8-label LABEL block before ENTRYPOINT

The generated Dockerfiles (32/, 33/ × apache/fpm/fpm-alpine) will be automatically updated on the next run of update.sh (triggered by the update-sh.yml CI workflow after merge).

How to verify

After image build:

docker inspect <image> --format '{{ json .Config.Labels }}' | jq

References

Signed-off-by: Erwan Hervé erwan.herve+claude@outlook.fr

Copilot AI review requested due to automatic review settings April 16, 2026 16:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds OCI (Open Container Initiative) standard image labels to the Debian and Alpine Dockerfile templates to improve published image metadata in registries without changing build/runtime behavior.

Changes:

  • Add an OCI LABEL block to Dockerfile-debian.template (title, description, url, source, documentation, vendor, licenses, version).
  • Add the same OCI LABEL block to Dockerfile-alpine.template.
  • Reuse the existing %%VERSION%% template substitution performed by update.sh (no script changes required).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Dockerfile-debian.template Adds OCI standard labels near the end of the template, using %%VERSION%% for org.opencontainers.image.version.
Dockerfile-alpine.template Adds the same OCI standard labels near the end of the template, using %%VERSION%% for org.opencontainers.image.version.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Erwan-loot Erwan-loot closed this Apr 16, 2026
@Erwan-loot Erwan-loot force-pushed the chore/add-oci-labels branch from f6293ea to 17c2c59 Compare April 16, 2026 16:59
Signed-off-by: Erwan Hervé <62173453+Erwan-loot@users.noreply.github.com>
Signed-off-by: Erwan Hervé <62173453+Erwan-loot@users.noreply.github.com>
@Erwan-loot Erwan-loot reopened this Apr 16, 2026
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