Open lbussell opened 4 months ago
Hi,
Thank you for the suggestion. We'll swap it over to use $APP_UID in 17.12.
We although need to keep APP in the base stage because we only build the base stage for fastmode in Visual Studio, and we want it to be set as the right user when we build it in fastmode.
Hello, I noticed a few inconsistencies between the .NET Docker Samples and the automatically-generated Dockerfile from Visual Studio.
First, the non-root user definition should use UID instead of the username, since the Kubernetes option
`runAsNonRoot
only works with UIDs: https://github.com/dotnet/dotnet-docker/issues/4506#issuecomment-1483424853Second, the non-root user definition should be as late in the Dockerfile as possible. This allows users to install additional packages if necessary without switching the user back to
root
.You can reference the dotnet-docker sample Dockerfile, or I've created a diff of how the Dockerfile should be changed below: