Quellcode durchsuchen

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

Fix bin/docker-stats not working properly #1075
Mark Shust vor 1 Jahr
Ursprung
Commit
fb61e2dd4e
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      compose/bin/docker-stats

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