Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 70102c3

Browse files
committed
Update the containers script to not break on linked containers
1 parent 6bb6cd2 commit 70102c3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docker/scripts/containers

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
2+
23
IFS=$'\n';
34
echo
45
echo "Container Name IP Address"
56
echo "-----------------------------------------------"
67
for CONTAINER in `docker ps | awk '{print $(NF)}' | tail -n+2`
78
do
8-
IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${CONTAINER}`
9-
echo "$CONTAINER $IP" | awk '{printf "%-30s %-20s\n", $1, $2}'
9+
IFS=,
10+
C=($CONTAINER)
11+
IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${C}`
12+
echo "$C $IP" | awk '{printf "%-30s %-20s\n", $1, $2}'
1013
done
1114
echo

0 commit comments

Comments
 (0)