docker 更新到.NET 8后,容器在 Boot 过程中卡住

daupos2t  于 12个月前  发布在  Docker
关注(0)|答案(1)|浏览(171)

在成功地将应用程序(ASP.NET Core)更新到.NET 8并在本地运行(没有Docker容器)之后,我正在努力在Azure中使用容器。
容器无法 Boot 。它在特定的时间点卡住(参见日志),没有进一步的信息。当我在本地启动容器时也会发生这种情况。
有人经历过吗?我似乎找不到解决办法。
Dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
COPY publish .
ENTRYPOINT ["./Application"]

字符串
azure通过scm提供的日志:

2023-12-05T14:45:05.036017766Z [14:45:04 Warning] Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository
2023-12-05T14:45:05.037320672Z Storing keys in a directory '/root/ASP.NET/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
2023-12-05T14:45:05.037338772Z 
2023-12-05T14:45:05.315275542Z [14:45:05 Warning] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager
2023-12-05T14:45:05.315355042Z No XML encryptor configured. Key {a052ec83-e17e-4d70-8bcf-2537c7492700} may be persisted to storage in unencrypted form.
2023-12-05T14:45:05.315362542Z 
2023-12-05T14:45:05.382496649Z [14:45:05 Information] Application.Worker.CatalogChangedMessageProcessor
2023-12-05T14:45:05.382566849Z Refreshing catalog data
2023-12-05T14:45:05.382574549Z 
2023-12-05T14:45:08.077826368Z [14:45:08 Warning] Microsoft.EntityFrameworkCore.Model.Validation
2023-12-05T14:45:08.079457876Z The property 'OemCustomer.ClientApplicationIds' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly.
2023-12-05T14:45:08.079477476Z 
2023-12-05T14:45:14.160127997Z [14:45:14 Information] Application.Worker.CatalogChangedMessageProcessor
2023-12-05T14:45:14.160225699Z Refreshed catalog data
2023-12-05T14:45:14.160235499Z

yjghlzjz

yjghlzjz1#

问题是,现在默认情况下,Docker容器中的ASP.NET Core应用程序正在侦听端口8080。因此在应用服务本身上将WEBSITES_PORT更改或设置为8080,解决了这个问题。
默认情况下,Azure应用服务尝试使用端口80 ping docker-container。

相关问题