title: Make container stop itself
body: <p>Is there any native way to make a Docker container stop itself? I can't find anything in the documentation.</p>
  
  <p>I have a container that does some stuff, and I want to hook into the completion of that. </p>
  
  <p>One way I thought of doing this was blocking with <code>docker wait</code> until the container stops itself, and then I can restart it with a <code>docker start</code> and continue on to the subsequent commands that depend on those jobs being complete.</p>
  
  <p>For instance:</p>
  
  <pre><code>docker run -d --name=my-container ...
  
  # Wait for my-container to stop itself
  docker wait my-container
  
  # Once it stops itself, start it again.
  docker start my-container
  
  # Some other commands here that depend on my-container to finish its jobs...
  </code></pre>
  
  <p>But I can't find any way on the documentation to make a container stop itself.</p>