-
-
Save mikaelz/57463609cc5735bdc598a2f60dc53cd3 to your computer and use it in GitHub Desktop.
Docker: print ips and containers' names suitable for use in /etc/hosts
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
for i in `docker ps -a -q | awk '{print $1}'`; do echo $(docker inspect --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" $i) $(docker ps | grep $i | awk '{print $NF}') ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment