【Azure 应用服务】App Server 部署后,Docker报错,找不到8080端口

简介: 【Azure 应用服务】App Server 部署后,Docker报错,找不到8080端口

问题描述

App Service for Container.  Docker Image 推送到ACR(向 Azure 容器注册表), 配置App Service并部署成功了。查看Docker日志(Log Stream页面)详情如下:

/home/LogFiles/2021_09_06_ll0sddwk000002_docker.log  (https://mytestappservice.scm.chinacloudsites.cn/api/vfs/LogFiles/2021_09_06_ll0sddwk000002_docker.log)
2021-09-06T03:28:44.786Z INFO  - Starting container for site
2021-09-06T03:28:44.787Z INFO  - docker run -d -p 8080:8080 --name mytestappservice_1_028b2421 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=mytestappservice -e WEBSITE_AUTH_ENABLED=False -e PORT=8080 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=mytestappservice.chinacloudsites.cn -e WEBSITE_INSTANCE_ID=35a46b817ece1fe1cb77c89f27ac5f991e8f7d4f86abe5add36a6d6afb3f9989 myacrtest01.azurecr.cn/myacrr01/backendapi:latest  
2021-09-06T03:28:44.788Z INFO  - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2021-09-06T03:28:49.314Z INFO  - Initiating warmup request to container mytestappservice_1_028b2421 for site mytestappservice
2021-09-06T03:29:20.005Z INFO  - Waiting for response to warmup request for container mytestappservice_1_028b2421. Elapsed time = 30.6914685 sec
2021-09-06T03:29:25.092Z ERROR - Container mytestappservice_1_028b2421 for site mytestappservice has exited, failing site start
2021-09-06T03:29:25.107Z ERROR - Container mytestappservice_1_028b2421 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2021-09-06T03:29:25.127Z INFO  - Stopping site mytestappservice because it failed during startup.

 

问题解决

对于自定义容器,App Service默认会尝试对端口 80 和 8080 进行自动端口检测, 而这里出现了HTTP ping 8080 failed,可以检测在Dockerfile中是否已经配置使用了8080端口。如果有,则从Dockerfile中修改,或者是通过App Service的Application Setting配置 WEBSITES_PORT参数,指定非8080的值,如WEBSITES_PORT = 8081。以解决问题。

 

 

更多有用有效的App Service for Container配置值,见:https://docs.microsoft.com/zh-cn/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#custom-containers

 

 

参考资料

将应用服务配置为从注册表部署映像: https://docs.microsoft.com/zh-cn/azure/app-service/tutorial-custom-container?pivots=container-linux#configure-app-service-to-deploy-the-image-from-the-registry

自定义容器配置参数名:https://docs.microsoft.com/zh-cn/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#custom-containers

 

相关文章
|
10天前
|
JavaScript C++ 容器
【Azure Bot Service】部署NodeJS ChatBot代码到App Service中无法自动启动
2024-11-12T12:22:40.366223350Z Error: Cannot find module 'dotenv' 2024-11-12T12:40:12.538120729Z Error: Cannot find module 'restify' 2024-11-12T12:48:13.348529900Z Error: Cannot find module 'lodash'
34 11
|
8天前
|
开发框架 监控 .NET
【Azure App Service】部署在App Service上的.NET应用内存消耗不能超过2GB的情况分析
x64 dotnet runtime is not installed on the app service by default. Since we had the app service running in x64, it was proxying the request to a 32 bit dotnet process which was throwing an OutOfMemoryException with requests >100MB. It worked on the IaaS servers because we had the x64 runtime install
|
17天前
|
C#
【Azure App Service】使用Microsoft.Office.Interop.Word来操作Word文档,部署到App Service后报错COMException
System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (0x80040154 (REGDB_E_CLASSNOTREG)).
|
24天前
|
机器人 Shell Linux
【Azure Bot Service】部署Python ChatBot代码到App Service中
本文介绍了使用Python编写的ChatBot在部署到Azure App Service时遇到的问题及解决方案。主要问题是应用启动失败,错误信息为“Failed to find attribute 'app' in 'app'”。解决步骤包括:1) 修改`app.py`文件,添加`init_func`函数;2) 配置`config.py`,添加与Azure Bot Service认证相关的配置项;3) 设置App Service的启动命令为`python3 -m aiohttp.web -H 0.0.0.0 -P 8000 app:init_func`。
|
1月前
|
JSON 小程序 JavaScript
uni-app开发微信小程序的报错[渲染层错误]排查及解决
uni-app开发微信小程序的报错[渲染层错误]排查及解决
482 7
|
1月前
|
小程序 JavaScript 前端开发
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
uni-app开发微信小程序:四大解决方案,轻松应对主包与vendor.js过大打包难题
531 1
|
18天前
|
小程序 数据挖掘 UED
开发1个上门家政小程序APP系统,都有哪些功能?
在快节奏的现代生活中,家政服务已成为许多家庭的必需品。针对传统家政服务存在的问题,如服务质量不稳定、价格不透明等,我们历时两年开发了一套全新的上门家政系统。该系统通过完善信用体系、提供奖励机制、优化复购体验、多渠道推广和多样化盈利模式,解决了私单、复购、推广和盈利四大痛点,全面提升了服务质量和用户体验,旨在成为家政行业的领导者。
|
1月前
|
JavaScript 前端开发 小程序
uniapp一个人开发APP关键步骤和考虑因素
uniapp一个人开发APP关键步骤和考虑因素
122 1
uniapp一个人开发APP关键步骤和考虑因素
|
1月前
|
JavaScript 前端开发 UED
Vue与uni-app开发中通过@font-face巧妙引入自定义字体
Vue与uni-app开发中通过@font-face巧妙引入自定义字体
71 9
|
1月前
|
缓存 小程序 索引
uni-app开发微信小程序时vant组件van-tabs的使用陷阱及解决方案
uni-app开发微信小程序时vant组件van-tabs的使用陷阱及解决方案
190 1