Is there a command I can run to get the container's IP address right from the host after a new container is created?
Basically, once Docker creates the container, I want to roll my own code deployment and container configuration scripts.
Is there a command I can run to get the container's IP address right from the host after a new container is created?
Basically, once Docker creates the container, I want to roll my own code deployment and container configuration scripts.
You can use
docker inspect <container id>
Example:
For those who came from Google to find solution for command execution from terminal (not by script), jid (an interactive JSON drill down util with autocomplete and suggestion) let you achieve same thing with less typing.
Type tab .Net tab and you'll see following:
Type .IPA tab and you'll see following:
docker inspect CONTAINER_ID | grep "IPAddress"
To extend ko-dos' answer, here's an alias to list all container names and their IP addresses:
If you installed Docker using Docker Toolbox, you can use the Kitematic application to get the container IP address:
In Docker 1.3+, you can also check it via steps below:
Enter the running Docker: