docker overlay2 increase size

Viewed 1608

I am very new to docker so please pardon if anything stupid :P I have docker running on my cloud server and was facing issue of running out of space because of docker overlay files. So I mounted 100GB of storage to the server at

/home/<user>/data

and in daemon.json configured the docker root directory to this newly mounted storage and copied all the old files but after that also when I check

df -h 

overlay file shows size 36G. Am I doing something wrong How can I increase this overlay to completely utilize the storage ?

PS: Also when it starts filling up it doesn't increase space it just fills up and all the apps stop working

1 Answers

Docker stores images, containers, and volumes under /var/lib/docker by default. If you haven't mounted another filesystem there, you are likely looking at the free space on your root filesystem.

When mounting another filesystem in this location, you likely want to move the current directory aside so you can copy it into the new filesystem. If you do restore the content, be sure to use a command that preserves ownership, permissions, and symlinks (I believe cp -a and tar both do this).

Also, make sure the docker engine is not running when you replace this directory, and be sure the filesystem type matches your current root filesystem type, or is compatible with your graph driver.

Related