title: Cannot exit from Docker container
body: <p>I've got a container which I run as</p>
  
  <pre><code>docker run -it --rm --name &lt;container_name&gt; &lt;image&gt;:&lt;tag&gt;
  </code></pre>
  
  <p>normally, I fall into the container terminal from which I can exit with the <code>exit</code> command. Now, I have a DockerFile which ends with an entrypoint that runs a simple bash script:</p>
  
  <pre><code>#!/usr/bin/env bash
  
  # Add new user
  groupadd -r $GROUP --gid $GROUPID
  useradd -r $USER --uid $USERID --gid $GROUPID
  
  # Launch application with new user
  su - -c "python &lt;path_to_script&gt;/myscript.py" $USER
  </code></pre>
  
  <p>now, once my script ends, I expected to exit from the container but everything in the entrypoint bash script is ran again and again (say 10 times).</p>
  
  <p>Why does my container have this behavior ?</p>