Installing Containers and Docker on Windows Server 2016

With Windows Server 2016, Microsoft introduces the new feature called Windows Containers. Containers wrap software up within in a complete file system that contains everything it needs to run: code, runtime, system tools and system libraries. This guarantees that it will always run the same, regardless of the environment it is running within.

In October 2014, Microsoft Corp and Docker announced a strategic partnership to bring the agility, portability, and security benefits of the Docker platform to Windows Server.

Installing Windows Containers feature:

Let’s start by installing the Windows Containers feature on the container host:

PS > Install-WindowsFeature Containers
 
Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    Yes            SuccessRest... {Containers}
WARNING: You must restart this server to finish the installation process.

Installing Docker

Now, you can deploy Docker from the PowerShell Gallery. First, install the provider:

PS > Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

Next, install Docker:

PS > Install-Package -Name docker -ProviderName DockerMsftProvider

Once installed, the service can be started:

PS > Start-Service Docker
WARNING: Waiting for service 'Docker Engine (Docker)' to start...

After this step, you should be able to work with Docker on your machine. You can type docker info to check that all is good.

PS C:\> docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.14.0-dev
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 14393 (14393.0.amd64fre.rs1_release.160715-1616)
Operating System: Windows Server 2016 Datacenter
OSType: windows
Architecture: x86_64
CPUs: 1
Total Memory: 1.933 GiB
Name: SRV1
ID: VB3B:IGYN:GEFL:6ML7:OQJM:GMCJ:HDNU:Z57W:SWYI:Z2I3:WZKG:O2L4
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Done! Docker is installed on your Windows Server 2016.

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 279 Articles
I work as an IT Production Manager, based in Paris (France) with a primary focus on Microsoft technologies. I have 10 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSE: Cloud Platform and Infrastructure", "MCSA: Windows Servers", "Administering & Deploying SCCM", and CheckPoint CCSA certified.