如何通过Windows命令“ docker-machine create”创建虚拟机

时间:2019-04-25 16:44:09

标签: docker virtual-machine

我在Visual Studio 2019中有一个项目。我想学习Docker并尝试将我的2个Web应用程序大量部署。

当我使用命令时         “ docker-machine create -d hyperv --hyperv-virtual-switch“ stationext” myvm1“ Docker创建一个虚拟机。我可以在Hyper-V管理器中看到它。但是此VM与Linux一起使用。

如何在Windows板上通过命令“ docker-machine create”创建VM?

创建日志

PS C:\WINDOWS\system32> docker-machine create -d hyperv --hyperv-virtual-switch "stationext" myvm3
Running pre-create checks...
Creating machine...
(myvm3) Copying C:\Users\Sergii\.docker\machine\cache\boot2docker.iso to C:\Users\Sergii\.docker\machine\machines\myvm3\boot2docker.iso...
(myvm3) Creating SSH key...
(myvm3) Creating VM...
(myvm3) Using switch "stationext"
(myvm3) Creating VHD
(myvm3) Starting VM...
(myvm3) 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\Docker\Docker\Resources\bin\docker-machine.exe env myvm3

What i see in VM

1 个答案:

答案 0 :(得分:0)

我认为这是预期的行为,不知道您在哪里看到要启动Windows OS容器,boot2docker是Linux,正如您在其git上看到的那样:

https://github.com/boot2docker/boot2docker#readme

同时,您会发现不赞成使用此方法,而推荐使用Windows的Docker。 对于在docker上运行Windows主机,我认为您应该看看以下内容:

https://www.docker.com/products/windows-containers