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[@]}"