Skip to content

Docker change root dir

Alejandro Blanco Muñoz edited this page Jul 29, 2020 · 1 revision

This was only tested with Docker 1.13.1 under CentOS 7

To change the /var/lib/docker default root directory to another location with more space.
In this case we are going to change the root dir from /var/lib/docker to /home/docker

First stop Docker daemon: systemctl stop docker

Open and edit the file /etc/sysconfig/docker: Modify the OPTIONS variable:

Original:

OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false'

Modified:

OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --graph=/home/docker --storage-driver=overlay2'

Start Docker: systemctl start docker

And now the root dir should be /home/docker. It can be checked with the docker info command.

Clone this wiki locally