无法绑定端口80

时间:2019-05-02 12:15:57

标签: docker docker-compose

我正在使用docker compose运行一个我创建的简单Web服务器项目。这种配置已经运行了好几个月,但是在我两周没去办公室后突然停止了工作。

当我这样映射我的端口-8080:80时,它可以工作,但是我不想每次都键入8080端口。我使用netstat -a -n -o | findstr /c:80来查找侦听端口80的进程的进程ID,并使用tasklist /fi "pid eq 4"来查找进程的名称。

原来是一些系统过程,所以我不确定该怎么做。我已经卸载了Skype,并检查了World Wide Web Publishing服务是否未打开。是否有人对如何解决此问题有解释或想法?

谢谢。

更新

当我运行net stop http并杀死所有相关服务时,端口80是空闲的。正在停止的服务:Windows远程管理(WS-Management),SSDP发现,后台打印程序,BranchCache和HTTP。哪些可能是罪魁祸首?

更新2

我现在一个接一个地停止了这些服务,并且在停止了每个服务之后,BranchCache似乎对此负责。随后进行了更多测试

docker-compose.yml

version: "3"
services:
  vote-client:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "80:80"

Dockerfile

FROM nginx
COPY ./html /usr/share/nginx/html

当我运行docker-compose up时,这是我的输出:

docker-compose up --build
Removing vote-client_vote-client_1
Building vote-client
Step 1/2 : FROM nginx
 ---> 42b4762643dc
Step 2/2 : COPY ./html /usr/share/nginx/html
 ---> Using cache
 ---> a1aade2a299e
Successfully built a1aade2a299e
Successfully tagged vote-client_vote-client:latest
Recreating c2654f31dcff_vote-client_vote-client_1 ... error

ERROR: for c2654f31dcff_vote-client_vote-client_1  Cannot start service vote-client: driver failed programming external connectivity on endpoint vote-client_vote-client_1 (2188c8607a04ba2388a661504601431d6b30825d595dafae0c318f2d2b5685b0): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error Permission denied

ERROR: for vote-client  Cannot start service vote-client: driver failed programming external connectivity on endpoint vote-client_vote-client_1 (2188c8607a04ba2388a661504601431d6b30825d595dafae0c318f2d2b5685b0): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error Permission denied
ERROR: Encountered errors while bringing up the project.

0 个答案:

没有答案