Skip to content

Commit d75ba52

Browse files
authored
Merge pull request moby#3554 from candrews/patch-1
ci: add OCI image annotations to docker images
2 parents df350f3 + 06a1708 commit d75ba52

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

hack/images

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ if [ -n "$localmode" ]; then
5252
attestFlags=""
5353
fi
5454

55+
if [ -z "$localmode" ] && [ "$GITHUB_ACTIONS" = "true" ]; then
56+
outputFlag="${outputFlag},annotation.org.opencontainers.image.title=BuildKit"
57+
if [ -n "$GITHUB_SHA" ]; then
58+
outputFlag="${outputFlag},annotation.org.opencontainers.image.revision=$GITHUB_SHA"
59+
fi
60+
if [ -n "$GITHUB_REPOSITORY" ] && [ -n "$GITHUB_SERVER_URL" ]; then
61+
outputFlag="${outputFlag},annotation.org.opencontainers.image.source=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
62+
outputFlag="${outputFlag},annotation.org.opencontainers.image.url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY"
63+
fi
64+
if [ -n "$versionTag" ]; then
65+
outputFlag="${outputFlag},annotation.org.opencontainers.image.version=$versionTag"
66+
fi
67+
fi
68+
5569
targetFlag=""
5670
if [ -n "$TARGET" ]; then
5771
targetFlag="--target=$TARGET"

0 commit comments

Comments
 (0)