Low Orbit Flux Logo 2 D

Docker How To Find Ip Address Of Container

Eventually, you are probably going to want to be able to find the IP address of a Docker container.

You can find the IP address of a container like this:

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nginx

If you don’t want to remember that command and you don’t mind messy output you can also use the following command.

docker inspect nginx | grep "IPAddress"

You can use the following to find the IP of every container on your system:

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)