gpt4 book ai didi

azure - 尝试以非 root 用户身份运行时 AKS crashloopbackoff

转载 作者:行者123 更新时间:2023-12-03 02:21:28 25 4
gpt4 key购买 nike

我正在尝试在 AKS 上运行 .net 应用程序。我正在使用 docker 文件构建镜像,并使用部署文件从容器注册表部署到 aks 上。它无法将状态显示为 CrashLoopBackOff。

docker file with user and group creation security context details in deployment.yaml file

最佳答案

我必须将端口更改为 8080,之后它就可以工作了。看来我们不能为非 root 用户使用端口 80

并在 docker 文件中进行了以下更改

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
RUN addgroup --system --gid 1000 custom-group && adduser --system --uid 1000 --ingroup custom-group --shell /bin/sh customuser
USER 1000
WORKDIR /app

#Serve on port 8080, we cannot serve on port 80 with a custom user that is not root
ENV ASPNETCORE_URLS http://+:8080
EXPOSE 8080

关于azure - 尝试以非 root 用户身份运行时 AKS crashloopbackoff,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68680510/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com