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}’`

All content available through this Web Site is provided on an “AS IS” and “AS AVAILABLE” basis, with all faults. Tracston LTD makes no warranty or representation with respect to the quality, accuracy, or availability of the Web Site or any of its content.