Fix Docker Desktop issues on Windows

To run docker on Windows, you need to download the Docker Desktop application. Docker on Windows runs either with the WSL 2 backend or the HyperV backend. I prefer to use the WSL 2 backend. Unfortunately, does docker not run as good on Windows as it does on native Linux.

Memory hogging

To prevent Docker Desktop from taking up too much memory and CPU power, you can create a WSL configuration file under C:\Users\<username>\.wslconfig. After that run wsl --shtudown from the terminal and check the results.

[wsl2]
processors=1
memory=1GB
.wslconfig

Permission issues

When you use the WSL2 backend and enable integration with additional distros you occasionally get some permission errors while trying to access some files, try restarting Docker Desktop with following script.

⚠️
Run the script as admin!
taskkill /F /IM "Docker Desktop.exe"
net stop LxssManager && net start LxssManager
start "" "C:\Program Files\Docker\Docker\Docker Desktop.exe"
docker-retart.bat