Last active
February 27, 2022 09:15
-
-
Save WoozyMasta/486dd57919fcb8d58f675c25942189f1 to your computer and use it in GitHub Desktop.
An example of assigning opencontainers annotations when building containers in GitLab CI
This file contains 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
# https://github.com/opencontainers/image-spec/blob/main/annotations.md | |
image="$REGISTRY_DOMAIN/$CI_PROJECT_ROOT_NAMESPACE/$CI_PROJECT_NAME:$CI_COMMIT_REF_NAME" | |
docker build \ | |
--file ./Dockerfile --tag "$image" \ | |
--label org.opencontainers.image.url="$image" \ | |
--label org.opencontainers.image.vendor="$CI_PROJECT_ROOT_NAMESPACE@$CI_SERVER_HOST" \ | |
--label org.opencontainers.image.version="$CI_COMMIT_REF_SLUG" \ | |
--label org.opencontainers.image.description="$CI_PROJECT_TITLE" \ | |
--label org.opencontainers.image.authors="$GITLAB_USER_EMAIL" \ | |
--label org.opencontainers.image.revision="$CI_COMMIT_SHA" \ | |
--label org.opencontainers.image.created="$(date -uIs)Z" . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment