I have Docker Desktop for Windows, Docker Engine v19.03.8.
I launched the container based on mcr.microsoft.com/mssql/server:2019-CU3-ubuntu-18.0 image
I created a database and populated it with data. Execute command: docker system df -v and see 177Mb of container space usage. Checked size of C:\ProgramData\DockerDesktop\vm-data\DockerDesktop.vhdx - 9 736 028 160 bytes
Cleaned the database. docker system df -v showing me 110Mb of container space usage. Checked size of C:\ProgramData\DockerDesktop\vm-data\DockerDesktop.vhdx - 9 736 028 160 bytes (size absolutely has not changed).
My questions is: where is containers data physically stored or where did 67 megabytes go?
A virtual hard disk doesn’t shrink by itself. You have to open the Hyper-V Manager, go to the Virtual Hard Disk Manager, open this disk and choose ‘Compact’.
You go one step too far, just open the Hyper-V Manager, then click on Edit Disk... (I use the German version, had to look it up in screenshots). Maybe it’s not a bad idea to make a backup of important data before this.
Sorry, didn’t see that there are more screenshots.
Did you stop Docker before this? When I open DockerDesktop.vhdx in my Hyper-V Manager I have 3 options.
This must be a Redmond Riddle.
A general question: Is the size of this volume an actual problem and can’t you wait until you get Windows 10 2004 where you can run Docker in WSL2?
Hyper-V is the Windows hypervisor (and Microsoft is located at Redmond, you understand the joke now?). It is used by Docker Desktop to create an environment where Docker can run and it’s not a part of Docker. Some years ago Virtualbox was at this place and with the most recent version you can use WSL2.
Now it is clear. My level of English does not always allow me to understand the essence of what is written, so there is a certain difficulty with jokes too
Thank you for the answers!