title: docker and "volatile volumes" ala /tmp
body: <p>I run a server with 2 Docker images, one does building and packaging and thus creates alot of shortlived stuff on /tmp.</p>
  
  <p>I'd like this container /tmp to not be backed by persistent volume (union fs or volume) but to use the host's /tmp which in turn is a tmpfs volume and ideal for such operations. Saving access to a normal drive will have overhead and causes access to HDDs (wear-out), I would prefer to try to stay in RAM as much as possible.</p>
  
  <p>Some options are:</p>
  
  <ul>
  <li>Bind /tmp/:/tmp to the docker process. Doesnt seem very secure, and problematic if another process accesses this directory</li>
  <li>Bind a volume to /tmp. This means its on the harddrive unless I manage to move it to /tmp.
  There is then still the issue of deleting this volume each time the container stops, since Id prefer a clean slate.</li>
  <li>Mount /tmp as tmpfs in the container. Seems the most sane option. Except that would mean editing all containers instead plainly using existing ones</li>
  </ul>
  
  <p>I am new to Docker, maybe I am missing something obvious.</p>
  
  <p>I search for a way to specify volumes which can or have to be dropped after the container stops. Or even are kept completely in RAM unless this is infeasible.
  And additionally some easy way to mount /tmp as such a container.</p>