Explorar o código

Fix bin/docker-stats not working properly #1075

Mark Shust hai 1 ano
pai
achega
b79e851026
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  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[@]}"