Forum breadcrumbs – You are here:Tracston Community Forum
Micro Services, Cloud, Infrastructure, Development, Monitoring and more…DevOps / Micro Services / Automation: DockerHow to get container IP address
Micro Services, Cloud, Infrastructure, Development, Monitoring and more…DevOps / Micro Services / Automation: DockerHow to get container IP address
You need to log in to create posts and topics.
How to get container IP address

moshe@moshe
16/03/2021, 2:13 pm
Quote from moshe on 16/03/2021, 2:13 pmProblem
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>>
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>>
Click for thumbs down.0Click for thumbs up.0

moshe@moshe
16/03/2021, 2:14 pm
Quote from moshe on 16/03/2021, 2:14 pmin one line for scripting
docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ `docker ps -a | grep <<CONTAINER NAME>> | awk ‘{print $1}’`
in one line for scripting
docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ `docker ps -a | grep <<CONTAINER NAME>> | awk ‘{print $1}’`
Click for thumbs down.0Click for thumbs up.0
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.