OK, So Docker Native is available for Windows, and in the wake of NDC Sydney I figured it was about time I got properly started with it. But getting it up and running wasn’t easy.
The installation, actually, was a breeze, with a reboot or two to get Hyper-V working on my laptop. But come time to run hello-world, there were problems.
OK, that’s bad. It suggests networking is broken. So, after a cursory inspection of my Hyper-V settings (everything looked OK), it was off to the internet. I found this article, which talks through setting up the beta version. Pretty good, but no dice.
I found some other posts which talked about disabling IPv6, and setting up Google public DNS (which I was already using, natch). None seemed to progress me much. Complicating things was the fact I was on a new, untested corporate wifi, which has some DNS issues of its own.
So I scrapped that, switched to a reliable wifi network, and called in the assistance of our resident Hyper-V SME Chris Van Dal, who immediately called out the old “internal virtual switch -> Internet Connection Sharing” trick. Still no dice. Still, this sent us down the road of the current approved method, setting up a NAT network in Hyper-V. It also led me to some stale network adapters which were incorrectly configured and possibly causing some issues.
Still no dice, but I couldn’t help feeling we’d got closer. A little more poking around with things and I decided to do a re-install, but before doing that, I checked out a couple of articles about Docker setup, and discovered MobyLinux.ps1, which is dropped into the \resources folder of your Docker installation at install time.
I cracked open MobyLinux.ps1 and discovered the code that should have set up my Hyper-V networking in the first place. It creates the Hyper-V switches and NATs before creating the actual mobylinux VM, and I assume was the component that went wrong first time round, for whatever reason. I unpicked the PowerShell code within and figured it all out
All it took was running two commands to recreate my MobyLinuxVM correctly
.\MobyLinux.ps1 -destroy .\MobyLinux.ps1 -create
Yep, it was really that simple. And now I have Docker running locally and a world of pre-rolled images at my disposal.
There are a number of other switched to pass – such as keeping the .VMHD file after destruction, and tuning the VM parameters. I’d advise checking out the comment-based help before going mad with this script. But nice to know it exists.
Now, if only Microsoft would fix the “unknown blob” problem on the Nano and Core images, we’d be sorted.