WSL containers — Mission
Why I’m learning this
Section titled “Why I’m learning this”I use Docker Desktop and Podman on the same Windows machine, each with its own WSL VM.
Microsoft now builds a container tool directly into WSL: wslc.exe.
I want to know whether it can replace — or complement — Docker Desktop for my daily use, and how to use it from my own applications.
By the end of this course, I will be able to
Section titled “By the end of this course, I will be able to”- explain what WSL containers is and how it relates to WSL 2 and Docker Desktop;
- install the right version of WSL and diagnose a failed installation;
- run, inspect, publish and stop containers with
wslc; - build an image from a
Containerfile; - decide when to use
wslcrather than Docker Desktop.
Prerequisites
Section titled “Prerequisites”- Windows 11 with WSL 2 installed.
- Basic container concepts (image, container, port) — lesson 1 reviews them.
- A PowerShell terminal; administrator access to update WSL.
Outline
Section titled “Outline”- Concepts — containers, WSL 2, and where
wslcfits. - Installation — switch to pre-release, verify, troubleshoot.
- First containers —
run, ports,exec,stop. - Building an image — a C# API and a Spring Boot WebFlux API: multi-stage
Containerfile,build, logs, cleanup. - wslc or Docker Desktop? — comparison and API for Windows applications.
- Journal — my attempts, errors and items to verify.
Resources
Section titled “Resources”- WSL container — Microsoft Learn: overview, CLI and API.
- Get started with containers on WSL — Microsoft Learn: official tutorial.
- WSL container is now available for public preview — Windows Command Line blog: announcement.
- WSL release notes — GitHub: stable and pre-release versions.
- WSL container API reference and samples.