Docker工作目录(/var/lib/docker)迁移到其它分区

Tags:

参考:https://www.xiaoz.me/archives/15225

systemctl stop docker
mv /var/lib/docker /var/lib/docker_bak # 备份
cd /data
cp -a /var/lib/docker_bak _docker # -a to preserve all
ln -s /data/_docker /var/lib/docker
systemctl start docker

rm -rf /var/lib/docker_bak # 如果没有问题就可以将原备份删掉

对比以前和以后

Leave a Reply