From 62d3dfa02824e15e63aac6c71522bd1aa7f805cc Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 5 Sep 2024 08:38:03 +0200 Subject: [PATCH] Implemented skipping of bootstrap volumes. @See https://chatgpt.com/share/fe1e26c1-4b34-4357-a125-ed47035f9e1f --- roles/health-docker-volumes/files/health-docker-volumes.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/roles/health-docker-volumes/files/health-docker-volumes.sh b/roles/health-docker-volumes/files/health-docker-volumes.sh index 8503bc1f..84b944ae 100644 --- a/roles/health-docker-volumes/files/health-docker-volumes.sh +++ b/roles/health-docker-volumes/files/health-docker-volumes.sh @@ -22,6 +22,12 @@ for volume in $anonymous_volumes; do continue fi + container_mount_path=$(docker ps -q | xargs -I {} docker inspect {} --format="{{range .Mounts}}{{if eq .Name \"$volume\"}}{{.Destination}}{{end}}{{end}}" | tr -d '\n' | xargs) + if [ "$container_mount_path" == "/var/www/bootstrap" ]; then + echo "Volume $volume is a bootstrap volume and will be skipped." + continue + fi + ((status++)) container_ids=$(docker ps -aq --filter volume=$volume)