Created
March 23, 2016 15:49
-
-
Save wehappyfew/db6e5c12687eacbc71c5 to your computer and use it in GitHub Desktop.
Print the name and the IP of every docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDS=$(docker ps -q) | |
for ID in $IDS | |
do | |
echo $(docker inspect --format='{{.Name}}' $ID) " --> "$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ID) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment