So, basically, I have a docker container running and i have mounted a host file-system inside the container so that the processes inside can have access to its files. The running process inside the docker container requires the files in the mounted file-system to be its ownership but they have a different owner (my host user). Whenever i try to change the ownership from my host to that of the container, chown reports an invalid user error.

$ sudo chown -R odoo:odoo *
chown: invalid user: ‘odoo:odoo’

Is is possible to chown the files from the host using a non-existent user ? Or there's another way how to do things ?

By the way, the mounted folder contains additional modules that the process needs. I am developing those modules on my host machine and then testing them directly using docker without having to copy them again.


Use the UID number rather than a name. For example, if odoo has UID 1023 and GID 475 then you can use those numbers directly:

sudo chown -R 1023:475 *
| improve this answer | |
  • 1
    Nice, thanks. Do you know why Linux doesn't accept usernames but accepts UIDs and GIDs ? – Karim Manaouil Jun 23 '18 at 17:21
  • 1
    It doesn't know about them - they're local to your Docker instance. – roaima Jun 23 '18 at 20:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.