Docker Community Forums

Share and learn in the Docker community.

How can I change the Docker image installation directory?


(Nick Hazlett) #1

You can change Docker’s storage base directory (where container and images go) using the -g option when starting the Docker daemon.


Ubuntu/Debian: edit your /etc/default/docker file with the -g option: DOCKER_OPTS="-g /path/to/new/storage"

Rhel/Fedora/Centos: edit /etc/sysconfig/docker, and add the -g option: OPTIONS='-g /path/to/new/storage'. After a restart, (sytemctl restart docker) Docker should use the new directory.



(Hervé Nicol) #2

The above instruction don’t work on Debian Jessie with systemd.
I had to add the «-g» option to /lib/systemd/system/docker.service.