Get started with Linux containers in Docker on WSL 2

Microsoft and Docker’s Linux development collaboration is starting to pay off for cloud developers

When Microsoft launched its Windows Subsystem for Linux (WSL) back in 2018, it was very clear why: It wanted to provide tools for developers building modern cloud applications. Microsoft needed a way to offer container development, with an eye on Azure-hosted distributed applications running on its Azure Kubernetes Service.

However, there were issues with the original WSL platform. It wasn’t easy to run Linux containers natively on Windows. Combined with ensuring WSL’s emulation layer could support Linux applications and services, it was clear that an emulation-based approach couldn’t meet the needs of most developers. That led to a redesign of the WSL platform and the resulting launch of WSL2 with a full Linux kernel earlier in 2019.

Microsoft’s WSL 2 previews are currently rolling out with Windows Insider 20H1 builds. As I noted in a previous article on WSL2, much of how it works is based on a collaboration between Microsoft and Docker engineers: LCOW (Linux Containers On Windows), which was intended to simplify running Linux containers directly on Windows. By using a hypervisor to host the relevant elements of the Linux OS and Docker platform, Windows development tools have access to the contents of the hosted containers. That thin-hypervisor approach now hosts the entire WSL environment, allowing Linux applications and containers to run natively on Windows systems.

Alongside the launch of WSL2, Docker announced a new version of its Docker Desktop for Windows, with a new version of the Docker application that would work with WSL2, supporting native Linux containers on Windows at long last.

To continue reading this article register now