Skip to content
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

Docker - Insufficient permissions #1349

Closed
schiz0phr3ne opened this issue Aug 7, 2019 · 3 comments
Closed

Docker - Insufficient permissions #1349

schiz0phr3ne opened this issue Aug 7, 2019 · 3 comments
Labels
docker containers & cloud support installation and configuration issues
Milestone

Comments

@schiz0phr3ne
Copy link

Hello,

I try to figure why I can't use Shaarli, because I have insufficient write permissions on folders who have them normally.

Docker command :
docker run -d -p 8000:80 -v /docker/shaarli/cache:/var/www/shaarli/cache -v /docker/shaarli/data:/var/www/shaarli/data shaarli/shaarli

Folder permissions :
drwxr-xr-x 4 docker users 4096 août 7 08:26 shaarli
Subfolders :
drwxr-xr-x 2 docker users 4096 août 7 08:26 cache
drwxr-xr-x 2 docker users 4096 août 7 08:26 data

docker folder is owned by root user, but I don't have issue with other containers subfolders (all owned by docker user)

I added ENV variables (from OpenMediaVault GUI) :
PUID=1001
PGID=100
(where id docker = uid=1001(docker) gid=100(users))

But I always have this error on Shaarli homepage :

Insufficient permissions:
    "cache" directory is not writable
    "data" directory is not writable

I saw that, inside container, cache and data folders are owned by root user, so I chown folders to host root user, without success.

Do I forget something ?

@ArthurHoaro
Copy link
Member

From my understanding, the owner in the container and on the host have to be the same. Since the image nginx user is 100:101, that's also what I applied on the host. I'm not sure if it's the best approach though.

@ArthurHoaro ArthurHoaro added docker containers & cloud question labels Aug 7, 2019
@ArthurHoaro ArthurHoaro added this to the 0.11.2 milestone Aug 7, 2019
@schiz0phr3ne
Copy link
Author

Ok so, I did a chown 100:101, even if user 100 belongs to group 102 : it works !

I reread the documention (across), and I didn't retrieve anything about nginx user (I maybe missed it). It may be necessary to add it.

@virtualtam
Copy link
Member

Hi @schizophrene !

It is recommended to use dedicated volumes to store, persist and share data across containers, see https://docs.docker.com/storage/volumes/

This is a duplicate of #1031 and #1127 , see also my detailed answer there for a more in-depth explanation: #1031 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker containers & cloud support installation and configuration issues
Projects
None yet
Development

No branches or pull requests

3 participants