How to obtain the Docker container's IP address from the host?

0 votes
Is there any command I can use to display the container's IP address directly from the host machine?
Jul 16, 2018 in Docker by Tyrion anex
• 8,280 points
144 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

This can be done by executing the following command:

docker inspect <container id> | grep "IPAddress"

You can also use the --format option of inspect to do this:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
answered Jul 16, 2018 by Sophie may
• 9,330 points

Related Questions In Docker

+1 vote
1 answer

How to expose docker container's ip and port to outside docker host without port mapping?

you can accomplish this with IP aliasing ...READ MORE

answered Aug 2, 2018 in Docker by Kalgi
• 36,870 points
1,360 views
+4 votes
4 answers

How To Access a Service on Host From a Docker Container?

Adding to kalgi's answer, You can also ...READ MORE

answered Oct 16, 2018 in Docker by lina
• 8,100 points

edited Oct 16, 2018 by lina 2,655 views
0 votes
1 answer
0 votes
1 answer

How to get docker-compose to always re-create containers from fresh images?

The containers are getting recreated to preserve ...READ MORE

answered Jul 27, 2018 in Docker by Kalgi
• 36,870 points
201 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,140 points
81 views
0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 9,330 points
247 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.