The Windows console did not start with the error, "Failed to create the endpoint on the nat network: HNS failed: failed to create the endpoint."

I tried Windows containers on Windows Server 2016 TP5. Suddenly, I started getting an error message when starting the container with the -p 80:80ports parameter-p 80:80

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.

I made sure that the other container is not running and that port 80 on the host machine is not used by any other services.

Has anyone encountered the same problem?

+5
source share
4 answers

github. , Windows Windows TP5.

,

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

, .

+10

:

Stop-Service docker
Get-ContainerNetwork | Remove-ContainerNetwork
Get-NetNat | Remove-NetNat
Get-VMSwitch | Remove-VMSwitch
Start-Service docker

( JMesser81 : https://github.com/Microsoft/Virtualization-Documentation/issues/273)

+5

.

$ 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 , Docker.


Update:

CleanupContainerHostNetworking.ps1 script Docker 17.

.\CleanupContainerHostNetworking.ps1 -Cleanup -ForceDeleteAllSwitches
+3

docker docker-compose, Centos. , Windows Server 2016:

  1. Docker, nat, Docker.

    ps>stop-service docker
    ps>Get-ContainerNetwork | Remove-ContainerNetwork -Force -ea SilentlyContinue
    ps>start-service docker   
    
  2. docker-compose.yml

    version: '3.7'
    networks:
      default:
        external:
          name: nat    
    

!

0

All Articles