Browse Source

Merge pull request #1082 from markshust/feature/fix-docker-stats

Fix bin/docker-stats not working properly #1075
Mark Shust 1 year ago
parent
commit
fb61e2dd4e
1 changed files with 3 additions and 3 deletions
  1. 3 3
      compose/bin/docker-stats

+ 3 - 3
compose/bin/docker-stats

@@ -1,10 +1,10 @@
 #!/usr/bin/env bash
 #!/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"
     echo "No active containers found"
     exit 1
     exit 1
 fi
 fi
 
 
-docker stats "$container_ids"
+docker stats "${container_ids[@]}"