Add OCI standard image labels to Docker images#2846
Open
Erwan-loot wants to merge 1 commit into
Open
Conversation
Add org.opencontainers.image.* labels to all five Dockerfiles (tika-server minimal, tika-server full, tika-grpc) and wire the dynamic labels (version, revision, created) as build-args in both CI workflows (docker-release.yml and docker-snapshot.yml). No changes to Tika itself — Docker metadata only. Signed-off-by: Erwan Hervé <62173453+Erwan-loot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds OCI Image Spec–standard labels to the repository’s published Docker images and wires dynamic label values (revision, created) through the Docker CI workflows, improving registry metadata/provenance without affecting Tika runtime behavior.
Changes:
- Add OCI labels (title/description/source/docs/license/version/revision/created) to the five published Dockerfiles while preserving the existing
maintainerlabel. - Update
docker-snapshot.ymlanddocker-release.ymlto compute git SHA + UTC timestamp and pass them asREVISION/CREATEDbuild args to all Docker builds.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tika-server/docker-build/minimal/Dockerfile.snapshot |
Adds OCI labels and new REVISION/CREATED build args for snapshot minimal server image. |
tika-server/docker-build/minimal/Dockerfile |
Adds OCI labels and new REVISION/CREATED build args for release minimal server image. |
tika-server/docker-build/full/Dockerfile.snapshot |
Adds OCI labels and new REVISION/CREATED build args for snapshot full server image. |
tika-server/docker-build/full/Dockerfile |
Adds OCI labels and new REVISION/CREATED build args for release full server image. |
tika-grpc/docker-build/Dockerfile |
Adds OCI labels and new REVISION/CREATED build args for gRPC image. |
.github/workflows/docker-snapshot.yml |
Captures git SHA + build timestamp and passes as build args to all snapshot image builds. |
.github/workflows/docker-release.yml |
Captures git SHA + build timestamp and passes as build args to all release image builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
We're still using a separate repo for 3.x releases. You're ok with making these changes for our current snapshot images (and hopefully) 4.x? |
Contributor
|
@nddipiazza wdyt? lgtm, but 🤷♂️ |
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.
Context
Add OCI Image Spec standard labels to all five Dockerfiles published by this repository, and wire the dynamic labels through the two CI workflows.
This PR touches Docker metadata only — no changes to Tika source code, Maven build, tests, or runtime behaviour.
Note: JIRA registration is currently closed, so I was unable to file a tracker issue first. If a JIRA ticket is required, I'm happy to create one once registration reopens, or a maintainer can create it and I'll update the PR title accordingly.
Type
Improvement — Docker metadata only, no functional changes.
Dockerfiles modified
tika-server/docker-build/minimal/Dockerfileapache/tika:X.Y.Ztika-server/docker-build/full/Dockerfileapache/tika:X.Y.Z-fulltika-server/docker-build/minimal/Dockerfile.snapshotapache/tika:X.Y.Z-SNAPSHOTtika-server/docker-build/full/Dockerfile.snapshotapache/tika:X.Y.Z-SNAPSHOT-fulltika-grpc/docker-build/Dockerfileapache/tika-grpc:X.Y.ZLabels added
org.opencontainers.image.title"Apache Tika Server"/"Apache Tika Server (full)"/"Apache Tika gRPC Server"org.opencontainers.image.descriptionorg.opencontainers.image.urlhttps://hub.docker.com/r/apache/tika(or/tika-grpc)org.opencontainers.image.sourcehttps://github.com/apache/tikaorg.opencontainers.image.documentationhttps://tika.apache.org/org.opencontainers.image.vendorApache Software Foundationorg.opencontainers.image.licensesApache-2.0org.opencontainers.image.version${TIKA_VERSION}/${VERSION}org.opencontainers.image.revision${REVISION}— git SHA at build timeorg.opencontainers.image.created${CREATED}— RFC 3339 build timestampThe existing
maintainerlabel is preserved as-is in all files.CI changes
A new
Set build metadatastep is added to each Docker job in both workflows (docker-release.ymlanddocker-snapshot.yml). It capturesgit rev-parse HEAD(the exact checked-out commit, notGITHUB_SHA, so it is correct for theworkflow_dispatch-with-source_refpath) and the current UTC timestamp, then passes them asREVISIONandCREATEDbuild-args to everydocker/build-push-actioncall.If
REVISIONorCREATEDare not supplied (e.g. a localdocker buildwithout the build-args), the ARGs default to empty strings — the labels are still present but unpopulated, which is harmless.Benefits
org.opencontainers.image.sourceto link release notes in update PRsrevision+createdallow pinpointing the exact source commit and build time for security audits and CVE investigationsHow to verify
After the next CI build, inspect the published image:
All
org.opencontainers.image.*keys should be present and populated.References