- 查看Docker目录
docker info | grep "Docker Root Dir"
- 停止Docker
systemctl stop docker
拷贝数据到新路径
cp -r /var/lib/docker/* /data/var/docker/
重名docker文件夹
mv /var/lib/docker /var/lib/docker-old
创建软连接
ln -s /data/var/docker /var/lib/
重启Docker
systemctl restart docker
- 如果正常Docker启动,删除原Docker目录
rm -rf /var/lib/docker-old