My usage scenario requires too much space for data to be stored in /var/lib/docker so my / (root) partition gets filled and everything goes to hell. I found posts suggesting that changing data-root in /etc/docker/daemon.json solves the problem. I have no such file:
firstuser@claire2:~/Documents$ ls /etc/docker/
key.json
So instead I have attempted to modify the service file…
sudo service docker stop
# Added --data-root option to /etc/init.d/docker below
# DOCKER_OPTS=--data-root /home/docker
# Moved directory to home
sudo mv /var/lib/docker /home
sudo systemctl daemon-reload
sudo service docker start
The restarted docker service created a new /var/lib/docker and did not use /home as I wanted.
So undid it all for now hence the comment (#) above for DOCKER_OPTS so not in effect anymore.
I would like someone to show me how I can change this directory so it can be on a bigger non-system partition. If I see no easy way out I may just try a logical link