Forum Navigation
You need to log in to create posts and topics.

How to get container IP address

Problem

User wants to get container IP address

Solution

sudo docker ps −a
#select your container id
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <<CONTAINER ID>>



in one line for scripting

docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ `docker ps -a | grep <<CONTAINER NAME>> | awk ‘{print $1}’`