The Windows Subsystem for Linux (WSL) is an ultimate feature from Microsoft that enables developers to run a GNU/Linux environment directly on Windows, unmodified, without the overhead of a traditional virtual machine or the dual-boot setup.

In WSL2, they made lots of performance improvement alongside adding new features such as Managed VM, Full Linux Kernel and Full system call compatibility.

If you enable and install WSL-2 on your Windows, in Docker-desktop can use WSL-2 based engine for better performance.

Image for post

Docker Desktop uses the dynamic memory allocation feature in WSL 2 to greatly improve the resource consumption. This means, Docker Desktop only uses the required amount of CPU and memory resources it needs, while enabling CPU and memory-intensive tasks such as building a container to run much faster.

_— _https://docs.docker.com/docker-for-windows/wsl/

Dynamic memory allocation and more CPU power! Looks great! But take a look at the following image:

Image for post

Insane memory consumption : Docker on WSL2

Docker on WSL-2 might allocate all available memory, and it eventually causes memory starvation for OS and other applications.

#windows-10 #wsl #wsl-2 #docker #development

WSL2 Tips: Limit CPU/Memory When using Docker
94.35 GEEK