docker image move to other(after 16.04)

1. stop docker

sudo systemctl stop docker.service

2. mkdir target dir

mkdir -p /data/docker

3. sync  /var/lib/docker/ to target dir

 rsync -aXS /var/lib/docker/. /data/docker

4. edit fstab,append under line to fstab 

#vim /etc/fstab

...

/data/docker  /var/lib/docker none bind 0 0

5.remount (by fstab)

mount –a

6. review  /var/lib/docker info

Docker镜像迁移

你可能感兴趣的:(docker image move to other(after 16.04))