-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
UID mismatch and permission problems #463
Comments
What you can do it´s change the owner of your bind filestore to your host user, not the root of the host. Odoo can read, but can write. This is good when you are working and need to do continuos changes. The unique exeception here that I found is with de By the way, you can still create a new user with only write permision on the bind folder. This can mitigate securty problems with possible breach in your container. In escence, this is the same way that you are trying with the odoo user. |
The odoo user is created automatically when odoo is installed, and I am not able (not skilled enough) to configure the creation of this user. The solution for me was to modify dockerfile so to create a odoo user before odoo is installed and specify the corresponding UID. Basically I have followed this manual: It helped me, but the issue is not solved- I guess the UID should be the same when user "odoo" is created. |
@SEP-Lipchanskis - If you are working with the Dockerfile to compile a new image, you can add a new line to modify the UID of the user after the Odoo installation is done. To do this, add the following line to the Dockerfile:
You need to be root to run this command. (Check if the Dockerfile is working with the root user.) In your host machine, do the same with your Odoo user. Now, both users must have the same UID Check this for more info https://www.cyberciti.biz/faq/linux-change-user-group-uid-gid-for-all-owned-files/ |
@SEP-Lipchanskis is this still an issue or have you found an answer? |
@lathama I have solved my problem by adding following lines: .env file:
docker-compose.yml:
Dockerfile:
|
The
odoo
user UID inside container is not the same as host userodoo
UID.how to reproduce the issue:
-adduser
odoo
(generated UID=1001)-install docker
-write basic docker compose file to run odoo based on this repo (v15), bind mount filestore directory so you can backup/restore odoo in future
-run odoo and postgres containers and face the filestore permission errors
-docker exec into odoo container
-inside the container the user is
odoo
with UID 101 and has no permissions to write to filestore. The filestore owner is1001
-exit from container. User with uid 101 in host is
systemd-resolve
-if I do chown 101 to filestore in host, the owner inside the container is
odoo
now. But this is not ok to have a unrelated system user as owner of odoo filestore directory. Also not good the container user can potentially access system files.Maybe I am doing something wrong?
What is the right way to run containers and bind mounts with write access?
The text was updated successfully, but these errors were encountered: