Skip to content

Commit

Permalink
Check that DinD uses the overlay2 storage driver:
Browse files Browse the repository at this point in the history
As hook-docker uses the overlay2 storage driver
the DinD image must use the overlay2 storage driver too.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Aug 26, 2024
1 parent 9f5e228 commit 6d2a2df
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions images/hook-embedded/pull-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"

Expand Down

0 comments on commit 6d2a2df

Please sign in to comment.