Running Docker Containers on Windows 10 Home

The Docker for Windows toolkit is adamant it won’t even try to install on Windows Home, since Windows 10 Home does not support Hyper-V. Well, I doubt that this still is a valid supposition, just look at the output of dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum on a current Windows 10 Home system (build higher than #17134 aka “Windows 10 version 1803” aka “the big Spring Creators Update of 2018″), or at these reports of Windows 10 Home installations in the wild showing symptoms of virtualization.

But then, why try to work around Windows deficiencies when you could achieve the same goals using Linux – and by that, for the sake of this post, I mean the Windows Subsystem for Linux or WSL, which in my case basically is an Ubuntu running on top of Windows and a prerequisite for the following — but a welcome one. Here’s the official installation manual, which is pretty streamlined — as in, not scary at all! As I chose Ubuntu, the rest of this post will be based on that choice.

First thing, let’s make sure Ubuntu is up-to-date. I decided to go with the latest LSR 18.04, codename Bionic Beaver. For that, open up your Ubuntu WSL shell.
Issuing the command lsb_release -d will probably result in something like Description: Ubuntu 16.04.03 LTS. As a super-user, start the update: sudo do-release-upgrade -d This may take a while, and will require some manual intervention at the end, but again, all steps are straightforward.

The only cliffhanger is when the update process stalls until a timeout is reached while trying to start LXD — but please bear with me digressing here while you wait for the update to proceed. LXD is a container manager for Linux developed by Canonical, who also are the driving force behind Ubuntu. It’s built on LXC, which also was the container execution driver of early Docker versions. If LXD had been able to start out of the box, our journey had been over here. Sadly, there are irreconcilable issues. But even though this problem hangs the update process for quite a while, it will not break it, so just don’t panic and carry on patiently. In the end, you will be notified that Ubuntu needs to restart. After that, convince yourself that the upgrade worked: lsb_release -d should result in something like Description: Ubuntu 18.04.01 LTS now.

Now, to Docker. Let’s install it into our Ubuntu – but wait! As it turns out, Windows 10 build #17134 requires a carefully selected version or will not cooperate with Docker. While the Docker service might start, running a container will fail with the error message docker: failed to register layer: Error processing tar file(exit status 1): invalid argument.

Docker only works up to version 17.09.0 in the WSL on Windows 10 build #17134
Docker only works up to version 17.09.0 in the WSL on Windows 10 build #17134 – as you can see, I was on Docker 17.12.1., which I first had to uninstall.

So, we’ll have to contend ourselves with Docker version 17.09.0. Inconveniently, there is no related Ubuntu-18.04-specific package known to apt, so we need to download the Debian package for our architecture (AMD 64 in my case, your mileage may vary)…
$ curl -O https://download.docker.com/linux/debian/dists/stretch/pool/stable/amd64/docker-ce_17.09.0~ce-0~debian_amd64.deb
… and install it straightaway:
$ sudo dpkg -i docker-ce_17.09.0\~ce-0\~debian_amd64.deb

Last obstacle to overcome: To run Docker, we’ll need an Ubuntu bash with elevated privileges, as in “Run as Administrator”. And we’ll need to mount the cgroup filesystem first.
$ sudo cgroupfs-mount
$ sudo service docker start

Now, running Docker containers should work just fine.

Docker running on Windows 10 Home, in the WSL.
Docker running on Windows 10 Home, in the WSL.