docker 修改默认存储路径 /var/lib/docker
一、环境:
centos7.x系统,已经装好docker-ce服务包
二、查看当前docker的存储路径
[root@localhost ~]# docker info |grep Dir
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
WARNING: the devicemapper storage-driver is deprecated, and will be removed in a future release.
WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
Docker Root Dir: /var/lib/docker ## docker默认的存储路径
三、关闭docker服务
[root@localhost ~]# systemctl stop docker ## 关闭docker服务
[root@localhost ~]# systemctl status docker ## 查看docker服务状态
四、将原有数据迁移至新目录