Skip to content

Commit fb61e2d

Browse files
authored
Merge pull request #1082 from markshust/feature/fix-docker-stats
Fix bin/docker-stats not working properly #1075
2 parents 85c0494 + b79e851 commit fb61e2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compose/bin/docker-stats

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22

3-
container_ids=$(bin/docker-compose ps -q)
3+
IFS=$'\n' read -d '' -r -a container_ids < <(bin/docker-compose ps -q)
44

5-
if [ -z "$container_ids" ]; then
5+
if [ ${#container_ids[@]} -eq 0 ]; then
66
echo "No active containers found"
77
exit 1
88
fi
99

10-
docker stats "$container_ids"
10+
docker stats "${container_ids[@]}"

0 commit comments

Comments
 (0)