Fixing docker pull on Windows Server Core 2016 on Azure


When creating a new Windows Server 2016 Core with Containers Tech Preview 4 VM on Azure, Docker is already installed:

> docker -v
Docker version 1.10.0-dev, build 59a341e

Cool! Except, trying to pull an image will fail:

> docker pull microsoft/aspnet
Using default tag: latest
Pulling repository docker.io/microsoft/aspnet
Error: image microsoft/aspnet:latest not found

The version of docker contained in this preview build is outdated, so we will update it.
Folks at Microsoft made a script for that on GitHub. 1

We simply run:

> powershell
> wget https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/live/windows-server-container-tools/Update-ContainerHost/Update-ContainerHost.ps1 -OutFile Update-ContainerHost.ps1
> ./Update-ContainerHost.ps1

once docker is restarted, everything should work correctly:

> docker pull microsoft/aspnet
Using default tag: latest
latest: Pulling from microsoft/aspnet

3340b04778f8: Pull complete
ac0fe24043c3: Pull complete
b7fdd09ec6df: Pull complete
Digest: sha256:4d045fe95fc699732c3567ae58c0c534812ce43bfe091c928d275b12c3476dc5
Status: Downloaded newer image for microsoft/aspnet:latest