docker info 查看 镜像存放的目录
默认存放目录 /var/lib/docker
停止docker服务
systemctl stop docker.service
在挂载的磁盘目录下创建存放镜像目录
mkdir -p /data/var/lib
迁移镜像文件
mv /var/lib/docker /data/var/lib/docker
链接到原目录
ln -s /data/var/lib/docker /var/lib/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
原文:https://www.cnblogs.com/xiaoxiaozhou/p/12621251.html