I don’t need to reboot my host or restart docker very often but it has come up a couple times recently.
The problem is that when docker restarts containers are not being assigned the IPs they previously used – a data container might have been 172.17.0.2 before but is 172.17.0.9 after a reboot. Because of this the web container is unable to connect to a database and I am forced to find my data container’s IP, reconfigure and rebuild the web container.
I’d love to avoid this.
Thinking that I could at least avoid the need to look up and reconfigure the ip (skipping straight to launcher rebuild) I have tried linking the containers but I am unable to bootstrap when doing so - it fails when trying to connect to the database, unable to resolve the host; I am using ‘data’ for the link alias and ‘data’ for DISCOURSE_DB_HOST/DISCOURSE_REDIS_HOST.
What can I do to make life easier? I’d like to at least have the link work. Better still I’d love to have static IPs for my containers so that regardless of what order things were automatically started in everything would be connected once all containers started.