【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

 

相关文章
|
15天前
|
网络协议 容器
【Container App】部署Contianer App 遇见 Failed to deploy new revision: The Ingress's TargetPort or ExposedPort must be specified for TCP apps.
Failed to deploy new revision: The Ingress's TargetPort or ExposedPort must be specified for TCP apps.
54 27
|
2月前
|
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'
48 11
|
2月前
|
开发框架 监控 .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
|
2月前
|
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)).
|
6月前
|
弹性计算 应用服务中间件 Linux
阿里云服务器开放端口完整图文教程
笔者近期开发完成的服务端程序部署在阿里云的ECS云服务器上面,一些应用程序配置文件需要设置监听的端口(如Tomcat的8080、443端口等),虽然通过CentOs 7系统的的「防火墙」开放了对应的端口号,任然无法访问端口号对应的应用程序,后面了解到原来还需要设置云服务器的「安全组规则」,开放相应的端口权限,服务端的接口才能真正开放。
765 1
|
6月前
|
弹性计算 运维 数据安全/隐私保护
云服务器 ECS产品使用问题之如何更改服务器的IP地址或端口号
云服务器ECS(Elastic Compute Service)是各大云服务商阿里云提供的一种基础云计算服务,它允许用户租用云端计算资源来部署和运行各种应用程序。以下是一个关于如何使用ECS产品的综合指南。
|
6月前
|
网络协议 Linux Unix
面试官:服务器最大可以创建多少个tcp连接以及端口并解释下你对文件句柄的理解
面试官:服务器最大可以创建多少个tcp连接以及端口并解释下你对文件句柄的理解
160 0
面试官:服务器最大可以创建多少个tcp连接以及端口并解释下你对文件句柄的理解
|
5月前
|
缓存 NoSQL 网络安全
【Azure Redis 缓存】使用开源工具redis-copy时遇见6379端口无法连接到Redis服务器的问题
【Azure Redis 缓存】使用开源工具redis-copy时遇见6379端口无法连接到Redis服务器的问题
|
5月前
|
网络协议
【qt】TCP的监听 (设置服务器IP地址和端口号)
【qt】TCP的监听 (设置服务器IP地址和端口号)
304 0
|
6月前
|
存储 安全 网络安全
服务器设置了端口映射之后外网还是访问不了服务器
服务器设置了端口映射之后外网还是访问不了服务器