title: Error: "user" directive makes sense only if the master process runs with super-user privileges
body: <p>Hi I am getting the following errors as I try to implement a new user in my dockerfile rather than using the root user.</p>
  <pre><code>2020-10-16T09:28:04.554363522Z nginx: [warn] the &quot;user&quot; directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:5
  2020-10-16T09:28:04.564383012Z nginx: [emerg] mkdir() &quot;/var/lib/nginx/tmp/client_body&quot; failed (13: Permission denied)
  2020-10-16T09:28:06.882365055Z nginx: [warn] the &quot;user&quot; directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:5
  2020-10-16T09:28:06.891084727Z nginx: [emerg] mkdir() &quot;/var/lib/nginx/tmp/client_body&quot; failed (13: Permission denied)
  2020-10-16T09:28:09.331807870Z nginx: [warn] the &quot;user&quot; directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:5
  2020-10-16T09:28:09.342560643Z nginx: [emerg] mkdir() &quot;/var/lib/nginx/tmp/client_body&quot; failed (13: Permission denied)
  </code></pre>
  <p>Below is the following dockerfile that I have created. I have created a new called api-gateway, however, when I build my docker image and run the container I get the above errors.</p>
  <p>Any suggestions to what changes I need to implement to get the user working instead of root user?</p>
  <pre><code>USER root
  RUN microdnf --setopt=tsflags=nodocs install -y nginx procps shadow-utils net-tools ca-certificates dirmngr gnupg wget vim\
              &amp;&amp; microdnf clean all \
              &amp;&amp; rpm -q procps-ng
  
  ENV NGINX_USER=&quot;api-gatway&quot; \
      NGINXR_UID=&quot;8987&quot; \
      NGINX_GROUP=&quot;api-gatway&quot; \
      NGINX_GID=&quot;8987&quot;     
  
  RUN set -ex; \
    groupadd -r --gid &quot;$NGINX_GID&quot; &quot;$NGINX_GROUP&quot;; \
    useradd -r --uid &quot;$NGINXR_UID&quot; --gid &quot;$NGINX_GID&quot; &quot;$NGINX_USER&quot; 
  
  #To start up NGINX 
  EXPOSE 80
  RUN mkdir -p /var/lib/nginx/
  RUN mkdir -p /var/log/nginx/
  
  RUN mkdir -p /var/lib/nginx/tmp/
  
  RUN chown api-gatway /var/lib/nginx/
  RUN chownd api-gatway /var/log/nginx/
  USER api-gatway
  CMD [&quot;nginx&quot;, &quot;-g&quot;, &quot;daemon off;&quot;]
  
  </code></pre>