-
Notifications
You must be signed in to change notification settings - Fork 294
Mount shared folders as a different user #63
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
Comments
@greut thanks for the suggestion. My main concern is that if you run multiple containers than they all have to agree on the acceptable userid/groupid. Of course that is true now as well. Could you give an example of something which complains about root being the default? Would it work, if we hard code a different userid/groupid? |
composer is one of those tools, but it's not a blocker.
https://getcomposer.org/doc/faqs/how-to-install-untrusted-packages-safely.md
Ditto for bundler. |
Apache is a good case point, as Apache runs as user and group www-data:www-data it cannot write to named volumes. Basically making Drupal development on docker a real PITA due to its directory structure. I think this will be one of the most requested features, the best way to manage this would be to allow you to declare a uid:gid per volume either in docker-compose if your using it or at docker run |
This problem stops me from using Docker for web development from the Windows host. Apache/php should not run from |
I think this is related to the same CIFS/Samba limitation as here: #39 Closing this issue. |
@friism the problem isn't only that you cannot chown on a CIFS mounted folder. You cannot set a different uid/gid for the mounted folder but root's. |
@greut This is a limitation of CIFS/SMB and there is little we can do about this. The uid/gid are basically global for all containers. We could potentially offer a configuration option to mount with a different uid/gid. Would that help? |
@meugeba you suggestion was part of the initial request indeed. |
+1 |
1 similar comment
+1 |
Hi everybody, we are facing this issue again with Oracle Database running on a Windows container. Oracle expects certain files to be owned by the user running the database for security purposes. The user has to be other than I'm wondering whether the above suggestion of using a configuration option to mount with a different uid/gid on Windows is already available? Any insights, @rn? |
These issues are caused by the fact that files and folders mounted while running on Windows are mounted as root, regardless of the user running the container. This is different to the behaviour on both OS X and Linux. See docker/for-win#63 and docker/for-win#39 for more details.
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
A mounted volume rights can be changed.
It doesn't seem that Windows shares allows this at runtime. Would it be possible to give a UID/GID pair from the UI (or JSON config) to enable this kind of behaviour from the Mobylinux VM?
Actual behavior
Mounted volumes belong to
root
Information
https://forums.docker.com/t/mounting-a-volume-as-non-root-from-windows/17548/2
Steps to reproduce the behavior
$ docker run --rm -it -v c:/Users/Me:/data ls -l /data
-rwxr-xr-x 1 root root 22299 ...
The text was updated successfully, but these errors were encountered: