title: Single file volume mounted as directory in Docker
body: <p><a href="http://docs.docker.com/engine/userguide/dockervolumes/#mount-a-host-file-as-a-data-volume">Docker documentation</a> says that it's possible to mount a single file into a Docker container:</p>
  
  <blockquote>
    <p>The -v flag can also be used to mount a single file - instead of just directories - from the host machine.</p>
    
    <p><code>$ docker run --rm -it -v ~/.bash_history:/.bash_history ubuntu /bin/bash</code></p>
    
    <p>This will drop you into a bash shell in a new container, you will have your bash history from the host and when you exit the container, the host will have the history of the commands typed while in the container.</p>
  </blockquote>
  
  <p>When I try that however the file mounts as a directory:</p>
  
  <pre><code>tom@u ~/project $ docker run --rm -it -v file.json:/file.json test
  total 80K
  drwxr-xr-x  9 root root 4.0K Dec  7 12:58 .
  drwxr-xr-x 63 root root 4.0K Dec  7 12:58 ..
  drwxr-xr-x  2 root root 4.0K Dec  4 16:10 file.json
  </code></pre>
  
  <p>My Dockerfile looks like this:</p>
  
  <pre><code>FROM ubuntu:14.04
  MAINTAINER Tom
  CMD ["ls", "-lah", "/test"]
  </code></pre>
  
  <p>Docker version is 1.9.1, build a34a1d5.</p>
  
  <p>Is this a documentation issue, a misunderstanding on my side, or is there something else going on?</p>