From 6d2a2df9352f7d644db6bd7b1fa11c8afd7090e9 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Mon, 26 Aug 2024 17:58:50 -0600 Subject: [PATCH] Check that DinD uses the overlay2 storage driver: As hook-docker uses the overlay2 storage driver the DinD image must use the overlay2 storage driver too. Signed-off-by: Jacob Weinstock --- images/hook-embedded/pull-images.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/images/hook-embedded/pull-images.sh b/images/hook-embedded/pull-images.sh index b58ba408..9ba25015 100755 --- a/images/hook-embedded/pull-images.sh +++ b/images/hook-embedded/pull-images.sh @@ -70,6 +70,15 @@ function main() { fi done + # As hook-docker uses the overlay2 storage driver the DinD must use the overlay2 storage driver too. + # make sure the overlay2 storage driver is used by the DinD container. + # The VFS storage driver might get used if /var/lib/docker in the DinD container cannot be used by overlay2. + storage_driver=$(docker exec "${dind_container}" docker info --format '{{.Driver}}') + if [[ "${storage_driver}" != "overlay2" ]]; then + echo "DinD container is not using overlay2 storage driver" + exit 1 + fi + # remove the contents of /var/lib/docker-embedded so that any previous images are removed. Without this it seems to cause boot issues. docker exec "${dind_container}" sh -c "rm -rf /var/lib/docker-embedded/*"