Skip to content

Commit

Permalink
Merge pull request moby#3554 from candrews/patch-1
Browse files Browse the repository at this point in the history
ci: add OCI image annotations to docker images
  • Loading branch information
crazy-max authored Jul 29, 2024
2 parents df350f3 + 06a1708 commit d75ba52
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions hack/images
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ if [ -n "$localmode" ]; then
attestFlags=""
fi

if [ -z "$localmode" ] && [ "$GITHUB_ACTIONS" = "true" ]; then
outputFlag="${outputFlag},annotation.org.opencontainers.image.title=BuildKit"
if [ -n "$GITHUB_SHA" ]; then
outputFlag="${outputFlag},annotation.org.opencontainers.image.revision=$GITHUB_SHA"
fi
if [ -n "$GITHUB_REPOSITORY" ] && [ -n "$GITHUB_SERVER_URL" ]; then
outputFlag="${outputFlag},annotation.org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
outputFlag="${outputFlag},annotation.org.opencontainers.image.url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
fi
if [ -n "$versionTag" ]; then
outputFlag="${outputFlag},annotation.org.opencontainers.image.version=$versionTag"
fi
fi

targetFlag=""
if [ -n "$TARGET" ]; then
targetFlag="--target=$TARGET"
Expand Down

0 comments on commit d75ba52

Please sign in to comment.