How to install Docker on Windows Server 2016

How to install Docker on Windows Server 2016

Recently Microsoft released Windows Server 2016, which natively supports Docker. This article will show you how to install Docker on Windows Server 2016 through a series of steps.

Windows supports two different types of containers, Windows Server Containers and Hyper V Containers. Both types of containers are used in the same way and support the same container images. However, their implementation mechanisms are different and provide different security isolation levels

Windows Server Containers - Very similar to Linux containers, using namespaces and resource controls to achieve process isolation. Each Windows Server container shares the same kernel as the host machine.
Hyper V Containers - Each container runs in a highly optimized Hyper V virtual machine, so the container has its own independent kernel. This will provide better isolation for the container, but will also slow down the startup process and increase resource usage.
If you don’t have a Windows Server 2016 environment, you can also start the experiment on the Windows 10 operating system using Docker for Windows.

Here are a few tips from the Docker Chinese Guide:

Tip 1: Docker has been tested on Windows 7.1 and Windows 8, but it can also be used on earlier versions of Windows. But your processor must support hardware virtualization.

Tip 2: Docker Engine uses Linux kernel features, so we need to use a lightweight virtual machine (VM) on Windows to run Docker. We use the Docker client for Windows to control the build, run, and management of the Docker virtualization engine.

Tip 3: To simplify this process, we have designed an application called Boot2Docker that you can use to install a virtual machine and run Docker.

Tip 4: Although you are using the Windows Docker client, the Docker engine container is still running on the Linux host (now through Virtual Box). Until we develop a Windows version of Docker Engine, you can just start a Linux container on your Windows host.

Basic requirements for installing Docker environment on Windows:

(1) Must be a 64-bit operating system, Windows 7 or higher (Windows 10/Server 2016 is recommended because the new version integrates many new components)
(2) Support "Hardware Virtualization Technology" and "virtualization" is available (that is, VT parameters are enabled in BIOS)

1. Download the 180-day evaluation version of Windows Server 2016.

Address: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2016?i=1

Windows Server 2016 official simplified Chinese version 64-bit (with activation serial number key)

2. Install Windows Server 2016

The installation process is similar to that of Windows 10, and you can choose whether to install the GUI as needed.

3. Update the system to the latest version

Open PowerShell and enter the command "sconfig", select 6 to download and install the update.

===============================================================================
       Server Configuration === ...

1) Domain/Workgroup: Workgroup: WORKGROUP
2) Computer name: WIN-GHUNK220OOQ
3) Add local administrator 4) Configure Remote Management Enabled 5) Windows Update Settings: Download Only 6) Download and Install Updates 7) Remote Desktop: Enabled (All Clients)

8) Network settings 9) Date and time 10) Telemetry settings basic 11) Windows activation 12) Log off user 13) Restart server 14) Shut down server 15) Exit to command line

4. Install Docker

First install the oneget PowerShell module

Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

Then use oneget to install the latest version of docker

Install-Package -Name docker -ProviderName DockerMsftProvide

PowerShell asks if you really want to install the software from "DockerDefault", select "A" for all.

PS C:\> Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
PS C:\> Install-Package -Name docker -ProviderName DockerMsftProvider

The package comes from a package source that is not marked as trusted.
Are you sure you want to install software from 'DockerDefault'?
[Y] Yes (Y) [A] Yes to all (A) [N] No (N) [L] No to all (L) [S] Pause (S) [?] Help (default value is "N"): A
Warning: A restart is required to start docker service. Please restart your machine.
Warning: After the restart please start the docker service.

Name Version Source Summary
---- ------- ------ -------
Docker 1.12.2-cs2-ws... DockerDefault Contains the CS Docker Engine for use with Windows ...

Restart your computer after installation is complete

Restart-Computer -Force

Enter in PowerShell, docker version, to display the docker version

PS C:\Users\Administrator> docker version
Client:
 Version: 1.12.2-cs2-ws-beta
 API version: 1.25
 Go version: go1.7.1
 Git commit: 050b611
 Built: Tue Oct 11 02:35:40 2016
 OS/Arch: windows/amd64

Server:
 Version: 1.12.2-cs2-ws-beta
 API version: 1.25
 Go version: go1.7.1
 Git commit: 050b611
 Built: Tue Oct 11 02:35:40 2016
 OS/Arch: windows/amd64

5. Install the first docker container

Use docker run to deploy a .net core hellworld official application image

docker run microsoft/dotnet-samples:dotnetapp-nanoserver

You will see the same interface as the Linux deployment container

PS C:\Users\Administrator>docker run microsoft/dotnet-samples:dotnetapp-nanoserver
Unable to find image 'microsoft/dotnet-samples:dotnetapp-nanoserver' locally
dotnetapp-nanoserver: Pulling from microsoft/dotnet-samples
5496abde368a: Downloading [===> ] 14.6 MB/242.6 MB
482ab31872a2: Downloading [=========> ] 19.46 MB/100.5 MB
df00079eb06a: Download complete
79730b122a0a: Download complete
e2f5db19e1d2: Downloading [===> ] 2.293 MB/32.48 MB
c34ebc4d7351: Waiting
8c97c2cd28c1: Waiting
6bd62be70d1c: Waiting
9b45b5fe5811: Waiting

Reference articles:

https://msdn.microsoft.com/virtualization/windowscontainers/containers_welcome

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • The process of installing Docker on Windows Server 2016 and the problems encountered

<<:  Summary of common MySQL commands

>>:  Summary of common operation skills of MySQL database

Recommend

Mysql 5.7.17 winx64 installation tutorial on win7

Software version and platform: MySQL-5.7.17-winx6...

Example code for implementing equal height layout in multiple ways with CSS

The equal height layout described in this article...

A brief discussion on macrotasks and microtasks in js

Table of contents 1. About JavaScript 2. JavaScri...

How to store false or true in MySQL

MySQL Boolean value, stores false or true In shor...

Make your website automatically use IE7 compatibility mode when browsing IE8

Preface To help ensure that your web pages have a ...

Summary of some common configurations and techniques of Nginx

Preface This article lists several common, practi...

CSS3 implementation example of rotating only the background image 180 degrees

1. Mental Journey When I was writing the cockpit ...

Several ways to encapsulate breadcrumb function components in Vue3

Table of contents Preface 1. Why do we need bread...

Detailed explanation of the available environment variables in Docker Compose

Several parts of Compose deal with environment va...

Linux server quick uninstall and install node environment (easy to get started)

1. Uninstall npm first sudo npm uninstall npm -g ...

MySQL compressed package version zip installation configuration method

There are some problems with the compressed versi...

Solution to the failure of entering the container due to full docker space

Since the problem occurred rather suddenly and th...

Detailed explanation of JS browser event model

Table of contents What is an event A Simple Examp...

Use nginx + secondary domain name + https support

Step 1: Add a secondary domain name to the Alibab...

MySQL 5.7.18 installation tutorial under Windows

This article explains how to install MySQL from a...