1.停止docker服务
systemctl stop docker
2.查看磁盘空间
df -h
3.创建新的docker目录
mkdir -p /docker/lib
4.迁移/var/lib/docker目录下面的文件到/docker/lib
rsync -avz /var/lib/docker/ /docker/lib/
5.查看/etc/systemd/system/docker.service.d目录及devicemapper.conf是否存在。如果不存在,就新建
mkdir -p /etc/systemd/system/docker.service.d/
vi /etc/systemd/system/docker.service.d/devicemapper.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --graph=/docker/lib/docker
6.重启docker
systemctl daemon-reload
systemctl restart docker
systemctl enable docker
7.确认Docker修改是否已经生效
docker info
8.确定容器没问题后删除/var/lib/docker/目录中的文件