For system, network and cloud administrators

How to view the IP of a Docker container

In order to view the IP of a Docker container, you can execute the following command:

docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" container_ID_or_name

But you can also use grep:

docker inspect container_name | grep "IPv4"