title: Exec not replacing bash shell in Docker entrypoint script
body: <p>I'm trying to run a UWSGI server from a Docker container. I've had success, but I'm hitting a wrinkle in that my entrypoint script will still be running as root with PID 1 after container startup, when I'd rather have the initial <code>/bin/bash</code> process be replaced by the UWSGI processes:</p>
  
  <pre><code>bash-4.4# ps aux
  PID   USER     TIME  COMMAND
      1 root      0:00 {docker-entrypoi} /bin/bash /usr/local/bin/docker-entrypoint.sh
     19 myuser    0:00 uwsgi --ini /opt/mysite/uwsgi.ini
     21 myuser    0:00 uwsgi --ini /opt/mysite/uwsgi.ini
     22 myuser    0:00 uwsgi --ini /opt/mysite/uwsgi.ini
     24 myuser    0:02 python3 ./manage.py qcluster
     28 myuser    0:00 python3 ./manage.py qcluster
     29 myuser    0:00 python3 ./manage.py qcluster
     30 myuser    0:00 python3 ./manage.py qcluster
     31 myuser    0:00 python3 ./manage.py qcluster
     32 myuser    0:00 python3 ./manage.py qcluster
     33 myuser    0:00 python3 ./manage.py qcluster
     34 myuser    0:00 python3 ./manage.py qcluster
  </code></pre>
  
  <p>I've tried some variations with <code>exec</code> and <code>su-exec</code>, but I'm still hitting the above. I need to supply my PEM passphrase to UWSGI on startup, so I've been using syntax like so:</p>
  
  <pre><code>echo $PEM_PASSPHRASE | exec uwsgi --ini /opt/mysite/uwsgi.ini
  </code></pre>
  
  <p>This works fine to get up and running, but I still get the PID 1 <code>/bin/bash</code> process running, with the UWSGI processes as children below. I feel like I'm missing some obvious detail to actually get the bash process to be replaced by the UWSGI processes via <code>exec</code>.</p>
  
  <p>For what it's worth, I'm only using ENTRYPOINT in the Dockerfile, and not CMD:</p>
  
  <pre><code>ENTRYPOINT ["docker-entrypoint.sh"]
  </code></pre>
  
  <p>Any pointers in the right direction would be greatly appreciated.</p>