Docker - Move Docker data directory to new location¶
The standard data directory used for docker is /var/lib/docker, and since this directory will store all your images, volumes, etc. it can become quite large.
Follow the steps below to move the Docker data directory to a new location. This makes especially sense if you want to avoid running out of disk space on your root partition.
Stop the Docker service and containers.
Edit the config file:
And set the data root:
Verify the available disk space.
Move the current docker directory to the new directory.
Or copy the directory.
Restart the Docker deamon.
Test containers are running.
Start the containers.
Backlinks