起因
步驟
-
停止 docker service
sudo systemctl stop docker
-
檢查原有設定、複製檔案
cat /etc/docker/daemon.json
sudo rsync -azAHX /var/lib/docker /volume/docker-dataroot
-
更換設定路徑
option 1 modify docker config
vi /etc/docker/daemon.json { "data-root": "/volume/docker-dataroot" }
*option 2 soft link folder**
sudo mv /var/lib/docker /path-you-want-to-backup ln -s /volume/docker-dataroot/var/lib/docker
-
重啟 docker service
sudo systemctl start docker