How to Docker on Windows 10 Home with WSL2

Aaron Chen
6 min readMar 23, 2020

--

Photo by Tobias A. Müller on Unsplash

JULY 28, 2020 UPDATE:

If you are running Windows 10 version 2004 (the May Update) or higher, you can install the normal (stable) version of Docker!

I will try to write a follow up article on this since in case there are issues with using/uninstalling the experimental version.

Hey folks!

I made a reference to this in my weekly update from a few days ago, but I wanted to do a quick little tutorial on how to get Docker up and running on Windows 10 Home with Windows Subsystem for Linux 2 (WSL2).

You might be saying: “Aaron, why do you need to write this up? These instructions already exist at Docker’s own website! And there’s even a handy tutorial!

That’s true, but something I didn’t realize until I tried to get Docker working was that it depends on a feature that isn’t “enabled” Windows 10 Home (as of March 20, 2020). If you have Windows 10 Pro or Enterprise, you’re good and don’t need to read the rest of this article. Go here and get Dockerizing! If you didn’t get something with the more fully featured versions of Windows 10, then you might find this helpful!

Consider this as a parallel to Aaron Abrahamson’s article on how to get Docker working on your MacOS computer. That one makes it seem really easy to get things going on Mac, but there are some complications for Windows 10 Home. Additionally, I signed up for Windows 10 Insider to look at fancy new features that are coming from Microsoft for Windows 10. Basically, I’m one of the millions of volunteer beta testers willing to try things that Microsoft is working on.

Why Insider Program?

You may be wondering why I’m using Insider. Fair question! I used to use a Windows Phone (7 -> 8 -> 10), liked trying to help fix bugs and improve the platform, and that just kinda carried over to Windows 10. Plus, they had announced some really cool features for Windows 10 that are currently only available for Insiders.

For one thing, Microsoft introduced a new Terminal that can combine windows for different shells into one user interface.

Screenshot from Terminal in the Windows 10 Store (I use Dark Solarized)

For me, at least, this was a lot cleaner and more convenient. When I first got a data science environment set up on my Dell, I had to have Git Bash, Powershell, and Command Prompt all as separate command line interfaces, and it was a bit annoying and surprisingly unpleasant to look at.

If you’re also curious to give Terminal a try, give their GitHub repo a look as Microsoft has laid out more of the reasons, pros and cons, and instructions here

The other reason I signed up for Insider Program is to try Windows Subsystem for Linux.

My experience working on the Flatiron School loaner MacBook Air and reading documentation for different projects seems to make it clear to me that, as a developer environment, I think I prefer Linux and MacOS. So you may be wondering why I’m sticking to Windows 10.

I used to have a 2009 Unibody MacBook Pro running alongside a Windows desktop. I hated that setup. It presented a lot of rather annoying little complications in everyday life and I realized that I should stick to one OS for my home stuff. Before you say Boot Camp or Parallels, I tried both and they were each annoying in their own ways. Since I’m also a photographer, you may be saying “Doesn’t creative software work better on Mac? Why didn’t you go all Mac?” My response to that is…they actually don’t and hasn’t been true for many years.

Plus, I did not want to develop a dependency on Apple’s apps; look at what happened with Aperture.

Apple dropped support for Aperture cold turkey in 2014 and left users struggling to change to a new workflow. Photographers were still angry at Apple over it even in April of 2019.

I had this issue with iWork when I went to grad school: despite the number of Macs all around me, almost all of the Mac users were going with Microsoft Office instead of iWork! This really hurt me one day when I was supposed to give a presentation, my Mac died, and I tried to borrow another Mac to open the Keynote file. No one actually had an iWork license and I had to run across campus to use a library iMac just to convert the file to Powerpoint.

I happily gave up that Mac for a Surface Pro 2 when they came out and have stuck with Windows for personal use ever since. If I had my druthers, I would have Windows at home and a Linux for work. Microsoft is aware of developer preferences and is attempting to remedy this problem by including a smart and fast virtual machine inside Windows 10 called Windows Subsystem for Linux.

I’ve been using this since I came back from Flatiron and I do like it. I even liked WSL 1, which was apparently a lot slower for disk I/O but I never noticed it. It isn’t the same as having a Linux unit, but it works well enough for me and doesn’t require me to switch between coding in two different operating systems. It is in beta, is always improving, and integrates nicely with Terminal! I chose the default WSL distro of Ubuntu, by the way.

Lastly, one more reason to have Insider on your computer is that it currently is required to run Docker if you have Windows 10 Home. Surprise!

Docker Who?

(Before anyone says anything, I don’t watch Doctor Who)

I had to fail to install Docker, see the message saying “Docker is unsupported on Windows 10 Home”, and read Docker’s blog to see how to actually get this working without shelling out more money to upgrade my operating system license.

Relevant blog here, but the gist is that you need a W10 Insider build of 19040 or higher, and the experimental edge version of Docker Desktop (linked in that blog post).

After that, you should be able to finish following Aaron’s article, or another Docker tutorial to get things working. I got the simple docker hello-world to work after making those tweaks.

What Next?

To be honest, I intended this article to be very short, but I ended up finding even more complications during my attempt to Dockerize my machine learning powered recipe recommender, MeaLeon. I’ll summarize them in a hopefully brief article soon. For now, this should be enough!

Until next time, wash your hands (and git commit) often, stay inside, and maintain social distance. We’ll all get through this =D

--

--