Friday, June 1, 2018

Installing WSL+Ubunutu+Docker on Windows 10/2019 1803

How's that for a needfully-long title? This article comes years after my first taste of Docker and some weeks after diving deep to migrate a legacy app, to node.js, to docker containers so it can be managed and run more effectively.

There is a LOT to share, but for the moment I'm going to focus on the biggest pain-point in getting to really appreciate what Docker can do for a Windows developer; getting Docker running in an environment friendly to all you'll find about Docker on Linux or OSX!

In a nut-shell, you need WSL (which effectively connects a "distro" to Windows low-level APIs). Then you need an environment/distro to actually work in. I'm using Ubuntu here and some of the script is sensitive to that, but there are many other distros available now so you have freedom. Once you have Ubuntu and WSL, you can install Docker-CE. You need CE specifically to work nicely with WSL, otherwise you can use the regular Docker, but then why are you reading this?!

To help ensure my environments were consistent (and because I had to try this dozens of times before it all worked for me), I've created a bash script and in the comments are 4 PowerShell commands you can use to get started with nothing more than a working install of Windows 10 1803 or Server 2019 Preview 1803. I'll let the script explain the details and I make no guarantees about this script so test in a safe place, but I rely on it :)


**Bash script**
https://gist.github.com/rainabba/6f345c439261882e0c1e648fcfc43df4

Followers