【Azure 应用服务】使用Docker Compose创建App Service遇见"Linux Version is too long. It cannot be more than 4000 characters"错误

问题描述

使用Docker Compose方式合并多个镜像(Images)文件,然后部署到App Service中,结果失败。报错 Linux Version 太长,不能超过4000个字符。

错误消息:

{

"code":"DeploymentFailed",

"message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.",

"details":[

{"message":"Linux Version is too long. It cannot be more than 4000 characters."}

]

}

 

问题解答

这是因为App Service 会把 Docker compose.yml 文件中的内容以Base64格式编码后,赋值给Linux Version。而Linux Version的长度限制为4000个, 这是App Service For Linux平台限制,无法修改。

代替方案

可以使用方案有:

1)精简 Docker Compose.yaml 文件,把其中App Service不支持的指令或无关紧要的内容移除。App Service不支持的选项有:https://docs.azure.cn/zh-cn/app-service/configure-custom-container?pivots=container-linux&tabs=debian#docker-compose-options

2)使用 AKS(Azure Kubernetes Service) 服务 : https://docs.azure.cn/zh-cn/aks/tutorial-kubernetes-prepare-app

3)使用 ACI (Azure Container Instance) 服务 : https://learn.microsoft.com/en-us/azure/container-instances/tutorial-docker-compose

 

参考资料

Create Docker Comose App: https://learn.microsoft.com/en-us/azure/app-service/quickstart-multi-container#create-a-docker-compose-app

 

posted @   路边两盏灯  阅读(86)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2021-04-06 【Azure Redis 缓存】Redis的监控方式? 是否有API接口调用来获取监控值
2021-04-06 【Azure 批处理 】Azure Batch门户中创建自定义作业模式失败解决办法
2021-04-06 【Azure 应用程序见解】在Docker中运行的ASP.NET Core应用如何开启Application Insights的Profiler Trace呢? 
点击右上角即可分享
微信分享提示