2016-06-28 60 views
4

我一直在Windows Server 2016 TP5上試用Windows Containers。突然間,我開始得到錯誤,同時運行與端口馬平選項的容器-p 80:80Windows容器無法啓動,出現錯誤,「無法在網絡上創建端點nat:HNS失敗,出現錯誤:無法創建端點。」

c:\>docker run -it -p 80:80 microsoft/iis cmd 
docker: Error response from daemon: failed to create endpoint sharp_brahmagupta on network nat: HNS failed with error : Failed to create endpoint. 

我確信沒有其他容器運行和主機上的80端口沒有被任何其他服務。

有沒有人面臨同樣的問題?

問候

回答

7

周圍搜索後,我在GitHub上stunbled在this問題。這似乎是Windows服務器TP5上Windows容器的一個已知問題。

然後感謝this論壇,我找到了解決辦法 您可以查看下面的命令激活的靜態端口映射

C:\>powershell 
PS C:\>Get-NetNatStaticMapping 


StaticMappingID    : 3 
NatName      : Hda6caca4-06ec-4251-8a98-1fe0b4c5af88 
Protocol      : TCP 
RemoteExternalIPAddressPrefix : 0.0.0.0/0 
ExternalIPAddress    : 0.0.0.0 
ExternalPort     : 80 
InternalIPAddress    : 172.31.181.4 
InternalPort     : 80 
InternalRoutingDomainId  : {00000000-0000-0000-0000-000000000000} 
Active      : True 

從上面的輸出中似乎,即使容器取出未刪除靜態端口映射並仍然活躍。

但我用下面的命令刪除它。

PS C:\> Get-NetNatStaticMapping | ? ExternalPort -eq 80 | Remove-NetNatStaticMapping 

然後,只需重新啓動系統,錯誤消失了。

2

我有類似的錯誤。

$ docker --version 
Docker version 1.13.0-rc3, build 4d92237 
$ docker-compose -f .\docker-compose.windows.yml up 
Starting musicstore_db_1 

ERROR: for db Cannot start service db: {"message":"failed to create endpoint musicstore_db_1 on network nat: HNS failed with error : Unspecified error"} 
ERROR: Encountered errors while bringing up the project. 

靜態映射去除沒有工作,唯一的網絡去除幫助:

Get-ContainerNetwork -Name nat | Remove-ContainerNetwork 

在PowerShell中執行命令以管理員身份,然後重新啓動泊塢窗。


更新:

使用CleanupContainerHostNetworking.ps1腳本來解決多克爾17網絡問題。

.\CleanupContainerHostNetworking.ps1 -Cleanup -ForceDeleteAllSwitches 
相關問題