1

I am trying to run a .net application on AKS. I am building the image using a docker file and using a deployment file to deploy on aks from container registry. Its fails showing status as CrashLoopBackOff.

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

  • From the detail provided, it seems that this was already answered [here](https://stackoverflow.com/questions/41604499/my-kubernetes-pods-keep-crashing-with-crashloopbackoff-but-i-cant-find-any-lo). – xalves Aug 06 '21 at 11:20

1 Answers1

1

I had to change the port to 8080 and it worked after that . It seems we cannot use port 80 for a non root user

and made the following changes in docker file

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