Docker Community Forums

Share and learn in the Docker community.

Mounted volumes from osx cannot be chowned without rw on for owner


(Scipio) #1

Expected behavior

I should be able to change ownership for any given file while being root.

Actual behavior

Files that live in mounted volumes cannot be chown’d unless they have been previously chmod’d as 600 (at least).

Information

docker --version
Docker version 1.12.0-rc2, build 906eacd, experimental

OSX version:
10.11.5

The docker process is owned by the mac user, and the test file is also owned by the mac user.

Steps to reproduce the behavior

  1. touch /Mac/opt/ubuntu/test && chmod 000 /Mac/opt/ubuntu/test
  2. docker run -v “/Mac/opt/ubuntu”:/tmp/osx ubuntu chown root:root /tmp/osx/test
    chown: changing ownership of ‘/tmp/osx/test’: Permission denied

This may seem trivial, but it does work in other file system types that are not osxfs. I’ve read similar topics but it’s still not clear to me why this is happening here.

Why granting chmod 600 allows to chown it?
Why with 000 I’m able to delete the file at will but cannot change the ownership? (I’m actually not trying to change the ownership per se, just re-setting it).

The only reason why I’m bringing this up is that it’s breaking an upgrade process we use on a .deb. This is the minimum reproducible scenario I could find.


(Dukexar) #2

I have the same experience - it breaks unpacking of the deb packages for me.