簡體   English   中英

在 Azure web 應用程序中運行 docker 容器:未響應端口上的 HTTP ping

[英]Running a docker container in Azure web app: didn't respond to HTTP pings on port

我正在嘗試在 linux 操作系統中的 Azure web 應用程序上運行 docker 容器。 web 應用程序服務器成功拉取圖像但運行命令失敗並顯示錯誤消息:未響應端口 9000 上的 HTTP ping

2019-10-22 00:15:12.671 INFO  - Pulling image: finalproductionimg.azurecr.io/finalproductionimg:latest
2019-10-22 00:15:12.877 INFO  - latest Pulling from finalproductionimg
2019-10-22 00:15:12.878 INFO  -  Digest: sha256:5681b69c53e29b42d9c05c8ccf2e849ae19732ee671c5aae388a906c7bb23208
2019-10-22 00:15:12.878 INFO  -  Status: Image is up to date for finalproductionimg.azurecr.io/finalproductionimg:latest
2019-10-22 00:15:12.883 INFO  - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2019-10-22 00:15:12.891 INFO  - Starting container for site
2019-10-22 00:15:12.891 INFO  - docker run -d -p 26730:9000 --name brisk-dokerprod_0_3f1f06b3 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=Brisk-dokerprod -e WEBSITE_AUTH_ENABLED=False -e PORT=9000 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=brisk-dokerprod.azurewebsites.net -e WEBSITE_INSTANCE_ID=af378d6c8fb1477b346afda52f53f46802b9685f672a1a6b1e1dfb51b076f0a4 -e HTTP_LOGGING_ENABLED=1 finalproductionimg.azurecr.io/finalproductionimg:latest version: '3' services: web-prod: build: context: . dockerfile: Dockerfile-prod ports: - "80" - "9000" - "8080:9000" 

2019-10-22 00:15:13.492 INFO  - Initiating warmup request to container brisk-dokerprod_0_3f1f06b3 for site brisk-dokerprod
2019-10-22 00:15:13.640 ERROR - Container brisk-dokerprod_0_3f1f06b3 for site brisk-dokerprod has exited, failing site start
2019-10-22 00:15:13.642 ERROR - Container brisk-dokerprod_0_3f1f06b3 didn't respond to HTTP pings on port: 9000, failing site start. See container logs for debugging.

在我的 yml 文件中

ports:
      - "80"
      - "9000"
      - "8080:9000"

我錯過了什么?

This is a limitation of the Azure Web App, it only supports to expose the port 80 and 443. So when you want to expose other ports such as 9000 and 8080, then you got the error that it didn't respond to HTTP pings on那個港口。

感謝您的回答,基本上就是Charles Xu所說的。 為了解決這個問題,我剛剛在 Dockerfile 中暴露了端口 80 和 9000,最后在 Azure 應用程序設置中添加了兩個新變量,PORT=9000 和 WEBSITES_PORT=80。

Azure Web Apps 80和443端口限制解除:

https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux&tabs=debian#configure-port-number

Azure 命令行界面:

az webapp config appsettings set --resource-group <group-name> --name <app-name> --settings WEBSITES_PORT=8000

Azure Powershell:

Set-AzWebApp -ResourceGroupName <group-name> -Name <app-name> -AppSettings @{"WEBSITES_PORT"="8000"}

暫無
暫無

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

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