How to Reclaim C: Drive Space Eaten by Docker Desktop on Windows
Docker Desktop on Windows stores all container data inside a single virtual disk file (.vhdx) that grows automatically but never shrinks on its own, even after deleting images. Running 'docker system prune' frees space within the virtual disk but does not return that space to the host drive until the file itself is compacted. Users must first quit Docker Desktop and shut down WSL2, then compact the disk using either the Optimize-VHD PowerShell command on Pro/Enterprise editions or the diskpart utility on Windows Home. The compacted virtual disk reattaches automatically when Docker Desktop is restarted. To prevent runaway disk growth in future, Docker Desktop's Settings allow users to set a maximum disk size limit under Resources > Advanced.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in