window server2016 docker安装(OSType:linux)

来自文章:

https://docs.docker.com/machine/drivers/hyper-v/#usage

若想安装OSType:windows。可参照:

https://blog.csdn.net/hebsun/article/details/84106201

首先要开启Hyper-v。尝试开启hyper-v方法:

https://blog.csdn.net/hebsun/article/details/83896047

以前总结的方法,虽然没成功,各种办法都试了。

下载docker-machine:

https://github.com/docker/machine/releases/download/v0.16.0/docker-machine-Windows-x86_64.exe

cmd进入到下载目录下,执行命令

docker-machine-Windows-x86_64.exe create --engine-registry-mirror=https://XXXXXX(换上你的阿里云专属镜像).mirror.aliyuncs.com -d hyperv --hyperv-virtual-switch "switch" VM8

扫描二维码关注公众号,回复: 13591291 查看本文章

注意:switch是再hyper-v里配置的虚拟交换机

等着好一会儿。。。

Creating CA: C:\Users\Administrator\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\Administrator\.docker\machine\certs\cert.pem
Running pre-create checks...
(VM8) Image cache directory does not exist, creating it at C:\Users\Administrator\.docker\machine\cache...
(VM8) No default Boot2Docker ISO found locally, downloading the latest release...
(VM8) Latest release for github.com/boot2docker/boot2docker is v18.09.0
(VM8) Downloading C:\Users\Administrator\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.09.0/boot2docker.iso...
(VM8) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
Creating machine...
(VM8) Unable to get the local Boot2Docker ISO version:  Did not find prefix "-v" in version string
(VM8) Default Boot2Docker ISO is out-of-date, downloading the latest release...
(VM8) Latest release for github.com/boot2docker/boot2docker is v18.09.0
(VM8) Downloading C:\Users\Administrator\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.09.0/boot2docker.iso...
(VM8) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(VM8) Copying C:\Users\Administrator\.docker\machine\cache\boot2docker.iso to C:\Users\Administrator\.docker\machine\machines\VM8\boot2docker.iso...
(VM8) Creating SSH key...
(VM8) Creating VM...
(VM8) Using switch "switch"
(VM8) Creating VHD
(VM8) Starting VM...
(VM8) 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...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.
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: docker-machine-Windows-x86_64.exe env VM8

提示我们运行命令:docker-machine-Windows-x86_64.exe env VM8

执行完成,有打印出来几行

SET ...

SET...

找最后一句:@FOR /f "tokens=*" %i IN ('docker-machine-Windows-x86_64.exe env VM8') DO @%i

执行完以后,执行命令 :docker info。

输入一堆信息,然后找OSType:linux。看看对不对?

然后可以用命令进到创建的虚机里:

docker-machine-Windows-x86_64.exe ssh VM8 

查看安装docker: docker info

测试安装:docker run hello-world

猜你喜欢

转载自blog.csdn.net/hebsun/article/details/84636324