Migrating from aufs storage

I feel the responsibility of several running containers I cannot afford loosing.
aufs storage has been used for years, but now is no more supported and this does not let me to upgrade the docker engine package.
So far I could not find any official step-by-step guide for migrating for example to overlay2, where official stands for safe to be used also by a inexperienced user like I am. For the mentioned reason in a separate post I was asking if it is safe to still, that is to keep on using Docker Engine 2.10.2.
Could anyone here suggest me a way out?

Thanks in advance!

Andrea

Switching the storage driver will result in existing images and containers not being accessible anymore. There is no way around it.

If you really depend on conserving a container, something must be gone wrong. Typically, persistent state is stored in volumes - their content does not depend on the storage driver (though, you can still backup their content to be safe). Worst case you use docker save to export the images as tar and docker load to load them back from the tar into the local image cache after switching the storage driver and create your container’s again.

If state is directly stored in the container filesystem (the ‚Äúsomething must be gone wrong‚ÄĚ case), then you can use docker export to export a container‚Äôs filesystem as tar archive, and docker import to import the tar archive back as container. As I never used this feature in my life, I am not able to provide insights or support - I have no idea whether you need the image used to create the exported container in order to restore it container.

Good luck!

Exactly as @meyay wrote with one more advice. Do not export containers.

docker import imports the filesystem of the container as an image, so all of your metadata will be lost. You can use the import command if you know what metadata the container needs and you redefine it for the new container or you create an image based on the imported one. For example the CMD instruction, ENTRYPOINT, LABEL or ENV would all be lost. if you stored data on the container’s filesystem, the best way (but still wrong way) to use docker commit to save the container as an image and export the committed image. If you have time, finding the data and copying out from the container to a volume and recreating the container would be even better.

Let’s say you have a database container without a volume. If you just copy the database files out while the database server is still running, that could corrupt your data. and the data inside the container could change in the meantime. The good news is that you can stop a container and still use docker cp to copy some files or folders out.

1 Like