Skip to content

Instantly share code, notes, and snippets.

@wehappyfew
Created March 23, 2016 15:49
Show Gist options
  • Save wehappyfew/db6e5c12687eacbc71c5 to your computer and use it in GitHub Desktop.
Save wehappyfew/db6e5c12687eacbc71c5 to your computer and use it in GitHub Desktop.
Print the name and the IP of every docker container
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