Last active
July 26, 2018 10:00
-
-
Save Zaffy/33444d07d0f55960eb5d2f0c03059fa4 to your computer and use it in GitHub Desktop.
Docker: print ips and containers' names suitable for use in /etc/hosts
This file contains hidden or 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