Docker
System: Ubuntu
By default, Docker is stored in:/var/lib/docker
You can see the exact location by following the command:
sudo docker info | grep "Docker Root Dir"
This method is implemented via a soft connection.
First stop the Docker service:
Systemctl Restart Docker or service Docker stop
Then move the entire/var/lib/docker directory to the destination path:
Mv/var/lib/docker/root/data/docker
Create a soft link
Ln-s/root/data/docker/var/lib/docker
When you start Docker, you find that the storage directory is still/var/lib/docker, but it is actually stored on the data disk, and you can see the volume change on the data disk.
One thing to note here is that it is important to move the entire Docker under the/var/lib/to a different directory (in other words, the Docker directory does not exist in the/var/lib/directory before the soft link is created, and the soft link created is valid)