One situation that seems pretty common that is making a small partition for the root directory and allocated the rest of your memory for your home directory.
The default data-root is in /var/lib/docker/
- my solution is just to move all the files in this directory to /home
with the same permissions and what not.
All you have to do is stop docker processes and the service sudo systemctl stop docker
For specifying data-root, you have some options:
- You can add an entry to
/etc/docker/daemon.json
(recommended, you will already have this file if you installnvidia-ctk
{
"data-root": "/home/docker",
...
}
- Or you can edit
/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -g /home/docker -H fd:// --containerd=/run/containerd/containerd.sock
Then, copy the files over rsync -avxP /var/lib/docker /home
Now, restart the service and you should be good to go.
sudo systemctl restart docker
Then finally you can get rid of the replicated data in /var/lib/docker
To double check if it's working, try running a container and doing docker inspect <container>
and you should see references to /home/docker