Docker on Windows with WSL 2 can unexpectedly consume large amounts of disk space on the C: drive due to VHDX files like ext4.vhdx and docker_data.vhdx.
Deleting data inside VHDX files doesn't automatically shrink them. Docker images, containers, and volumes within VHDX files grow dynamically, leading to bloating.
Using Docker's pruning commands may help recover some space, but manually compacting the VHDX files using Optimize-VHD is necessary to release the internally freed space back to the Windows OS.
Compacting the VHDX files resulted in a significant space reclamation, with ext4.vhdx going from 377.7 GB to 117.2 GB and docker_data.vhdx shrinking from 145.2 GB to 52.0 GB, totaling over 353 GB reclaimed on the C: drive.