由于我将计算机上的Docker升级到beta27,因此我无法使用默认networking运行Windows容器。 我收到以下消息:
docker: Error response from daemon: container xxx encountered an error during Start failed in Win32: The system cannot find the path specified. (0x3): Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type.
我卸载/删除了所有的东西(Docker for Windows,Hyper-V,Containersfunction以及C:\ ProgramData \ Docker中剩下的文件),然后重新安装了所有内容,但问题依然存在。
我意识到nat适配器不再存在于Hyper-V中,但是DockerNat适配器是。
本文提供了一个脚本来重置networking组件,但我无法删除容器networking。
PS C:\WINDOWS\system32> Get-ContainerNetwork Name Id Subnets Mode SourceMac DNSServers DNSSuffix ---- -- ------- ---- --------- ---------- --------- nat 12706897-fc71-41fc-9046-a7be0d01727e {172.16.0.0/12} NAT PS C:\WINDOWS\system32> Get-ContainerNetwork | Remove-ContainerNetwork Confirm Remove-ContainerNetwork will remove the container network "". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Remove-ContainerNetwork : Unspecified error At line:1 char:24 + Get-ContainerNetwork | Remove-ContainerNetwork + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Remove-ContainerNetwork], VirtualizationException + FullyQualifiedErrorId : OperationFailed,Microsoft.Containers.PowerShell.Cmdlets.RemoveContainerNetwork PS C:\WINDOWS\system32> Remove-ContainerNetwork -Name nat Confirm Remove-ContainerNetwork will remove the container network "nat". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Remove-ContainerNetwork : Unspecified error At line:1 char:1 + Remove-ContainerNetwork -Name nat + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Remove-ContainerNetwork], VirtualizationException + FullyQualifiedErrorId : OperationFailed,Microsoft.Containers.PowerShell.Cmdlets.RemoveContainerNetwork PS C:\WINDOWS\system32>
是否有一个registry项,我可以删除networking,因为它无法通过PowerShell删除它?
尝试使用以下方法删除NATnetworking:
Get-NetNat | Remove-NetNat
您也可以尝试重新启动HNS和泊坞窗
Restart-Service hns Restart-Service docker