Skip to content
Snippets Groups Projects
Verified Commit 2772984f authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

Add OCI standard annotation labels to every build

This provides every build with basic labels defined by the OCI standard
for annotations[1]. This includes the project URL, the exact commit an
image is built from, the build time and date as well as the project
title and description.

[1]: https://github.com/opencontainers/image-spec/blob/79b036d80240ae530a8de15e1d21c7ab9292c693/annotations.md
parent 297719e8
No related branches found
No related tags found
1 merge request!6Add OCI standard annotation labels to every build
......@@ -24,7 +24,7 @@ container-build:
- export VCS_URL=$CI_PROJECT_URL
script:
- si-fix "${CI_REGISTRY_BUILD_DOCKERFILE:-./Dockerfile}"
- podman build --pull $CI_REGISTRY_BUILD_ARGS -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA" .
- podman build --pull --label "org.opencontainers.image.source=$CI_PROJECT_URL" --label "org.opencontainers.image.revision=$CI_COMMIT_SHA" --label "org.opencontainers.image.created=$(date --rfc-3339 ns)" --label "org.opencontainers.image.title=$CI_PROJECT_TITLE" $CI_REGISTRY_BUILD_ARGS -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA" .
- podman push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA"
container-tagging:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment