[root@k8s-master-01 ~]# docker info | grep -i dir Docker Root Dir: /var/lib/docker [root@k8s-master-01 ~]# systemctl stop docker [root@k8s-master-01 ~]# df -Th Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/rhel-root xfs 17G 14G 3.9G 78% / devtmpfs devtmpfs 1.9G 0 1.9G 0% /dev tmpfs tmpfs 1.9G 0 1.9G 0% /dev/shm tmpfs tmpfs 1.9G 12M 1.9G 1% /run tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup /dev/sda1 xfs 1014M 146M 869M 15% /boot tmpfs tmpfs 378M 0 378M 0% /run/user/0 [root@k8s-master-01 ~]# mkdir -p /data/docker [root@k8s-master-01 ~]# mv /var/lib/docker/* /data/docker/ [root@k8s-master-01 ~]# vim /usr/lib/systemd/system/docker.service [root@k8s-master-01 ~]# cat /usr/lib/systemd/system/docker.service | grep -i graph ExecStart=/usr/bin/dockerd --graph /data/docker ###在/usr/lib/systemd/system/docker.serviceExecStart里加--graph指定新路径 [root@k8s-master-01 ~]# systemctl daemon-reload [root@k8s-master-01 ~]# systemctl start docker [root@k8s-master-01 ~]# docker info | grep -i dir Docker Root Dir: /data/docker