停止docker
systemctl stop docker
遷移檔案
mkdir -p /data/docker/lib/docker/
rsync -av /var/lib/docker/ /data/docker/lib/docker/
修改配置
# /etc/docker/daemon.json
# 在配置檔案中新增以下引數
"data-root": "/data/docker/lib/docker"
啟動docker
systemctl daemon-reload
systemctl start docker
檢查配置
docker info
df -h