Docker-无法解析计算机'WINDOWS10-ON-SE' [英] Docker - The computer 'WINDOWS10-ON-SE' could not be resolved

查看:101
本文介绍了Docker-无法解析计算机'WINDOWS10-ON-SE'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是docker的新手。

I am new to docker.

我已经安装了它,但遇到错误:-

I have installed it but I get an error :-


无法执行开始:无法创建:正在运行的命令已停止
,因为首选项变量 ErrorActionPreference或公共
参数设置为停止:

Unable to execute Start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop:

计算机'WINDOWS10-ON-SE'无法解析

The computer 'WINDOWS10-ON-SE' could not be resolved

计算机WINDOWS10-ON- SE是我的主机Windows 10 pro VM

The computer WINDOWS10-ON-SE is my host Windows 10 pro VM

在Hyper-V中尚未创建VM,也没有任何虚拟交换机

No VMs have been created in Hyper-V, nor any Virtual Switches

推荐答案

我也面临着相同的问题,但本质上是随机的,我发现这是由于docker start脚本无法访问网卡所致。这种不可访问性进一步阻止了docker的启动过程。

I was also facing the same issue but it was random in nature, I found it is due to some inaccessibility of network card by the docker start script. This inaccessibility further blocks the start up process of docker.

我发现了一个hack,并且在我的Windows机器上运行正常

I found one hack and it is working fine on my windows machine

使用管理员模式下的任何编辑器打开 C:\Program Files\Docker\Docker\resources\mobylinux.ps1
查找以下代码(在第164行附近)

Open C:\Program Files\Docker\Docker\resources\mobylinux.ps1 with any editor in admin mode. Find following code (around line 164)

$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue

$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue

$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null

在行后添加返回 165在如下所示的新行中保存文件。

Add a return after line 165 in a new line like below and save the file.

$networkAdapter | Remove-NetIPAddress -Confirm:$false -ea SilentlyContinue

$networkAdapter | Set-NetIPInterface -Dhcp Disabled -ea SilentlyContinue

return

$networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null

现在重启docker,重启完成后,在dos admin模式下执行以下命令来设置网络手动卡

Now restart docker and after restart completion execute following commands in dos admin mode to setup the network card manually

netsh接口ipv4设置地址名称= vEthernet(DockerNAT)静态10.0.75.1 255.255.255.0

每次执行系统重新启动并且docker完成启动过程时(无论出于何种原因),您都必须每次运行此命令。
提示:创建此命令的批处理文件并保存在方便的位置。

You have to run this command everytime whenever you are doing system restart and docker completes start process (due to any reason). TIP : create a batch file of this command and save somewhere handy.

注意:任何docker更新都将撤消ps hack。所以要注意...

Note: The ps hack would get undone by any docker update. so be aware...

这篇关于Docker-无法解析计算机'WINDOWS10-ON-SE'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆