Docker 数据迁移
主机是lxc的,只分配了10G,安装 office 镜像空间不够,将 Docker 数据迁移到硬盘上。
- 停止 Docker
1
2systemctl stop docker.socket
systemctl stop docker - 拷贝数据
1
2
3cp -a /var/lib/docker /mnt/nas/application/docker
mv /var/lib/docker /var/lib/docker-old
ln -s /mnt/nas/application/docker /var/lib/ - 启动测试, 删除原数据
1
2
3systemctl start docker
systemctl status docker
rm -rf /var/lib/docker-old