title: Launching multiple Docker containers with supervisor
body: <p>I've got a number of Docker containers which I would like to start using <code>supervisor</code>. The problem I have is that supervisor requires commands to be blocking to keep track of them.</p>
  
  <p>The command <code>docker run my/container:tag</code> is unfortunately non-blocking, i.e. it returns immediately spawning a process.</p>
  
  <p>The docker container gets launched (actually 2 and sometimes 4 instances which may be related), but supervisor indicates an error "FATAL      Exited too quickly (process log may have details)".</p>
  
  <p>Can supervisor be used to run Docker containers?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I had the <code>-d</code> option also on from some earlier trials which cause <code>-i</code> to not work as expected (aren't they the opposite and shouldn't they prompt some sort of error?). When I run with <code>-i</code> in my <code>supervisor.conf</code>, I get this error <code>time="2015-06-27T14:14:29+10:00" level=fatal msg="cannot enable tty mode on non tty input"</code>.</p>
  
  <p>I've also tried to run without <code>-i</code> and it successfully starts the docker container. Unfortunately a <code>sudo supervisorctl stop app</code> does not actually stop the docker container. Is supervisor unable to control docker or do I really need to run with the <code>-i</code> option and fix this tty error somehow?</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>The tty error came from also having the <code>-t</code> option in my <code>docker run</code> command. I removed it. However, <code>supervisorctl</code> is still not able to stop the docker run. While it doesn't give an error when running and <code>supervisorctl status app</code> says it has stopped with <code>docker ps</code> I see that the container is actually still running.</p>