Docker on Windows 10 "driver failed programming external connectivity on endpoint"

WindowsGithubWindows 10Docker Compose

Windows Problem Overview


I am trying to use $ docker-compose up -d for a project and am getting this error message:

>ERROR: for api Cannot start service api: driver failed programming external connectivity on endpoint dataexploration_api_1 (8781c95937a0a4b0b8da233376f71d2fc135f46aad011401c019eb3d14a0b117): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:9000:tcp:172.19.0.2:80: input/output error Encountered errors while bringing up the project.

I am wondering if it is maybe the port? I had been trying port 8080 previously. The project was originally set up on a mac and I have cloned the repository from gitHub.

Windows Solutions


Solution 1 - Windows

I got the same error message on my Windows 10 Pro / Docker v17.06.1-ce-win24 / Docker-Compose v1.14.0 using Windows Powershell x86 in admin mode.

The solution was to simply restart Docker.

Solution 2 - Windows

If happens once, restarting Docker will do the work. In my case, it was happening every time that I restarted my computer.

In this case, [disable Fast Startup][1], or you probably will restart Docker every time that your computer starts. This solution was obtained from [here][2]

[1]: https://www.howtogeek.com/243901/the-pros-and-cons-of-windows-10s-fast-startup-mode/ "disable Fast Startup" [2]: https://github.com/docker/for-win/issues/1038 "here"

Solution 3 - Windows

Simply restaring Docker didn't fix the problem for me on Windows 10.

In my case, I resolved the problem with the exact steps below:

  1. Close "Docker Desktop"

  2. Run the commands below:

    net stop com.docker.service net start com.docker.service

  3. Launch "Docker Desktop" again

Hope this will help someone else.

Solution 4 - Windows

I got that error too, if you want to know the main reason why error happens, its because docker is already running a similar container, to resolve the problem( avoid restarting Docker), you must:

docker container ls

You got something similar to:

CONTAINER ID        IMAGE               COMMAND             CREATED
1fa4ab2cf395        friendlyhello       "python app.py"     28 seconds ago

This is a list of the running containers, take the CONTAINER ID (copy Ctrl+C)

Now you have to end the process (and let run another image) run this command.

docker container stop <CONTAINER_ID>

And thats all! Now you can create the container.

For more information, visit https://docs.docker.com/get-started/part2/

Solution 5 - Windows

Normally this error happens when you are trying start a container but the ports that the container needs are occuppied, usually by the same Docker like a result of an latest bad process to stop.

For me the solution is:

  1. Open windows CMD like administrator, type netstat -oan to find the process (Docker is the that process) that is occuppying your port:

In my case my docker ports are 3306 6001 8000 9001.

  1. Now we need free that ports, so we go to kill this process by PID (colum PID), type

     TASKKILL /PID 9816 /F
    
  2. Restart docker.

  3. Be happy.

Regards.

Solution 6 - Windows

I am aware there are already a lot answers, but none of them solved the problem for me.
Instead, I got rid of this error message by resetting docker to factory defaults:

enter image description here

Solution 7 - Windows

In my case, the problem was that the docker container (Nginx) uses 80 port, and IIS uses the same. Setting up another port in IIS solve problem

Solution 8 - Windows

In most case, the first case you should think about is there is an old service running and using that port. In my case, since I change the image name, then when using docker-compose to stop (then up), it won't stop old container (service), lead to the new container can not be started.

Solution 9 - Windows

A bit of a late answer but I will leave it here it might help someone else On a Mac mojave after a lot of restarts of both mac and docker I had to sudo apachectl stop.

Solution 10 - Windows

The simplest way to solve this is Restarting the docker. But in some cases it might not work even though you don't have any containers that are running in the port.You can check the running containers using docker ps command and can see all the containers that were not cleared but exited before using docker ps -a command.

Imagine there is a container which has the container id 8e35276e845e.You can use the command docker rm 8e35276e845e or docker rm 8e3 to end the container.Note that the first 3 strings are the id of that particular docker container id. Thus according to the above scenario 8e3 is the id of 8e35276e845e.

If restarting doesn't work you can try changing the ports of the services in the docker-compose.yml file and according to the apache port you have to change the port of the v-host(if there's any).This will resolve your problem.

Ex:

    build:
      context: ./apache
      dockerfile: Dockerfile
    working_dir: /var/www/
    volumes:
      - .:/var/www
    networks:
      - app-network
    ports:
      - 8082:80
    depends_on:
      - mysql_db

should be changed into

apache_server:
    build:
      context: ./apache
      dockerfile: Dockerfile
    working_dir: /var/www/
    volumes:
      - .:/var/www
    networks:
      - app-network
    ports:
      - 8083:80
    depends_on:
      - mysql_db

and the particular v-host also has to be changed,

Ex(according to the above scenario):

<VirtualHost *:80> 
	ProxyPreserveHost On
	ServerAlias phpadocker.lk
	ProxyPass / http://localhost:8083/
	ProxyPassReverse / http://localhost:8083/
</VirtualHost>

This will help you to solve the above problem.

Solution 11 - Windows

For many windows users out there that have the same issue I would suggest to restart the computer also, because most of the times (for me at least) restarting just Docker doesn't work. So, I would suggest you follow the following steps:

  1. Restart your pc.

  2. Then Start up your PowerShell as admin and run this:

    Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private

  3. After that restart your Docker.

After completing these steps you will be able to run without problems. I hope that helps.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSockness_RogersView Question on Stackoverflow
Solution 1 - WindowsJens Christian EldøyView Answer on Stackoverflow
Solution 2 - WindowschompView Answer on Stackoverflow
Solution 3 - WindowsMohammed Réda OUASSINIView Answer on Stackoverflow
Solution 4 - WindowsAndres RodriguezView Answer on Stackoverflow
Solution 5 - WindowsJhon Didier SottoView Answer on Stackoverflow
Solution 6 - WindowsjasieView Answer on Stackoverflow
Solution 7 - WindowsАртур КамильяновView Answer on Stackoverflow
Solution 8 - WindowsPhuoc Quach ngocView Answer on Stackoverflow
Solution 9 - WindowsTarekView Answer on Stackoverflow
Solution 10 - WindowsHiruminaView Answer on Stackoverflow
Solution 11 - WindowsDonald ShahiniView Answer on Stackoverflow