I made a docker compose build command and it downloaded half of the internet, filling up my disk. As an emergency measure I pushed Ctrl-C. Then I executed docker system prune to no avail, then Docker Desktop Disk space extension to no avail.
So what I think has happened that since I pushed Ctrl-C in panic, docker compose did not perform any sort of cleanup.
So how to clean up manually and free the disk space? For example, where does Docker cache downloaded files/temporary files?
My use case is Windows 10 + WSL2 + Docker desktop with WSL integration enabled.
If the files were downloaded to the containerās filesystem, the image size of Docker Desktopās WSL2 distribution has already changed. Pruning data in the VM wil not itself decrease the disk size. On some systems like macOS, I heard that decreasing the disk size is possible from the GUI (I never tried), but on Windows, you need to deal with it manually. I think @meyay somewhere already answered it, but I couldnāt find yet.
What I found now is this:
You would need to find where the vhdx is. From powershell it should be here:
Assuming you have pro, after you stopped docker desktop, it could work:
Optimize-VHD -Path "$env:USERPROFILE\AppData\Local\Docker\wsl\data\ext4.vhdx" -Mode Full
Note that iI donāt know how stable this operation is. If you can and need, make a backup of data in case you are afraid of losing data in Docker Desktop.