-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Attempting to change ownership or permissions on a bind-mounted volume via docker exec fails #587
Comments
this is a duplicate of #581(I'm not closing to make it easier for people to find) |
+1 been pulling my hair all day on this. |
To add to this, not only do chown/chmod not have any effect from inside the container, they also do not have any affect from the boot2docker vm shell. so its natural that the container has no ability to modifiy since the host (boot2docker VM) cannot modify the files on the real host (OS X) I guess this is a read only mount ? Permissions show the files as owned by docker:
But can't touch this:
Still untouched:
cat throws an error:
chown and chmod of course do not work. although I'm doing this on a large postgres data directory and it does take a while to run. so it is doing work. but there is no change |
Same issue here, shared local volumes from osx to containers are unable to handle permissions properly, which makes boot2docker unusable for a local dev environments. I've also tried to work just with data containerz, but exporting them with NFS/samba is a performance nightmare, a simple 'git status' takes seconds. |
This is.probably related: http://superuser.com/questions/640027/why-cant-i-chown-a-virtualbox-shared-directory |
My temporary solution is to use NFS shared folders instead of vboxfs, as vagrant does. From osx "/etc/exports": From boot2docker umount/remount /Users using NFS:
|
@paolomainardi yup, that was one of the solutions we should explore. |
@paolomainardi thanks for that tip - helped me out big time! |
@paolomainardi Maybe i'm doing something wrong: I can't run |
@mikeys let me see the error log output |
My bad, it's |
@paolomainardi I'm facing something really odd, the data is persisted but for some reason I can't see any files the volumes i've mounted... both in the host and from inside the container... |
@mikeys are you using fig ? |
@paolomainardi Yes I am |
@mikeys sometimes it happens, i really don't why. If you don't have anything important try to |
@paolomainardi Wow... the entire eco-system is shaky lol. Thanks, that actually worked but all those workarounds feel very unstable 😞 . |
@mikeys i agree, maybe with |
hmm... so I got the same problem with docker-compose that mikeys got with fig. I guess changing the name didn't fix the bug after all. :) ... is this a "known issue" (with a bug report somewhere)? |
stumbled into this issue right now. really anoying |
I've been also hitting this issue similar to this trying to run the ibmimages/mqadvanced image on a Mac running boot2docker within VirtualBox. If you point to a local filesystem within the boot2docker image it works fine but if you try and use a mounted folder such as /Users on a mac it fails to change the permissions of the mounted files thus resulting in the container failing. |
+1 |
+1 just ran into this issue. |
+1 postgresql with boot2docker on mac |
@asheshambasta I use Dinghy, just install it instead of boot2docker and it just works ® (at least it does for me). |
@ayeo can confirm that this hack works with php-fpm as well. thank you. 👍 to fix, plz. |
+1 RUN usermod -u 1000 www-data @ayeo this works |
+1 As @ayeo mentioned, "usermod -u 1000 www-data" does work |
+1 |
1 similar comment
+1 |
I was having problems with the permissions on the mounted volume for the actual elasticseach data. So I used the usrmod hack. boot2docker/boot2docker#587
+1. this is a serious issue. |
+1. I have encountered this problem on Vagrant before as well. Shared files are always the issue. Would love to see this fixed. |
I was able to get around this using --volumes-from On Wed, Nov 4, 2015 at 6:50 PM, Ross Edman notifications@github.com wrote:
|
+1 |
+1 Wasted many hours on this. Permission does not change if a folder is mounted as volume and when trying to change ownership inside container using chown |
+1 |
nfs sharing by default +1 |
+1 |
+1 |
Everyone should try the new 'native' docker for mac/window which is in beta now. Mounting files inside my app work fine now. So long as I change the permissions on runtime. |
+1 What exactly is @jackmcpickle going to try the native docker for mac and test this out. Thanks! |
When using Docker toolbox, Symfony can't run because of permission errors. "Warning: SessionHandler::read(): Session data file is not created by your uid" This line fixes the problem (based on boot2docker/boot2docker#587 (comment))
I noticed this behavior yesterday when trying to bind-mount a local directory containing a webapp into my container so I could work on it without having to restart the container after every change. The app's framework is very particular about permissions, so I thought I'd try using docker exec to change them. The run command is something like:
Then I ran the following to check permissions:
Which gives:
The following command should work, and does on files created by e.g. "docker exec container_name touch file_name", but doesn't in this scenario:
Running ls -la /app/build.xml still returns:
Some other things that have been tried are creating a new file in the container's /tmp directory and attempting the same ownership change (works), creating a new file via docker exec in /app and attempting the same (fails), and attempting to change ownership using uid/gid instead of names (e.g. 33:33) (fails). chown, chgrp and chmod all exhibit this same behavior.
If this is a Docker issue and not a boot2docker issue, please let me know and I'll take the issue over there. However, users who tried the above from a Linux Docker host instead of through boot2docker were able to successfully modify permissions/ownership, which leads me to believe this is an issue with boot2docker.
The text was updated successfully, but these errors were encountered: