Assign permanent IP to docker container



I want to assign a permanent container IP address to some docker containers in order to reference them in a file. Docker currently gives the contains an IP of 172.18.0.X, but it's random based on when they start up.

Essentially, whenever I restart my servers, the container's IP changes.

Is there any way to assign container 1 an IP of, container 2 an IP of, etc. without them changing?

Continue reading...