Docker Machine错误:Hyper-V PowerShell模块不可用

Tan*_*ner 7 powershell hyper-v docker docker-machine

我检查了Hyper-V设置并启用了PowerShell模块.我也发现了这个记录的问题:https://github.com/docker/machine/issues/4342但是由于我没有安装VMware PowerCLI,因此问题不同.该问题因推销回购而关闭,据推测固定在0.14.0-rc1,构建e918c74,所以无论如何我都试过了.更换我的docker-machine.exe后,即使重新安装Docker for Windows,我仍然会收到错误并仍然出错.

对于更多背景,重新安装后发生此错误,因为我的Docker安装有错误:https://github.com/docker/for-win/issues/1691但是,重新安装后我不再遇到此问题.

Sen*_*hil 7

对于那些在Windows中遇到此问题的人,请按照此处的说明操作


div*_*481 6

在win10上使用docker-machine创建Hyper-v VM时,会返回错误"预创建检查时出错:"Hyper-V PowerShell模块不可用".

解决方案非常简单.原因是docker-machine程序的版本.将其替换为v0.13.0.具体操作如下:

  1. 下载docker-machine命令的0.13.0版本.点击下载:32位系统或64位系统

  2. 下载完成后,重命名并替换"C:\ Program Files\Docker\Docker\resources\bin"目录中的"docker-machine.exe"文件.最好备份原始文件.


小智 5

这是解决方案

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

将下载的文件保存到包含docker-machine.exe.

对于我的系统,这是位置 docker-machine.exe /c/Program Files/Docker/Docker/Resources/bin/docker-machine.exe

备份旧文件并用新文件替换它。

cp docker-machine.exe docker-machine.014.exe

将下载的文件名重命名为 docker-machine.exe

mv docker-machine-Windows-x86_64.exe docker-machine.exe

构建说明

  1. 在名为 Hyper-V 的管理器中创建虚拟交换机 myswitch
  2. 请求 Docker 创建一个名为的 VM myvm1

docker-machine create -d hyperv --hyperv-virtual-switch "myswitch" myvm1

结果

docker-machine create -d hyperv --hyperv-virtual-switch "myswitch" myvm1

Running pre-create checks... (myvm1) Image cache directory does not exist, creating it at C:\Users\Trey Brister\.docker\machine\cache... (myvm1) No default Boot2Docker ISO found locally, downloading the latest release... (myvm1) Latest release for github.com/boot2docker/boot2docker is v18.05.0-ce (myvm1) Downloading C:\Users\Trey Brister\.docker\machine\cache\boot2docker.iso from https://github.com/boot2docker/boot2docker/releases/download/v18.05.0-ce/boot2docker.iso... (myvm1) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100% Creating machine... (myvm1) Copying C:\Users\Trey Brister\.docker\machine\cache\boot2docker.iso to C:\Users\Trey Brister\.docker\machine\machines\myvm1\boot2docker.iso... (myvm1) Creating SSH key... (myvm1) Creating VM... (myvm1) Using switch "myswitch" (myvm1) Creating VHD (myvm1) Starting VM... (myvm1) 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 myvm1