首页 > 系统服务 > 详细

linux运维、架构之路-Docker修改本地镜像存储位置

时间:2020-01-06 10:58:41      阅读:94      评论:0      收藏:0      [点我收藏+]

1、查看Docker默认存放数据目录

[root@k8s-node1 tools]# docker info | grep "Docker Root Dir"
WARNING: API is accessible on http://127.0.0.1:4243 without encryption.
         Access to the remote API is equivalent to root access on the host. Refer
         to the Docker daemon attack surface section in the documentation for
         more information: https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
 Docker Root Dir: /var/lib/docker

2、停止Docker服务

 systemctl stop docker

3、移动Docker数据目录到指定的分区

[root@k8s-node1 app]# mv /var/lib/docker /app/data/docker    #这里/app为挂载的网络存储NAS
[root@k8s-node1 app]# ln -s /app/data/docker /var/lib/docke  #软链接到原来的目录

4、启动Docker服务查看存储目录

systemctl start docker
[root@k8s-node1 ~]# docker info|grep "Docker Root Dir"
WARNING: API is accessible on http://127.0.0.1:4243 without encryption.
         Access to the remote API is equivalent to root access on the host. Refer
         to the Docker daemon attack surface section in the documentation for
         more information: https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
 Docker Root Dir: /app/data/docker

 

linux运维、架构之路-Docker修改本地镜像存储位置

原文:https://www.cnblogs.com/yanxinjiang/p/12155005.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!