title: how to "docker run" a shell session on a minimal linux install and immediately tear down the container?
body: <p>I just started using Docker, and I like it very much, but I have a clunky 
  workflow that I'd like to streamline.   When I'm iterating on my Dockerfile script
  I will often test things out after a build by launching a 
  bash session,  running some commands, finding out that such 
  and such package didn't get installed correctly, then
  going back and tweaking my Dockerfile.   </p>
  
  <p>Let's say I have built my image and tagged it as buildfoo, I'd run it like
  this:</p>
  
  <pre><code>      $&gt;  docker run -t -i  buildfoo 
  
                ... enter some bash commands.. then  ^D to exit
  </code></pre>
  
  <p>Then I will have a container running that I have to clean up. Usually I just nuke everything like this: </p>
  
  <pre><code>docker rm --force `docker ps -qa`
  </code></pre>
  
  <p>This works OK for me.. However, I'd rather not have to manually remove the 
  container.   </p>
  
  <p>Any tips gratefully accepted !   </p>
  
  <hr>
  
  <p><strong>Some Additional Minor Details:</strong></p>
  
  <p>Running minimal centos 7 image and using  bash as my shell.</p>