Running Docker for Windows, Error when exposing Ports

docker error response from daemon: ports are not available
docker localhost refused to connect windows
docker port mapping
/forwards/expose/port returned unexpected status: 500
docker run
error response from daemon: driver failed programming external connectivity on endpoint
docker windows port not exposed
ports are not available docker

I am aware there are a lot of questions about running Docker on windows, however this question is about running the brand new Docker for Windows, on Windows. In my case I am using Windows 10 Pro 64 bit. According to the site this version should be supported. I have been following a tutorial I found here: https://prakhar.me/docker-curriculum/ I also tried following the official guide of course: https://docs.docker.com/docker-for-windows/

In both tutorials I get the same error message when trying to assign a port using either the -P parameter or when trying to specify a port -p 8080:5000:

In the official guide I run docker run -d -p 80:80 --name webserver nginx and get:

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint webserver (f9946544e4c6ad2dd9cb8cbccd251e4d48254e86562bd8e6da75c3bd42c7e45a): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:80:tcp:172.17.0.2:80: input/output error.

Following the unofficial guide i run docker run -p 8888:5000 prakhar1989/catnip and get basically the same error:

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint focused_swartz (48a0c005779c6e89bf525ead2ecff44a7f092495cd22ef7d19973002963cb232): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8888:tcp:172.17.0.2:5000: input/output error.

If I don't try to assign a port the container will run, but then I don't know how to access it.

The docker version I am running:

  • Docker version 1.12.3, build 6b644ec`
  • docker-compose version 1.8.1, build 004ddae`
  • docker-machine.exe version 0.8.2, build e18a919`

Any help would be very appreciated. Thank you.


This is caused by a port numbering conflict: github issue here https://github.com/docker/compose/issues/3277

Essentially the port is in use! The reason resetting worked is because it wiped other mappings off.

Docker for windows error: while exposing Ports, After lots of trial and error, I discovered that Docker for Windows and I run lots of containers and setups that other people at my company work on "Expose daemon on tcp://localhost:2375 without TLS" option works only for  I run docker run -d -p 80:80 --name webserver nginx and get the following error: C:\Program access it. Can anyone help me out with this error? 17386/docker-for-windows-error-while-exposing-ports


Here's a new twist.

The last Windows 10 update (Fall Creators Update, 2017) has a new "feature". It automatically starts any applications that were running when you last shutdown.

This reconstitutes Docker for Windows in a bad state. That made it appear those ports were in use by something else - it was the ghost of itself. This explained why those ports were still in use even though I stopped/started my containers and even reboot!

The solution in this case is to simply restart Docker daemon.

To prevent this after the next shutdown, don't use the shutdown button. Type this instead:

shutdown /s /t 0

This bypasses the new feature.

See the answer from Jason[MS] in this thread:

https://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_perf-insiderplat_pc/programs-autostart-after-boot-in-windows-10-fall/09dd8d3e-7b36-45d1-9181-6587dd5d53ab

Here's one guy's workaround (from the end of this thread - haven't tried it myself):

http://www.icttoolbox.nl/info/stop-windows-10-creator-fall-reopening-programs-reboot/

Unable to bind ports: Docker-for-Windows & Hyper-V excluding but , Expected behavior Using a simple example of the FROM microsoft/iis and EXPOSE 8000 as shown in the samples, this type of command runs,  I've reading docker API and trying to create a simple container and expose 1 port.. In my example, I have an application that listen on TCP port 9595 inside the container and I want to access it from outside world (i.e. the host of the container) on port 9090.


Restarting the Docker daemon fixes this problem temporarily, but to get rid of it ultimately I had to disable Windows 10 fast startup, which is the feature @biscuit314 described.

To disable Windows 10 fast startup, get to the Control Panel > Power Options > Choose what the power buttons do > Change settings that are currently unavailable > Uncheck Turn on fast startup (recommended) and hit Save changes

Docker for windows is not mapping ports to localhost · Issue #204 , Expected behavior When I run a simple docker as follows: docker run --name redis.local -p Unable to bind to high port numbers like 50000 on Windows #​3188 No error shown if docker containers aren't running #200. How to expose docker ports during container creation. Exposing Docker ports can be done using the ‘-p’ option with ‘docker run’ command to bind the port when launching the container: docker run -d -p 9090:80 -t nginx. This command will create a container with the image ‘nginx’ and bind the container’s port 80 to the host machine


1) Stop all the running containers docker stop $(docker ps -a -q) then

2) Stop the Docker on your machine & restart it.

Then run the required command. This will solve the issue.

Docker for windows loses the ability to bind to localhost (0.0.0.0 , wordup install error: ssmtp has no installation candidate #7 I think for each port specified to be exposed for a container docker starts a  Docker for windows is not mapping ports to localhost #204. panmanphil opened this issue on Nov 4, 2016 · 78 comments. area/network area/wincon status/0-triage. panmanphil commented on Nov 4, 2016. Expected behavior. Using a simple example of the FROM microsoft/iis and EXPOSE 8000 as shown in the samples, this type of command runs, and I can


If its in windows OS, Please do restart the Docker This has fixed the issue for me

Error starting userland proxy: mkdir /port/tcp:0.0.0.0:80:tcp , Docker for Windows (1.12.0-rc3-beta18 b 5193) returns an error when I try to run a container with -p argument. λ docker run -d  Your port mapping is 8080-8081 and you're trying to connect to localhost:8080 on your windows machine. You need to go inside your docker container and curl to localhost:8081 or from your windows machine curl to your hostname:8080. You can get your hostname in windows running.


Expose container ports on localhost not working, --publish-all , -P, Publish all exposed ports to random ports If the file exists already, Docker will return an error. PS C:\> docker run -v c:\foo:c:\dest microsoft/nanoserver cmd /s /c type c:\dest\somefile.txt Contents of file PS C:\> docker run  When you run a container with the -p argument, for example: $ docker run -p 80:80 -d nginx. Docker Desktop makes whatever is running on port 80 in the container (in this case, nginx) available on port 80 of localhost. In this example, the host and container ports are the same.


docker run, Next, when docker ps was run, you saw that port 5000 in the container was bound Docker also defines a set of environment variables for each port exposed by  Build and Run Your First Windows Server Container (Blog Post) gives a quick tour of how to build and run native Docker Windows containers on Windows 10 and Windows Server 2016 evaluation releases. Getting Started with Windows Containers (Lab) shows you how to use the MusicStore application with Windows containers.


Legacy container links, Install Docker Desktop for Windows/Mac. If not using You can either configure your container to always expose these ports or just forward them temporarily. To expose Docker ports and bind them while starting a container with docker run you should use -p option with the following Docker commands: docker run -d -p 9090:80 -t nginx. This will create NGINX container and bind it’s internal 80 port to the Docker machines 9090. Check it out with docker ps command: Use docker inspect command to view