Add OCI image labels carrying git commit SHA to Docker images#2049
Merged
Conversation
Declare the standard OCI labels (revision, source, version, created) in the final image stage of portable.Dockerfile, gpu.Dockerfile and Dockerfile via build args defaulting to unknown, and inject the values from the publish workflows so published images can be mapped back to their source commit.
| push: true | ||
| no-cache: true | ||
| build-args: | | ||
| GIT_COMMIT=${{ github.sha }} |
Member
There was a problem hiding this comment.
sha is probably enough, but for convenience, can we also add "tags"/ commit title?
Contributor
Author
There was a problem hiding this comment.
The tag is already attached to the images, just by a different method. A published image will end up as something like OpenDroneMap/ODM:3.6.1. These tags are extra values so we have an unmovable reference to what sha was actually built in that. Looking closer at the OCI labels, we might want a few more of them but I don't see which one would obviously suite a commit title - https://specs.opencontainers.org/image-spec/annotations/. Could always do a custom label but I think we might be able to have everything all link together with the sha and url alone.
DodgySpaniard
approved these changes
Jul 15, 2026
Add the static title, description, url, documentation, licenses and vendor OCI image labels to the final image stage of portable.Dockerfile, gpu.Dockerfile and Dockerfile.
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.
Declare the standard OCI labels (revision, source, version, created) in the final image stage of
portable.Dockerfile,gpu.DockerfileandDockerfilevia build args.These defaulting to unknown as we can't automatically add them from within Docker but we inject the values from the publish workflows so published images can be mapped back to their source commit.
This means the generated docker images will link to the exact version that was built which will make comparisons easier.