EACCES: permission denied when mapping a local folder to Docker Container

Hello:

I have converted to a docker installation from a manual installation. Everything is working pretty well except I can’t get the upload folder to work. I have the volume mapping, and I can see it in the container but if I try to upload anything I see:

ufs: cannot write file “hNW3tqn5dC7CmLpzp” (EACCES: permission denied, open ‘/opt/uploads/hNW3tqn5dC7CmLpzp’) [Error: EACCES: permission denied, open ‘/opt/uploads/hNW3tqn5dC7CmLpzp’] {
tmp-rocketchat-1 | errno: -13,
tmp-rocketchat-1 | code: ‘EACCES’,
tmp-rocketchat-1 | syscall: ‘open’,
tmp-rocketchat-1 | path: ‘/opt/uploads/hNW3tqn5dC7CmLpzp’
tmp-rocketchat-1 | }

I can’t chown or chmod the folders in the container and the user:group is node:node. Is there some special trick to getting those permissions working?

I hadn’t set the permissions on the local folder properly. All good now. Thanks!

How have you mapped this folders?

Can you use a docker volume instead of local folder?

I did it is a volume mapping in the compose file.

volumes:
- /opt/uploads:/opt/uploads

It is working without issue so I am ok with that configuration.

1 Like