gmichos
gmichos

Reputation: 33

How can I increase the size of volume var/lib/docker/overlay2 or mounted to a new Virtual Disk in a Debian VM

I have a Docker CE installed on a Debian 9 VM, The issue I am facing is that the free size at var/lib/docker/overlay2 is limited by default and it's not enough to install more than 2 containers.

I try prune but it's not enough.

Can I increase the size of var/lib/docker/overlay2 or mount a new Virtual Disk at the VM and change the var/lib/docker/overlay2 to point the new disk?

I try prune but didn't work. I don't know how to change the var mount point size during the installation of the Debian in the VM in order to increase the size before installing the Debian CE

Upvotes: 2

Views: 3291

Answers (1)

LinPy
LinPy

Reputation: 18578

the easiest way is to use onther root directory:

change the path in /etc/docker/daemon.json to :

{
“data-root”: "/new/path"
}

and then restart your Docker service.

PS: you need to move the data from /var/lib/docker to the new location if you want to use old images, containers .... otherwise all of the data will gone.

Upvotes: 4

Related Questions