docker stop $(docker ps -q -f status=running)
systemctl stop docker;
在挂载的磁盘目录下创建存放镜像目录
mkdir -p /data/var/lib
迁移镜像文件
mv /var/lib/docker /data/var/lib/docker
链接到原目录
ln -s /data/var/lib/docker /var/lib/docker
systemctl start docker;
启动服务后查看镜像存放目录
docker info | grep "Docker Root Dir"
WARNING: the overlay storage-driver is deprecated, and will be removed in a future release.
Docker Root Dir: /data/var/lib/docker
参考:
https://blog.csdn.net/qq_37674858/article/details/79976751
https://blog.csdn.net/qijian2003122/article/details/82886989
https://www.cnblogs.com/linux123/p/12176784.html
网友评论