I’m running docker 27.1.2, build d01f264 on 22.04.3-Ubuntu N100 server. Everything works great until I reboot the server for any reason. When I do reboot the server all of the containers restart ok but most of them fail to connect to the network. The only fix I have found is to manually restart each of the containers at which point they connect just fine.
I’m grasping at straws but I’m guessing its some sort of timing problem… Perhaps the docker containers are starting up before the host OS has network connectivity and therefore failing to connect?
Argh, I think I have figured out the problem though I’m not sure how to fix it. It seems I have two instances of Docker installed a apt version and a snap version. Unfortunate I appear to be running in the snap instance and I’d prefer to be running in the apt instance as all my other software packages are installed via apt.
Looking at my docker stacks I believe all my containers save their data to folders that are mapped onto the host file system.
My hope is that I can,
Stop my docker instances and backup my docker config
Remove the snap instance of docker
Restart docker so it flips over to the apt instance
Restore the docker config file
I’m hoping all my containers will restart and the container data will be present
What am I missing? Should I reinstall the apt instance of docker to ensure all the files are correct or might that be a bad idea in that it might destroy config files?
I have the docker compose and env data for all my stacks. I also have a backup of the docker config. What else should I backup?
For reference in case others have a similar issue.
I confirmed that the issue was I had docker installed twice. Once via apt and once via snap. To fix I backed up my stacks and user data. Deleted both. Reinstalled via apt and restored my data. Everything came back up without any issues.
Thank you for coming back and sharing your solution. Snap is indeed not recommended, but even when you instal Docker from an APT repository, make sure you install it from the official one, which gives you the “docker-ce” package, not docker.io.
And since you did not mention Docker Desktop at all, I will move the topic to the right category.