title: Docker container cannot write on volume
body: <p>I have a container for which I only have the image, and no Dockerfile. I'm running this container in a Centos7 VM. The container is started with:</p>
  
  <pre><code>docker run -it -v /mydir:/data container_image bash
  </code></pre>
  
  <p>This is Centos7 so there is some SELinux, but normally everything is writable:</p>
  
  <pre><code># file: mydir
  # owner: root
  # group: root
  user::rwx
  group::rwx
  other::rwx
  default:user::rwx
  default:group::rwx
  default:other::rwx
  </code></pre>
  
  <p>But in the bash session in the container:</p>
  
  <pre><code>bash-4.3# id
  uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
  bash-4.3# ls -ald /data
  drwxrwxrwx    2 root     root            20 Apr 30 15:28 /data
  bash-4.3# touch /data/somefile
  touch: /data/somefile: Permission denied
  bash-4.3# mkdir /data/somedir
  mkdir: can't create directory '/data/somedir': Permission denied
  </code></pre>
  
  <p>So, I am root, the directory is shown as universally writable, and yet I can't write to it...</p>
  
  <p>Baffled.</p>
  
  <p>PS: /data is really the right directory on the host, I put a marker file in it on the host, and I see the marker in the container.</p>