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
54 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,490 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,870 points
36 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,870 points
39 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,240 points
177 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
• 37,320 points
1,775 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,160 points
99 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,490 points
50 views