Resize Docker (Link)
Turns out there is a way to shrink the vhdx images properly in windows:
- Run in cmd:
docker system prune
(optional--all
), to clean up disk space - Right mouse click on docker desktop in system tray -> quit
- Run in cmd:
wsl --shutdown
- Run
Optimize-VHD -Path "$env:LOCALAPPDATA\Docker\wsl\data\ext4.vhdx" -Mode Full
, this will resize the vhdx images Same way you can try to find vhdx images that utilize too much space and optimize them as well. You can use TreeSize(Bing it: Tree Size Windows) to find which image takes the most of the space and optimize them.
P.S. dont forget to run docker system prune