Run Docker Desktop With WSL 2

We will run Docker Desktop on Windows 10 with Windows Subsystem for Linux 2 (WSL) in this post.

If you have been using Docker Desktop on Windows 10, you probably noticed that there is room to improve when it comes to performance.

With WSL 2, it is now possible to run Docker directly on WSL 2, utilise the built-in Linux kernel and run containers natively with emulation. This setup increases the overall performance of Docker.

WSL

If you don’t have WSL 2 installed on your machine, go ahead and enable it. Please note that your Windows 10 version needs to be 1903. Please use the official Windows docs to enable it.

Docker Desktop

If you have WSL 2 enabled, download the latest version of Docker Desktop and install it. If WSL 2 is enabled, you will see the following message, which is great, and all you need to do is follow the prompts.

Check WSL

To confirm that Docker is running inside WSL 2, open PowerShell and run the following command.

 wsl.exe -list -v

The output of the command should look like this. You can see that I have Ubuntu set as my default WSL distribution plus two Docker native distributions, and they are all running and set to WSL version 2.

  NAME                   STATE           VERSION
* Ubuntu                 Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

For WSL articles, please visit our sister blog WSL category page.

2 comments

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.