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

Insufficient permissions in Docker #1127

Closed
p4rkrs opened this issue Apr 15, 2018 · 5 comments
Closed

Insufficient permissions in Docker #1127

p4rkrs opened this issue Apr 15, 2018 · 5 comments
Labels
docker containers & cloud support installation and configuration issues

Comments

@p4rkrs
Copy link

p4rkrs commented Apr 15, 2018

Hi,

When I try to launch Shaarli under docker with the command docker run -d -p 8000:80 -v /srv/shaarli:/var/www/shaarli/data shaarli/shaarli, I make a reverse proxy with NGINX and I get that error:

Insufficient permissions:

    "data" directory is not writable

And that's the docker logs:

172.17.x - - [15/Apr/2018:13:03:47 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:03:48 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:03:48 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:03:48 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:03:48 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:03:49 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:03:49 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:03:49 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:05:20 +0000] "GET / HTTP/1.1" 200 93 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"
172.17.x - - [15/Apr/2018:13:05:20 +0000] "GET /favicon.ico HTTP/1.1" 200 76949 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"

I would to know why that error happen & how to fix it please...

Thanks !

@virtualtam virtualtam added docker containers & cloud support installation and configuration issues labels Apr 15, 2018
@virtualtam
Copy link
Member

Hey @ItsKiru,

This means that the processes running inside the Docker container are attempting to write data to a location that is not writeable.

See Docker's Use volumes documentation for more information regarding the available options for storing data in a persistent way.

A common issue when bind-mounting volumes is managing user permissions, as the numeric user and group IDs might differ between the host running Docker and the guest container appliances.

@p4rkrs
Copy link
Author

p4rkrs commented Apr 15, 2018

Hi @virtualtam,

I gave the permission 777 by chmod 777 /srv/shaarli and I ran the container by the root user...

@virtualtam
Copy link
Member

See my detailed answer on this previous issue: #1031 (comment)

chmod 777

Never ever do this...

ran the container by the root user

This has no impact whatsoever, processes are run with user/group accounts that are local to the container, and usually have limited permissions.

@virtualtam
Copy link
Member

Closing due to lack of feedback, feel free to reopen.

@danbo
Copy link

danbo commented Jun 5, 2018

After making it 777, you can see the user and group the container is using internally

ls -l
-rw-r--r-- 1 systemd-timesync systemd-journal 2063 Jun  4 22:04 config.json.php

or

ls -ln
-rw-r--r-- 1 100 101 2063 Jun  4 22:04 config.json.php

so adjust your host volume folder to match...

sudo chown 100:101 /srv/shaarli

finally, reset perms to default

sudo chmod 755 /srv/shaarli

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