Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Docker images are saved in /var/lib/docker.
You can link the directory to another place to save images elsewhere.
Another way is to change the configuration file of Docker.
For example,
you can add the following into /etc/default/docker
to save docker images into /mnt (instead of the default location).
DOCKER_OPTS="-dns 8.8.8.8 -dns 8.8.4.4 -g /mnt"symbolic link
bind mount (check Specifying a default Docker storage directory by using bind mount for more details)
Add the options into the file
/etc/docker/daemon.json.:::json { "data-root": "/new/data/root/path" }
Restart Docker after whichever approach you take.
:::bash
sudo systemctl restart dockerReferences¶
https://
https://
https://