-
Notifications
You must be signed in to change notification settings - Fork 238
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
Update README.md about need to "chown 1000 ./public*" #18
Comments
Hi, The containers run as a non-root user and Docker by default will bind mount files as uid/gid 1000:1000 when you set Is your user not 1000? You can check by running |
The active user running docker-compose having uid 1000 won't be guaranteed. Mine is 1001 due to presence of other local users, and similar for systems with centralized user management like via LDAP. For an active user with uid != 1000 to chown something to that id, sudo is required. Recommendation is to add mention of default uid.gid = 1000:1000 to the README, and Linux users with different ids need to update Dockerfile with |
You are correct in that it's not guaranteed, but it is the default behavior of Docker. If you chown those directories as |
Hey, I know it's been a while but can you try out this PR and report back whether it works or not in that PR? nickjj/docker-flask-example#7 It should be a generic solution that will let you run things without permission errors by customizing the I know it's a Flask app and not Django but I can port the same change over to this Django example app if it works. |
This is fixed in: b269057 |
The error in #9 occurs under Ubuntu 20, and likely similar platforms enforcing non-root write privileges for the active user, due to hardcoded uid 1000 in the container images pulled during build. This explains build errors like these:
Resolution is to chown ./public* prior to first build with docker-compose. Likely have to do with sudo if the active user doesn't have root privileges.
The text was updated successfully, but these errors were encountered: