Docker Community Forums

Share and learn in the Docker community.

Changing runtime directory in daemon.json causes docker.service to fail

Hello - I am on RHEL 7 and attempting to follow the directions here to change the location where images and containers are stored. daemon.json did not exist in /etc/docker, so I stopped docker, created the JSON, and set the “data-root” and “storage-driver” flags as described in the docs.
When I try running sudo systemctl start docker, I get the following errors:

Any help would be greatly appreciated. Thank you.

Post up your daemon.json file. Also run the systemctl status docker -l to provide more details in your logs.

Carl

1 Like

Thanks, Carl.

It looks correct and the logs aren’t very helpful :slight_smile: Is there any more detail in the /var/log/messages file? Maybe docker doesn’t have permission to write to data2/docker or it doesn’t exist. On my server, docker runs as root so permissions don’t seem likely unless you’re running docker as a non-root account.

Carl

1 Like

Welp, nevermind. This problem was not fixed. Docker started, but something is still running out of space:


To be clear, Docker Root Dir is /data2/docker, which is a massive partition and should not be running out of storage. I’m not sure exactly what is running out of space… It is now using devicemapper rather than overlay2

Your log message says ‘/opt/fsl-6.0.3/bin/fnirtfileutils’.

1 Like

What you identified is part of the image that I’m downloading, I think.
I believe I may have found a fix for the issue here. TL;DR the way I understand it, when I changed the docker root, it switched storage type (not sure why) to devicemapper. Devicemapper has a certain default storage limit for images and containers that’s 10GB that you have to change. I’m trying again and will update.
Thank you again!

Edit: it worked! All is well in the world. Thanks again my friend.

Something is off on the docker_data.

Solution:

remove the /etc/docker/daemon.json file.
start docker.
copy the /var/lib/docker contents to the path you’ve put in /etc/docker/daemon.json.
put back the file /etc/docker/daemon.json and restart docker.