Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot change ownership of read-only file in mounted volume #633

Closed
sameersbn opened this issue Sep 15, 2016 · 4 comments

Comments

@sameersbn
Copy link

commented Sep 15, 2016

Expected behavior

Ownership of file should change.

Actual behavior

Permission denied error displayed by chown command

Information

Diagnostic ID: C6AC4F0F-8770-4592-8AB1-E34D52436EEF
Docker for Mac: 1.12.0-a (Build 11213)
macOS: Version 10.11.6 (Build 15G1004)
[OK] docker-cli
[OK] app
[OK] moby-syslog
[OK] disk
[OK] virtualization
[OK] system
[OK] menubar
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux

Steps to reproduce

$ mkdir -p sandbox && cd sandbox
$ docker run -it --rm -v $PWD:/data --workdir /data ubuntu:14.04 bash
$ touch sample && chmod 444 sample && ls -la
total 5
drwxr-xr-x  3 root root  102 Sep 15 12:28 .
drwxr-xr-x 35 root root 4096 Sep 15 12:27 ..
-r--r--r--  1 root root    0 Sep 15 12:28 sample
$ chown daemon:daemon sample
chown: changing ownership of 'sample': Permission denied

The ownership of the file can however be changed by first changing the mode to readwrite mode:

$ chmod 755 sample
$ chown daemon:daemon sample
$ ls -la sample
total 5
drwxr-xr-x  3 root   root    102 Sep 15 12:51 .
drwxr-xr-x 35 root   root   4096 Sep 15 12:51 ..
-rwxr-xr-x  1 daemon daemon    0 Sep 15 12:51 sample
@dsheets

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2016

This is a (clearer) duplicate of #117 and #263. Thanks for the report. We hope to have a fix out soon.

@jakajancar

This comment has been minimized.

Copy link

commented Sep 26, 2016

@dsheets Can you explain what the fix will be? Will you just start saving permissions in OS X extended attributes, or is it going to also remove (uid/gid = current uid/gid)?

@jakajancar

This comment has been minimized.

Copy link

commented Oct 11, 2016

Anything new here?

@dsheets

This comment has been minimized.

Copy link
Contributor

commented Oct 26, 2016

This should be fixed in the just-released Beta 29. Sorry for the delay in resolving the issue -- we had a couple of false starts on the design but now we use an ACL entry to make xattrs (containing ownership metadata) behave like inode metadata in most circumstances. Please give it a try and let us know how it works (or doesn't) for you. I'm going to close this issue but if you find related problems, please feel free to re-open. If you find un-related problems, please open a new issue. :-)

Thanks for using Docker for Mac!

@dsheets dsheets closed this Oct 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.