title: Docker container exit(0) when using docker run command, but works with docker start command
body: <p>I am attempting to dockerize a GUI app and have had some success. If I build the dockerfile into an image and then perform a <code>docker run --name testcontainer testimage</code> it appears that the process begins but the abruptly stops. I then check the container with <code>docker ps</code> to confirm no containers are running. Then I check <code>docker ps -a</code> and can see that it exited with status code <code>exit(0)</code>. Then if I run the command <code>docker start testcontainer</code>, it appears to start the <code>ENTRYPOINT</code> command again, but this time it is able to continue and the GUI pops up. </p>
  
  <p>My best guess is that I think that when I run the <code>docker run</code> command, the process begins but might be forked into a background process, causing the container to exit since the foreground process has ended. Although that could be way off because you would think the <code>docker start</code> command would result in the same outcome. I was thinking of trying to force the process to stay in the foreground, but do not know how to do that. Any suggestions?</p>
  
  <p><strong>UPDATE</strong>: I editted my Dockerfile to use supervisord to manage the starting of the GUI app. Now my docker run command will start supervisor, which will start my GUI app, and it works. Some things to note about this are that supervisor shows:<br>
  <code>INFO spawned: myguiapp with pid 7</code><br>
  <code>INFO success: myguiapp entered RUNNING state</code><br>
  <code>INFO: exited: myguiapp (exit status 0; expected)</code><br>
  Supervisor and the container are still running at this point, which seems to indicate that the main process kicks off a child process. Since supervisor is still running, my container stays up and the GUI app does show up and I can use it. When I close the GUI, supervisor reports:<br>
  <code>CRIT reaped unknown pid 93</code><br>
  Supervisor remains running, causing the container NOT to close. So I have to CTRL-C to kill supervisor. I'd rather not use supervisor, but if I need to, I would like for supervisor to close itself gracefully when that child process ends. If I could figure out how to get my container or supervisor to track child processes of the main process, then I think this would be solved.</p>