<p>Consider a Dockerfile that uses the <a href="https://docs.docker.com/engine/reference/builder/#user" rel="nofollow noreferrer">USER</a> instruction for example</p>

<pre><code>FROM adoptopenjdk:11-jre-hotspot as builder
WORKDIR application
ARG JAR_FILE=build/libs/*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

FROM adoptopenjdk:11-jre-hotspot
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/application/ ./
VOLUME /tmp
EXPOSE 8080
USER nobody
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
</code></pre>

<p>When Kuberenets runs the docker image does it respect the USER instruction or does it ignore it?</p>

<p>If the user does not exist in the K8s cluster does K8s create the user? </p>

ams
<p>Yes, it does. That's an important feature when securing containers (although using <code>gosu</code> or a similar tool would provide similar security).</p>
