How to get the IP address of Containers running on your Docker
There are situations where you would need the ip address of some other container running on docker, for example say you need the ip address of a mysql database.
To get the ip address of all running containers, use the following command:
docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
To understand more about docker networks, check out this interesting link.
Written by Makanju Perfect
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Docker
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#