Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assigning IP address to docker containers?

I'm new to Docker. Is it possible to assign an IP address (from a DHCP server) to Docker containers running on a host or VM? If yes, can someone point me in the correct direction. If no, is it a fundamental limitation of the container approach or it's just a feature that's not in Docker yet.

like image 741
Soumya Simanta Avatar asked Sep 11 '13 16:09

Soumya Simanta


1 Answers

Docker evolved a lot during last so as for Docker 0.6.5:

Containers have their own ip addresses now. You can check the ip address of a container using docker inspect command or if you are interested into extracting it you can use:

docker inspect container_name | grep IPAddress | cut -d '"' -f 4.
like image 195
Piotr Chudzik Avatar answered Sep 18 '22 18:09

Piotr Chudzik