USER — Set Runtime User
DK · Dockerfilesyntax
USER <username>[:<group>]example
RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser
USER appuserNote All subsequent RUN, CMD, and ENTRYPOINT instructions run as this user. Running as root in production is a security risk — always create and switch to a non-root user for the final stage.