Skip to content

Commit a5b3f0b

Browse files
committed
ci: fix image base layer test
with docker 23.0.0, the builder defaults to Buildx which changed how multi-stage builds are done. It looks the images used during builds are no longer part of "docker images" which make the image base layer test to fail: Testing docker.io/intel/intel-deviceplugin-operator:devel base layer Error: No such object: gcr.io/distroless/static ERROR: failed to inspect gcr.io/distroless/static Therefore, we must ensure gcr.io/distroless/static is pulled before the image base layer is checked. Signed-off-by: Mikko Ylinen <[email protected]>
1 parent 73e4750 commit a5b3f0b

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)