I'm using openSUSE Tumbleweed, fully updated. My current system setup has two partitions, one for / formatted with "btrfs", and another for /home, using "ext4".

I'd like to set the Docker image location in a position different than the default place in /var/lib/docker/, maybe in /home/docker-data/.

How can I do that? I found some guides, but I don't know if these are relevant to openSUSE or up to date with the latest Docker versions.

I've read that I should also set a different Storage Driver (currently it is set as btrfs, but the partition where I want to store the images is formatted with ext4), how it is done?



With recent versions of Docker, you would set the value of the graph parameter to your custom path, in /etc/docker/daemon.json (according to https://docs.docker.com/v1.11/engine/reference/commandline/daemon/#daemon-configuration-file).

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


You can use the --graph or --data-root option in the service file where ExecStart is defined after dockerd, e.g. ExecStart=/usr/bin/docker daemon -H fd:// --graph="/mnt"

With your second question, if you're referring to the Docker storage driver, you can define it using the daemon.json file

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.