Skip to content

Commit 6d2a2df

Browse files
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 <jakobweinstock@gmail.com>
1 parent 9f5e228 commit 6d2a2df

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

images/hook-embedded/pull-images.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ function main() {
7070
fi
7171
done
7272

73+
# As hook-docker uses the overlay2 storage driver the DinD must use the overlay2 storage driver too.
74+
# make sure the overlay2 storage driver is used by the DinD container.
75+
# The VFS storage driver might get used if /var/lib/docker in the DinD container cannot be used by overlay2.
76+
storage_driver=$(docker exec "${dind_container}" docker info --format '{{.Driver}}')
77+
if [[ "${storage_driver}" != "overlay2" ]]; then
78+
echo "DinD container is not using overlay2 storage driver"
79+
exit 1
80+
fi
81+
7382
# remove the contents of /var/lib/docker-embedded so that any previous images are removed. Without this it seems to cause boot issues.
7483
docker exec "${dind_container}" sh -c "rm -rf /var/lib/docker-embedded/*"
7584

0 commit comments

Comments
 (0)