title: Privileges in an Ubuntu Docker container after USER statement in Dockerfile
body: <p>I created a Dockerfile</p>
  
  <pre><code>FROM       ubuntu:latest
  </code></pre>
  
  <p>as the parent image.</p>
  
  <p>Later the Dockerfile creates a new group and user without sudo privileges via</p>
  
  <pre><code>RUN groupadd -r myappuser -g 433
  RUN useradd -u 431 -r -g myappuser -d /opt/myapp -s /bin/false -c "my app user" myappuser
  </code></pre>
  
  <p>Before executing the application I switch to this new</p>
  
  <pre><code>USER       myappuser
  </code></pre>
  
  <p>Question: Does this setting make it possible to gain root privileges again once the image is build and the container is running (with e.g. <code>docker exec -it</code>)?</p>