-
Notifications
You must be signed in to change notification settings - Fork 133
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
Permissions not inheriting #67
Comments
Not a clue unless you can provide me/us with a reproducible scenario :-) |
Completely fair. I'll see if I can mock up a repro shortly. |
./docker-compose.yml
./prep-src/Dockerfile
So, if that last chmod (which takes quite a bit of time given the number of files it had to amend in the layer) is omitted, it runs pretty quickly. However, in spite of the parent permissions being set above, none of the files written by composer are writable. You can then test the image built by... (probably self-explanatory, but just in case and for any others)
Starts off in BUILD_PATH...
Note, ./html is writable
...but folder contents written by composer are not writable by group (www-data, the apache user/service) Make sense? I gotta step out for the evening, but can check in later. |
Your mount completely invalidates the preparations you make in your The first time you spin up your container using |
But it is mounted Also, why then does the parent ( Also, I commented out the line that calls composer, and uncommented the latter chmod command in the snippet above, then when I In my full project (which also has apache, php-fpm, and mysql), when I Hmm... actually (more to the point perhaps) the rest of the files (when I eg: ...
Why doesn't the file resulting from the add statement reflect the permissions (with Ugh. PS: This could have interesting implications (for ADD/COPY specifically) |
I'm just commenting on your example. You prepare a directory with certain permissions and such, and then you overlap a mount on top of it, creating a whole new directory structure basically. So I am not sure what you are expecting. The directory in the Dockerfile is not the same as you will have in the volume mount. |
Understood. I appreciate any feedback (relatively new to docker). That being said, it works as needed if I force +w in the image and mount as rw. I am just trying to figure out why the extra work is necessary and permissions arent just inherited from the parent folder. |
I am rather confused as to what the problem is though. You say everything Composer installs is read-only. But what is 'everything'? By default, the These permissions are very suitable for almost all cases. If you want Composer to use different permissions though, you should probably just set a different For example:
This will create directories with |
"Everything" = the files in that image path (eg: (Still reviewing the rest of your feedback, just wanted to clarify that portion) |
Neither Ah-ha! I am not familiar with |
I changed the Dockerfile to...
...but upon checking the outcome within the built image, the permissions are correct for the parent Am I using it incorrectly? |
Interestingly, |
I use this wrapper script to run the composer image:
Using the |
Closing this issue because there has not been any activity on it in a long time. |
I dont know if the issue I am encountering is related to this or not.
I have a Dockerfile in which I ensure a path I want composer to install packages to has the needed permissions (specifically, that it is writable). However, rather than inheriting the permissions (with +s set), everything composer installs is read-only. Adjusting the Dockerfile to then go back and manually make things writable extends build times significantly (I killed it off at 20mins last time.)
Any idea as to what might be preventing the permissions from inheriting? Ideas for a viable workaround?
The text was updated successfully, but these errors were encountered: