Get the Ip of a docker container

0 votes
I need to know the IP of a docker container. I don't know the exact command to get the IP of a container in Docker?

Can anyone help me with this?
Dec 10, 2018 in DevOps & Agile by Shubham
• 980 points
50 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

Here is what you need to do. 

Firstly, get the container id by using command

docker ps

After that use the below command which will give you the container IP.

docker inspect container_id

Go to the Network setting in the bottom where you can find your container's IP.

Or

You can first find the server Ip using command 

ifconfig

And then to find the IP of a container use below commands.

docker inspect container_id | grep server_ip 
answered Dec 10, 2018 by Damon Salvatore
• 5,450 points

Related Questions In DevOps & Agile

0 votes
1 answer

How do I get a Docker container's IP address from the host?

Save your docker image as a tar ...READ MORE

answered Aug 29, 2018 in DevOps & Agile by shubham
• 6,560 points
34 views
+2 votes
1 answer

What is the difference between a container and an image in Docker?

 Below is reference which you can follow to know ...READ MORE

answered Sep 20, 2018 in DevOps & Agile by shubham
• 6,560 points
34 views
+5 votes
2 answers

How to program and get the Digital Ocean ID of the current Droplet from within the Droplet?

You can run curl http://169.254.169.254/metadata/v1/id within the ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by Atul
• 10,220 points
144 views
+13 votes
5 answers

How do I run a cron job inside a docker container

If you can SSH into your server ...READ MORE

answered Jul 27, 2018 in DevOps & Agile by Kalgi
• 36,300 points
1,361 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
79 views
0 votes
1 answer
0 votes
1 answer

How to edit file after I shell to a docker container?

Since docker images are trimmed to bare minimum ...READ MORE

answered Sep 11, 2018 in DevOps & Agile by Damon Salvatore
• 5,450 points
47 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.