I’m just getting started with Docker. I’m running it on Ubuntu Server 20.04. I didn’t realize that Ubuntu packaged Docker as a snap container or the various issues with Snap. Of course, I have a handful of containers that all have their data mounted in volumes, since permission issues made storing their volumes in home above my head.
So now I’m leaning towards migrating from snap. I would have expected this to be easy and to have guides everywhere, but shockingly enough there’s virtually nothing out there.
Can anyone lead me down the right path to backing up at least the external volumes, if not the containers with the volumes, in a way that is then restorable once I’ve purged the snap versions from the server and re-installed via apt?
Ideally, I’d like to backup the paths as well (e.g. “namedExtVolume:Container1/config”) so that it’s a one-line (or one line per container) restore.
Any pointers on purging the snap version and getting the apt version? Anyone else tried this migration and knows of the pitfalls or issues?
This is sad. I’m having the same problem and can’t find any resources on how to migrate properly either. So many hours dealing with problems caused by using the snap version of Docker instead of apt. Can anyone help us?
This should be more or less straight forward, especially if host paths were bound into the container and the container was created by docker-compose or the exact docker run command was documented somewhere. This information should always be available/documented as it is also required if you want to “upgrade” a container to use a newer image version.
If you have neither documented the docker run command or used docker-compose, you can gather the information by using docker inspect ${container name or id} or use a tool like docker-autocompose to generate a docker compose file from the existing container.
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock red5d/docker-autocompose <container-name-or-id> > /path/where/you/want/to/store/the/compose.yml`
If you have everything to re-create the container(s), just remove the snap installation, install the docker-ce package and re-create your container.