From b62409186052f92a5bf383f6cdff7b06d5b687f9 Mon Sep 17 00:00:00 2001 From: Derek Carr Date: Sat, 25 Apr 2026 11:49:20 -0400 Subject: [PATCH] fix(scripts): handle docker cleanup when no containers are running The docker-cleanup.sh script failed when no containers were running because grep -v returned exit code 1 on empty input, causing the script to abort due to set -euo pipefail. Add || true to the volume detection pipeline so the script succeeds when there are no running containers (in_use_volumes will be empty, which is the correct behavior). Signed-off-by: Derek Carr --- scripts/docker-cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docker-cleanup.sh b/scripts/docker-cleanup.sh index 9669dd80b..fc9a69809 100755 --- a/scripts/docker-cleanup.sh +++ b/scripts/docker-cleanup.sh @@ -217,7 +217,7 @@ info "Removing unused volumes..." # Identify volumes in use by running containers in_use_volumes=$(ce ps -q 2>/dev/null \ | xargs -r ce inspect --format '{{range .Mounts}}{{.Name}} {{end}}' 2>/dev/null \ - | tr ' ' '\n' | sort -u | grep -v '^$') + | tr ' ' '\n' | sort -u | grep -v '^$' || true) unused_volumes=() while read -r vol; do