From what I can tell, docker images are installed to /var/lib/docker as they are pulled. Is there a way to change this location, such as to a mounted volume like /mnt?
/var/lib/docker
/mnt
With recent versions of Docker, you would set the value of the data-root parameter to your custom path, in /etc/docker/daemon.json (according to https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file).
data-root
/etc/docker/daemon.json
With older versions, you can change Docker's storage base directory (where container and images go) using the -goption when starting the Docker daemon. (check docker --help). You can have this setting applied automatically when Docker starts by adding it to /etc/default/docker
-g
docker --help
1.4m articles
1.4m replys
5 comments
57.0k users