Skip to content

Commit 8599093

Browse files
authored
Merge pull request #156 from dflook/add-base-digest-to-image
Add the base image digest to the release image
2 parents 418d2ae + 9b8fff4 commit 8599093

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@ jobs:
2727
run: |
2828
RELEASE_TAG="${{ github.event.release.tag_name }}"
2929
30+
docker pull --quiet danielflook/terraform-github-actions-base:latest
31+
BASE_DIGEST="$(docker image inspect --format="{{index .RepoDigests 0}}" "danielflook/terraform-github-actions-base:latest" | sed 's/.*@//')"
32+
3033
docker build --tag dflook/terraform-github-actions \
3134
--label org.opencontainers.image.created="$(date '+%Y-%m-%dT%H:%M:%S%z')" \
3235
--label org.opencontainers.image.source="https://github.com/${{ github.repository }}" \
3336
--label org.opencontainers.image.revision="${{ github.sha }}" \
34-
--label org.opencontainers.image.version="$RELEASE_TAG" \
35-
--label vcs-ref="$RELEASE_TAG" \
36-
--label build="$GITHUB_RUN_ID" \
37+
--label org.opencontainers.image.base.name="docker.io/danielflook/terraform-github-actions-base:latest" \
38+
--label org.opencontainers.image.base.digest="$BASE_DIGEST" \
39+
--label build="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
3740
image
3841
3942
docker tag dflook/terraform-github-actions ghcr.io/dflook/terraform-github-actions:$RELEASE_TAG

0 commit comments

Comments
 (0)