docker aufs to devicemapper docker container and images migration

832 views Asked by At

I'm on Ubuntu, changing default docker storage driver from aufs to devicemapper. I've some docker images and containers on aufs. i took backup of aufs storage files from /var/lib/docker .

how can i import aufs images and containers to devicemapper storage image and containers without loosing data respectively?

1

There are 1 answers

0
gile On

You can save images and export containers before changing the storage driver

docker save myImage1 > myImage1.tar
docker export myContainer1 > myContainer1.tar

Then you have to load images and import containers after having changed the storage driver

docker load -i myImage1.tar
docker import /path/to/myContainer1.tar

Be careful that, as for official documentation:

the docker export command does not export the contents of volumes associated with the container. If a volume is mounted on top of an existing directory in the container, docker export will export the contents of the underlying directory, not the contents of the volume.

Refer to Backup, restore, or migrate data volumes in the user guide for examples on exporting data in a volume.