更新时间:2023-10-20 23:09:58
因为这会带来大量流量,所以我添加了完成此操作所需的完整详细代码.
Because this gets so much traffic, I'm adding the fully detailed code that you need to get this done.
# Create a group and user so we are not running our container and application as root and thus user 0 which is a security issue.
RUN addgroup --system --gid 1000 customgroup \
&& adduser --system --uid 1000 --ingroup customgroup --shell /bin/sh customuser
# 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
# Tell docker that all future commands should run as the appuser user, must use the user number
USER 1000