Docker Container Migration with criu Docker Container Migration with criu docker docker

Docker Container Migration with criu


Docker container migration using CRIU is still under development. So far the focus of checkpoint and restore integration into Docker has been C/R'ing on the same machine.

That said, it is possible to manually migrate containers by not only copying the container image created by CRIU after checkpoint (as you have done) but also by copying the container directory created by Docker in /var/lib/docker/0.0/containers/$cid as well as the container's root filesystem in /var/lib/docker/0.0/image. Manually migrating container's filesystem is a bit tricky specially if you are using a union filesystem like AUFS or OverlayFS. Also, you need to restart the Docker daemon on the destination machine to see the container.


On the destination machine, you have to create or run a container. This container will be overwritten by the restored image.

So : ssh -t walid@192.168.1.10 export NewID=$(docker run -d ubuntu tail -f /dev/null)ssh -t walid@192.168.1.10 sudo docker restore --force=true --image-dir=/tmp/docker-migration/$cid $newID

In my case, that worked like a charm!


here is my test:

migration container across nodes.

restore:vagrant ssh vm2 -- 'docker run --name=foo -d ubuntu tail -f /dev/null && docker rm -f foo'

docker create --name=CONTAINNER_NAME base_imagedocker restore --force=true --image-dir=/tmp/{dump files} 

github: https://github.com/hixichen/criu_test