Abstract
Instructions for changing the default Docker folder.
The /var/lib/docker/ folder is the default Docker folder for Ubuntu, Fedora, and Deblan in a standard engine installation.
To change the Docker folder:
Stop the Docker daemon.
sudo service docker stopCreate a file called
daemon.jsonunder the/etc/dockerdirectory with the following content:{ "data-root": "<path to your Docker folder>" }Copy the current data directory to the new one.
sudo rsync -aP /var/lib/docker/ <path to your Docker folder>Rename the old docker directory.
sudo mv /var/lib/docker /var/lib/docker.bkpAfter confirming that the change was successful, you can remove the backup file.
sudo rm -rf /var/lib/docker.bkpStart the Docker daemon.
sudo service docker start