簡體   English   中英

Docker nginx 端口不可用

[英]Docker nginx ports are not available

我正在嘗試在 docker 上使用 nginx 為 windows 使用

docker container run --publish 80:80 nginx

它收到如下錯誤:

C:\Program Files\Docker\Docker\resources\bin\docker.exe: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

誰能給我解決方案......

如您所見,錯誤很明顯Ports are not available: listen tcp 0.0.0.0:80:因為端口已被占用。 你有兩個選擇

  • 殺死占用端口的進程,然后運行容器
  • 為 Nginx contianer 發布不同的端口然后80
 container run --publish 81:80 nginx then localhost:81

現在打開 http://localhost:81 應該可以工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM