In this article I’ll show you how I Install and Configure a Container host on Windows Server Core 2016 with Docker engine.
Before you start please visit the Windows Server 2016, Windows Container and Docker pages.
Because I’m using a Virtual Machine to run my Container Host I have configured my VM with nested Virtualisation using the article I had published Enable Nested Virtualization In Windows 10 Build 1511 before the release of build 1551.
You might be Interested In:
Setup Windows Server 2016 As A Container Host
Setup Nano Server 2016 As A Container Host
Setup Windows Container Host On Microsoft Azure
To get started, Log In to Server Core and start PowerShell.
The first role I’m going to Install Is Hyper-V using the cmdlet below:
Get-windowsfeature hype* | install-windossfeature
Next I’ll Install Windows Containers role:
Install-windowsfeature containers
Next I’ll Install the Container Image package provider In order to be able to download Containers Images:
Install-packegeprovider containerimage -force
Find-containerimage
Next I’ll Install the Windows Server 2016 Core Image that will allow me to run Windows Server Core Containers.
Note: You can’t run Nano Server Container on a Windows Server 2016 Container Host.
To run Nano Server as Container you will need to run Nano Server as the container host.
Install-containerimage -name WindowsServerCore
To confirm that the Installation Is successful run:
Get-containerimage
To Install Docker run the cmdlet below:
Invoke-WebRequest https://aka.ms/tp5/Update-Container-Host -OutFile update-containerhost.ps1
.\update-containerhost.ps1
Next we need to Tag out Docker Image to be the latest using the line below (make sure you change the Image ID)
Docker images
Docker tag 7e15f95e69f7 windowsservercore:latest
Run Windows Container
Docker run -it windossservercore cmd