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
• 1,000 points
1,188 views

1 answer to this question.

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,980 points

Related Questions In DevOps & Agile

+1 vote
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
• 7,340 points
1,024 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
• 7,340 points
1,253 views
+5 votes
1 answer

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 27, 2018 in DevOps & Agile by Atul
• 10,240 points
3,539 views
+14 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
• 52,350 points
16,586 views
+2 votes
1 answer
+2 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
• 58,020 points
2,738 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,980 points
3,809 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP