Skip to content

chore: add OCI standard labels to Dockerfile - #51

Open
Erwan-loot wants to merge 1 commit into
civilblur:mainfrom
Erwan-loot:chore/add-oci-labels
Open

chore: add OCI standard labels to Dockerfile#51
Erwan-loot wants to merge 1 commit into
civilblur:mainfrom
Erwan-loot:chore/add-oci-labels

Conversation

@Erwan-loot

Copy link
Copy Markdown

Context

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

Type

Improvement — metadata only, no functional changes.

Labels Added

Label Value Source
org.opencontainers.image.title mazanoke Static
org.opencontainers.image.description A self-hosted local image optimizer that runs in your browser Static
org.opencontainers.image.url https://github.com/civilblur/mazanoke Static
org.opencontainers.image.source https://github.com/civilblur/mazanoke Static
org.opencontainers.image.vendor civilblur Static
org.opencontainers.image.licenses GPL-3.0-only Static
org.opencontainers.image.version ${VERSION} Build arg (optional)
org.opencontainers.image.revision ${REVISION} Build arg (optional)
org.opencontainers.image.created ${CREATED} Build arg (optional)

The three dynamic labels (version, revision, created) use optional build args — the image builds fine without them, they'll simply be empty. When you add CI/CD for automated builds, you can wire them up like so:

docker build \
  --build-arg VERSION=1.0.0 \
  --build-arg REVISION=$(git rev-parse HEAD) \
  --build-arg CREATED=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
  -t ghcr.io/civilblur/mazanoke:1.0.0 .

Benefits

  • Registry UI: GHCR displays title, description, license, and source link in its web interface once these labels are present
  • Dependency bot changelogs: Tools like Renovate and Dependabot use org.opencontainers.image.source to locate and display changelogs in update PRs — users who self-host mazanoke via Docker will see release notes when updates land
  • Image provenance: revision and created allow precise auditing of which source commit produced an image
  • Standardization: follows OCI best practices for container image metadata

Changes

  • Dockerfile: added ARG VERSION, ARG REVISION, ARG CREATED and a LABEL block in the final nginx:alpine stage, placed after the last COPY and before EXPOSE

References

@civilblur

Copy link
Copy Markdown
Owner

Thanks for sharing this, will read up on OCI before taking any action.

@civilblur civilblur self-assigned this May 14, 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