I use Docker on my Windows machine, but after a while my storage fills up and my disk indicator turns red. I noticed that my Docker virtual disk keeps growing automatically.
In Docker settings under the Resources option, there is an option to set a custom storage location. I configured it to D:\System_Programs\Docker\DockerDesktopWSL\disk and a .vhdx file was created there — and its size has grown to 20GB.
But when I run docker system df , it shows completely different stats — it says Docker is barely using 5GB. I also went into WSL by running wsl -d docker-desktop and ran lsblk there, and it shows the same low usage. I don’t understand why there’s such a big difference.
I also don’t understand why Docker uses its own virtual system but still requires an Ubuntu WSL instance with an extra Ubuntu .vhdx . So there are two disk images being used by Docker. And on top of that, I found another folder at C:\Program Files\Docker\Docker\resources\wsl — what is that used for?
Can anyone help me get answers to these questions? Why those multiple virtual disk is require, Or can any one tell me some tricks or hack so that I can reduce the size of that disk.
It does neither use its own virtual system, nor does it require an Ubuntu distribution to work.
Docker Desktop leveraged WSL to run the backend services of Docker Desktop inside a WSL Distribution, which also runs the Docker Engine. Furthermore, it mounts a 2nd vhdx for the state - this is the one that is growing. We had a couple of topics about how to shrink the vhdx files. Depending whether you are on home or pro/enterprise, there are windows tools that help to shrink the vhdx files.
Can you explain how Virtual Box is related to this? Docker Desktop neither depends on Virtual Box, nor does it allow to use Virtual Box as backend.
Update: for whatever reason “shrink” became “strike” when I saved the text. Might have been autocomplete of my fingers. I corrected it to “shrink”.
Sorry My applogy this not virtual box I man the Virtual Disk here. But you tell that there are some windows tools that help to strike the vhdx files. can you tell me some of those tools also can you tell me how I shrikn the vhdx files.
I am using docker home
what state it store on that .vhdx that it take too much space while my image size, voulume, and data doest not require too much storage !