
Here’s a sample of how you might define a static IP address in docker-compose.yml that would work using docker-compose 1.7.0 In this case I decided to keep the 1.6.2 docker-compose binary along with the 1.7.0 docker-compose binary, then create a symlink to the one I wanted to use as the active docker-compose Lrwxrwxrwx 1 root root 31 Mar 30 08:38 docker-compose -> docker-compose-1.7.0dev_85e2fb6 # ln -s docker-compose-1.7.0dev_85e2fb6 docker-compose Luckily, this has already made it into mainline dev for Compose and is earmarked for release with the 1.7.0 milestone (which should coincide with Engine 1.11). I guess we can think of Engine as being upstream of Compose, so some new Engine features take a while to make it into Compose. Unfortunately, Docker Compose (1.6.2) did not support this option.

This allows you to define a static IP address for a container at run time. In Docker Engine 1.10 the docker run command received a new flag namely the -ip flag.
#DOCKER IP ADDRESS ERRORS FULL#
This was not a cascaded need where successor containers learn predecessors’ IP addresses, but more like a full mesh.


Recently, I was working on a very edge-case multi-container application where every container needed to know (or be able to predict) every other containers’ IP address at run time. If proper service discovery and registration is configured, we just launch containers as needed and they make it into the application ecosystem seamlessly. Usually, when launching Docker containers we don’t really know or care what IP address a specific container will be given.
