-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
node user has no write permissions on host bind-mount volume #1991
Comments
My guess it's that it's a mismatch in user id. The Node user id is 1000. You could make the folder writable to all |
I have tried that, to mod the node user to meet my host uid/gid, according to good practices for non root user, but the logs directory seems to remain under "root:root" permissions...
Also tried to chmod/chown the directory itsefl, but in vain.
Below, file permissions inside container VS host project : |
That run command would not be useful if you override it with a volume mount in you compose though no? |
Environment
Expected Behavior
My docker nodeJs app has is started, inside a Dockerfile, with node user that should write Winston logs to file on host bind-mount volume
Current Behavior
The logs folder stays empty without no log file inside, same on host or inside the container
Possible Solution
I have looked all possible issues solutions and the official docker Doc. but in vain : creating special user with same uid:gid as host's one, giving folder permissions other than root one in Dockerfile...
Only the data volume container remains to be investigated, but never experienced such way.
Steps to Reproduce
Run the docker app with integration Compose file (integ target) :
docker compose -f compose.integ.yml up --build --force-recreate
Then, send a Postman POST request on http://0.0.0.0:8000/log URL to trigger the node app logger => logs only written if Dockerfile USER is root :-/
Screenshot when in root user :
Dockerfile :
Compose file :
Additional Information
docker builder purge
The text was updated successfully, but these errors were encountered: