Windows 10 上的 Docker“驱动程序在端点上编程外部连接失败”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44414130/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Docker on Windows 10 "driver failed programming external connectivity on endpoint"
提问by Sockness_Rogers
I am trying to use $ docker-compose up -d
for a project and am getting this error message:
我正在尝试$ docker-compose up -d
用于项目并收到此错误消息:
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.
错误:对于 api 无法启动服务 api:驱动程序在端点 dataexploration_api_1 上编程外部连接失败(8781c95937a0a4b0b8da233376f71d2fc135f46aad011401c019eb3d14a0b117):错误启动用户空间代理:m0cp090t20.0t2.0t20:cp090t20:cp090t20.0t20.000000000启动项目时遇到错误。
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.
我想知道它是否可能是端口?我之前一直在尝试端口 8080。该项目最初是在 mac 上设置的,我已经从 gitHub 克隆了存储库。
回答by Jens Christian Eld?y
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.
我在 Windows 10 Pro / Docker v17.06.1-ce-win24 / Docker-Compose v1.14.0 上使用 Windows Powershell x86 在管理模式下收到相同的错误消息。
The solution was to simply restart Docker.
解决方案是简单地重新启动 Docker。
回答by chomp
If happens once, restarting Docker will do the work. In my case, it was happening every time that I restarted my computer.
如果发生一次,重新启动 Docker 将完成工作。就我而言,每次重新启动计算机时都会发生这种情况。
In this case, disable Fast Startup, or you probably will restart Docker every time that your computer starts. This solution was obtained from here
在这种情况下,禁用 Fast Startup,否则您可能会在每次计算机启动时重新启动 Docker。这个解决方案是从这里获得的
回答by Mohammed Réda OUASSINI
Simply restaring Docker didn't fix the problem for me on Windows 10.
简单地重新启动 Docker 并不能解决我在 Windows 10 上的问题。
In my case, I resolved the problem with the exact steps below:
就我而言,我通过以下确切步骤解决了问题:
1) Close "Docker Desktop"
1) 关闭“Docker 桌面”
2) Run the commands below:
2)运行以下命令:
net stop com.docker.service
net start com.docker.service
3) Launch "Docker Desktop" again
3) 再次启动“Docker 桌面”
Hope this will help someone else.
希望这会帮助别人。
回答by Andres Rodriguez
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 已经在运行一个类似的容器,要解决这个问题(避免重新启动 Docker),你必须:
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)
这是正在运行的容器列表,取 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/
回答by jasie
回答by Jhon Didier Sotto
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.
通常,当您尝试启动容器但容器所需的端口已被占用时,通常会发生此错误,通常是由同一个 Docker 造成的,例如由于最新的错误进程停止。
For me the solution is:
对我来说,解决方案是:
- Open windows CMD like administrator, type
netstat -oan
to find the process (Docker is the that process) that is occuppying your port:
- 像管理员一样打开windows CMD,输入
netstat -oan
找到占用你端口的进程(Docker就是那个进程):
In my case my docker ports are 3306 6001 8000 9001.
就我而言,我的 docker 端口是 3306 6001 8000 9001。
Now we need free that ports, so we go to kill this process by PID (colum PID), type
TASKKILL /PID 9816 /F
Restart docker.
- Be happy.
现在我们需要释放这些端口,所以我们通过 PID(列 PID)来终止这个进程,输入
TASKKILL /PID 9816 /F
重新启动泊坞窗。
- 要开心。
Regards.
问候。
回答by Артур Камильянов
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
就我而言,问题在于 docker 容器(Nginx)使用 80 端口,而 IIS 使用相同的端口。在IIS中设置另一个端口解决问题
回答by Phuoc Quach ngoc
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.
在大多数情况下,您应该考虑的第一种情况是有一个旧服务正在运行并使用该端口。就我而言,由于我更改了映像名称,因此在使用 docker-compose 停止(然后启动)时,它不会停止旧容器(服务),导致无法启动新容器。
回答by Donald Shahini
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:
对于许多有相同问题的 Windows 用户,我建议也重新启动计算机,因为大多数情况下(至少对我而言)仅重新启动 Docker 是行不通的。因此,我建议您按照以下步骤操作:
- Restart your pc.
Then Start up your PowerShell as admin and run this:
Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private
After that restart your Docker.
- 重启你的电脑。
然后以管理员身份启动 PowerShell 并运行:
Set-NetConnectionProfile -interfacealias "vEthernet (DockerNAT)" -NetworkCategory Private
之后重启你的 Docker。
After completing these steps you will be able to run without problems. I hope that helps.
完成这些步骤后,您将能够毫无问题地运行。我希望这有帮助。
回答by Hirumina
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 usingdocker ps -a
command.
解决此问题的最简单方法是重新启动 docker。但是在某些情况下,即使您没有任何在端口中运行的容器,它也可能不起作用。您可以使用
docker ps
命令检查正在运行的容器,并可以看到所有在使用docker ps -a
命令之前未被清除但退出的容器。
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 8e3is the id of 8e35276e845e.
假设有一个容器,其容器 id 为8e35276e845e
。您可以使用命令docker rm 8e35276e845e
或docker rm 8e3
结束容器。请注意,前 3 个字符串是该特定 docker 容器 id 的 id。因此,根据上述场景8E3是的id 8e35276e845e。
If restarting doesn't work you can try changing the ports of the services in the docker-compose.ymlfile 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.
如果重新启动不起作用,您可以尝试更改docker-compose.yml文件中服务的端口,并根据 apache 端口更改 v-host 的端口(如果有)。这将解决您的问题问题。
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,
并且特定的 v-host 也必须更改,
Ex(according to the above scenario):
Ex(根据上述场景):
<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.
这将帮助您解决上述问题。