Docker Community Forums

Share and learn in the Docker community.

Unable to map ports to container

Expected behavior

Running any container with the -p flag allows a container to run with the port allocated.

Actual behavior

Container fails to start and results in error “Error response from daemon: failed to create endpoint reverent_clarke on network nat: HNS failed with error : Unspecified error.”


Unable to start any container when allocating ports to them. Containers are able to start when no port is specified. I have reinstalled docker multiple times and have checked that the ports being specified are not in use. attempted to delete File and restart both the hns service and docker but to no avail. firewalls have been deactivated while testing.

  • the output of:

    • DockerDebugInfo.ps1 - not recognized name of a cmdlet
  • Docker Version output:

      Client: Docker Engine - Enterprise
      Version:           19.03.5
      API version:       1.40
      Go version:        go1.12.12
      Git commit:        2ee0c57608
      Built:             11/13/2019 08:00:16
      OS/Arch:           windows/amd64
      Experimental:      false
     Server: Docker Engine - Enterprise
       Version:          19.03.5
       API version:      1.40 (minimum version 1.24)
       Go version:       go1.12.12
       Git commit:       2ee0c57608
       Built:            11/13/2019 07:58:51
       OS/Arch:          windows/amd64
       Experimental:     false
  • Docker info output:

     Debug Mode: false
      cluster: Manage Docker clusters (Docker Inc., v1.2.0)
     Containers: 83
      Running: 23
      Paused: 0
      Stopped: 60
     Images: 28
     Server Version: 19.03.5
     Storage Driver: windowsfilter
     Logging Driver: json-file
      Volume: local
      Network: ics internal l2bridge l2tunnel nat null overlay private transparent
      Log: awslogs etwlogs fluentd gcplogs gelf json-file local logentries splunk syslog
     Swarm: inactive
     Default Isolation: process
     Kernel Version: 10.0 14393 (14393.3686.amd64fre.rs1_release.200504-1524)
     Operating System: Windows Server 2016 Datacenter Version 1607 (OS Build 14393.3686)
     OSType: windows
     Architecture: x86_64
     CPUs: 8
     Total Memory: 32GiB
     Name: AMSAS420
     Docker Root Dir: C:\ProgramData\docker
     Debug Mode: false
     Experimental: false
     Insecure Registries:
     Live Restore Enabled: false
  • Environment
    • Windows Server 2016 Datacenter

Steps to reproduce the behavior

  1. …Run Container with -p flag e.g docker run -p 81:81 hello-world:nanoserver-sac2016