Skip to content

Commit 5ed1638

Browse files
authored
Merge pull request #1391 from mythi/PR-2023-018
ci: fix image base layer test
2 parents 73e4750 + a5b3f0b commit 5ed1638

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/test-image-base-layer.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ fi
2020
echo "Testing $IMG base layer"
2121

2222
if [ -z "${BUILDER}" ] || [ "${BUILDER}" = 'docker' ] ; then
23+
if [ -z "$(docker image ls -q gcr.io/distroless/static:latest)" ]; then
24+
docker pull gcr.io/distroless/static:latest
25+
fi
2326
distroless_base=$(docker inspect --format='{{index .RootFS.Layers 0}}' "gcr.io/distroless/static") || die "failed to inspect gcr.io/distroless/static"
2427
img_base=$(docker inspect --format='{{index .RootFS.Layers 0}}' "$IMG") || die "failed to inspect $IMG"
2528
elif [ "${BUILDER}" = 'buildah' ] ; then
29+
buildah images -q gcr.io/distroless/static:latest 2>/dev/null || buildah pull gcr.io/distroless/static:latest
2630
distroless_base=$(buildah inspect --type image --format='{{index .OCIv1.RootFS.DiffIDs 0}}' "gcr.io/distroless/static") || die "failed to inspect gcr.io/distroless/static"
2731
img_base=$(buildah inspect --type image --format='{{index .OCIv1.RootFS.DiffIDs 0}}' "$IMG") || die "failed to inspect $IMG"
2832
else

0 commit comments

Comments
 (0)