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
docker inspect --format '{{ .NetworkSettings.IPAddress }}'
The above works if the container is deployed to the default bridge network.
However, if using a custom bridge network or a overlay network, I found the below to work better:
docker exec /sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'