05. Docker Desktop for Windows

Chapter 5 of 15 · 20 min

Docker Desktop on Windows runs inside the WSL2 backend by default. This means docker commands run inside WSL2, not in a Windows CMD window. Install Docker Desktop from docker.com/products/docker-desktop/. During installation, enable the "Use WSL2 instead of Hyper-V" option. If you are on Windows Home (which lacks Hyper-V), this is your only option anyway.

After installation, open PowerShell and verify:

docker --version
docker compose version

Inside WSL2, also verify:

docker --version
# Docker version 26.1.0, build 4c95490

Both should show the same version. If they diverge, the Windows-side Docker Desktop is running a different daemon than the WSL2-side CLI expects. Restart Docker Desktop from the system tray icon.

Docker Desktop's VM settings in its graphical preferences control how much CPU, RAM, and disk it allocates to the Linux VM that actually runs containers. These are separate from WSL2's .wslconfig settings. If you set WSL2 to memory=12GB and Docker Desktop to 8GB, Docker containers see only 8 GB.

Check Docker's resource limits from inside WSL2:

docker system info | grep -E "(Memory|Total Space)"
# Memory Limit: 8589934592
# Total Space: 527483473920

Common failure: Docker Desktop fails to start with "WSL2 installation is incomplete". Run wsl --update from an elevated PowerShell prompt. Another common failure: "Hardware assisted virtualization and data execution protection must be enabled in BIOS". This requires a BIOS setting change and cannot be worked around in software.

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

EXERCISE

Run docker run --rm hello-world inside WSL2. If it succeeds, run docker run --rm -it ubuntu bash and confirm cat /etc/os-release shows Ubuntu inside the container. Exit the container.