Detailed explanation on how to install Liunx Container through Hyper-V in Windows Server 2016 (picture)

黄舟
Release: 2017-06-05 09:29:41
Original
3921 people have browsed it

Windows Server2016 has been officially released for some time. It is understandable that the support of native Docker is a very big highlight of this version.

Windows Container The currently supported image must be the Windows kernel image (including Server Core/Nano Server), and some images are also It is in the testing stage and has many pitfalls.

In the latest version of Docker for windows, switching between Windows container and Liunx is implemented, but currently it can only be installed in the windows10 environment (if there are other methods Please tell me).

This article takes installing the Docker Registry image in Windows 2016 as an example to explain how to install Docker through VM in Hyper-v in Windows Server 2016

1. Turn on the Hyper-V function

First make sure that the Hyper-V function is turned on. Without giving too much introduction.

2. Set up the virtual switch

In the Hyper-v manager interface, in the operation bar on the right, open the virtual switch manager

Create a new virtual network switch

After I have built it here, the result is as follows:

Restart the computer

Docker-Machine

Docker-Machine is not installed by default, you need to download it yourself

http://github.com/docker/machine/releases

After downloading, rename it to docker-machine.exe

Create Docker machine

  1. Enter the folder where docker-machine.exe is located in the administrator cmd environment

  2. ##The format of the running command is as follows:

  3. docker-machine create -d hyperv --hyperv-virtual-switch "<NameOfVirtualSwitch>" <nameOfNode>
    Copy after login
corresponds to my here is


` docker-machine create -d hyperv --hyperv-virtual-switch "DockNAT" VM8 `
Copy after login

Then wait

PS C:\WINDOWS\system32>  docker-machine create -d hyperv --hyperv-virtual-switch "DcokNAT" VM8
Running pre-create checks...
Creating machine...
(manager1) Copying C:\Users\Vicky\.docker\machine\cache\boot2docker.iso to C:\Users\Vicky\.docker\machine\machines\manag
er1\boot2docker.iso...
(manager1) Creating SSH key...
(manager1) Creating VM8...
(manager1) Using switch "DockNAT"
(manager1) Creating VHD
(manager1) Starting VM...
(manager1) Waiting for host to start...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Program Files\Doc
ker\Docker\Resources\bin\docker-machine.exe env VM8
PS C:\WINDOWS\system32>
Copy after login
Set the current host as the host where the default docker command runs. According to the prompts, we run the following command

docker-machine.exe env VM8

Run command:

@FOR /f "tokens=*" %i IN ( 'docker-machine env vm8') DO @%i

After completion, run the command:

docker version View host information

Installing Registry

I will not go into details about the tutorial for installing Registry

At this point, we have completed the

linux version of docker in Windows Server 2016 Install.

I am also a beginner, crossing the river by feeling the stones. Please correct me if there are any mistakes.

The above is the detailed content of Detailed explanation on how to install Liunx Container through Hyper-V in Windows Server 2016 (picture). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!