Created
May 2, 2024 10:27
-
-
Save Guiorgy/51a2d45af97581beb874bd69c14d159a to your computer and use it in GitHub Desktop.
A PoweShell script to reduce the size of the WSL virtual volume used by Docker Desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stop the Docker service | |
Stop-Service com.docker.service | |
# Stop the Docker processes | |
Stop-Process -Name "docker.exe" -Force | |
Stop-Process -Name "Docker Desktop.exe" -Force | |
# Stop WSL | |
wsl --shutdown | |
# Optimize the virtual volume (vhdx) | |
Optimize-VHD -Mode Full -Path $Env:LOCALAPPDATA\Docker\wsl\data\ext4.vhdx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment