Skip to content

Commit

Permalink
Get built image IDs via manifest digests
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Bargull <[email protected]>
  • Loading branch information
mbargull committed Oct 16, 2023
1 parent 7a2e3d6 commit 2b5d90d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/base-glibc-busybox-bash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ jobs:
image='${{ steps.build.outputs.image }}'
ids="$(
for tag in ${{ steps.calculate.outputs.tags }} ; do
buildah images --quiet --no-trunc "${image}:${tag}"
done
buildah manifest inspect "${image}:${tag}" \
| jq -r '.manifests[]|.digest' \
| xargs -I'{}' buildah images --quiet --filter=digest='{}'
done | sort -u
)"
ids="$( printf %s "${ids}" | sort -u )"
for id in ${ids} ; do
podman history "${id}"
buildah bud \
Expand Down Expand Up @@ -150,16 +151,17 @@ jobs:
name: Test Pushed
run: |
image='${{ env.IMAGE_NAME }}'
digests="$(
ids="$(
for tag in ${{ steps.calculate.outputs.tags }} ; do
buildah manifest inspect "${image}:${tag}" \
| jq -r '.manifests[]|.digest'
| jq -r '.manifests[]|.digest' \
| xargs -I'{}' buildah images --quiet --filter=digest='{}'
done | sort -u
)"
for digest in ${digests} ; do
podman history "${image}@${digest}"
for id in ${ids} ; do
podman history "${id}"
buildah bud \
--build-arg=base="${image}@${digest}" \
--build-arg=base="${id}" \
--file=Dockerfile.test \
"images/${image}"
done
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/base-glibc-debian-bash.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,22 @@ jobs:
build-args: |
debian_version=${{ env.DEBIAN_VERSION }}
containerfiles: |
./images/${{ env.IMAGE_NAME }}/Dockerfile
./images/${{ env.IMAGE_NAME }}/Dockerfile
- name: Test
run: |
image='${{ steps.build.outputs.image }}'
digests="$(
ids="$(
for tag in ${{ steps.calculate.outputs.tags }} ; do
buildah manifest inspect "${image}:${tag}" \
| jq -r '.manifests[]|.digest'
| jq -r '.manifests[]|.digest' \
| xargs -I'{}' buildah images --quiet --filter=digest='{}'
done | sort -u
)"
for digest in ${digests} ; do
podman history "${image}@${digest}"
for id in ${ids} ; do
podman history "${id}"
buildah bud \
--build-arg=base="${image}@${digest}" \
--build-arg=base="${id}" \
--file=Dockerfile.test \
"images/${image}"
done
Expand Down Expand Up @@ -144,10 +145,11 @@ jobs:
image='${{ env.IMAGE_NAME }}'
ids="$(
for tag in ${{ steps.calculate.outputs.tags }} ; do
buildah images --quiet --no-trunc "${image}:${tag}"
done
buildah manifest inspect "${image}:${tag}" \
| jq -r '.manifests[]|.digest' \
| xargs -I'{}' buildah images --quiet --filter=digest='{}'
done | sort -u
)"
ids="$( printf %s "${ids}" | sort -u )"
for id in ${ids} ; do
podman history "${id}"
buildah bud \
Expand Down

0 comments on commit 2b5d90d

Please sign in to comment.