From b79e8510267f220fc6d5b311578df00a8107bab0 Mon Sep 17 00:00:00 2001 From: Mark Shust Date: Wed, 6 Mar 2024 10:41:40 -0500 Subject: [PATCH] Fix bin/docker-stats not working properly #1075 --- compose/bin/docker-stats | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compose/bin/docker-stats b/compose/bin/docker-stats index 83cac7a78..4f48ff51d 100755 --- a/compose/bin/docker-stats +++ b/compose/bin/docker-stats @@ -1,10 +1,10 @@ #!/usr/bin/env bash -container_ids=$(bin/docker-compose ps -q) +IFS=$'\n' read -d '' -r -a container_ids < <(bin/docker-compose ps -q) -if [ -z "$container_ids" ]; then +if [ ${#container_ids[@]} -eq 0 ]; then echo "No active containers found" exit 1 fi -docker stats "$container_ids" +docker stats "${container_ids[@]}"