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
网友评论