Installing the container service

Our prerequisites for using containers are Windows Server 2016 and a current-generation hardware platform that supports virtualization (any Intel/AMD processor from approximately 2005 onward with Intel VT-x or AMD-V technology).

It is possible to host containers inside a Virtual Machine, so feel free to try out this chapter on a Virtual Machine running Windows Server 2016.

The very first step is to activate the Container Services feature on the Windows Server machine that should host the container service. The Container Services feature inside Windows provides the interface between the operating system and the containers that are hosted on the server, and it is a requirement for natively hosting containers in Windows servers.

This is easily done using PowerShell (running using elevated privileges) with two simple commands:

Install-Module -Name DockerMsftProvider 
Install-Package -Name docker -ProviderName DockerMsftProvider 

This will download and install the Microsoft provider for Docker from the Microsoft Package Repository. Docker is just one of many container hosting services that are available to use on Windows. However, Microsoft integrated the Docker technology directly into the Windows kernel, allowing for a seamless implementation of containers in Windows using their technology stack.

Microsoft officially provides modules and features for the operating system using the online .NET package management directory powered called NuGet (like apt-get for readers who use Linux). This automatically provides dependency resolution and downloads all packages/modules required to make containers work on the current Windows installation:

Installing Docker using PowerShell

A server restart is usually required here, because a low-level reconfiguration of the Windows kernel has been made.

Once the server has been restarted, the container service should be running and available. The first check to ensure that the Docker service is running is to issue the command:

Docker version
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.221