This repository was archived by the owner on Feb 16, 2023. It is now read-only.
Add information about running with SELinux #1510
mbollmann
started this conversation in
Feature Requests
Replies: 1 comment
-
Addendum: also need to add |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR: Users running with SELinux enabled need to add
:z
to their volume specifications for all volumes that are outside the regular docker directories (e.g., in the user's home directory). I suggest adding some information about that to the documentation, since it wasn't obvious to me and I spent several hours researching this issue.I've just tried to get paperless-ng up and running on a local machine (Fedora 34, local harddisk), and was running into a permissions issue that looked very similar to #1056: "Permission denied" errors on all folders within my $HOME directory.
For example, trying to run the docker image would give me:
If I changed
docker-compose.yml
to e.g. move thedata
folder under my $HOME dir as well, I'd get:The respective folders were all created with
root:root
ownership by Docker, no matter what UID/GID I gave indocker-compose.env
. I double- and triple-checked that the UID/GIDs were correct and that my Docker installation was set up correctly e.g. with regard to my user belonging to the "docker" group.After a lot of research, I remembered that my system uses SELinux, so I tried disabling it (
sudo setenforce 0
) and, lo and behold, the permission issues disappeared!It appears that to allow Docker images to properly access mounted volumes outside the standard Docker directories when SELinux is enforced, the
:z
mount option should be added to these volume specifications. Doing this makes all permissions issues go away on my system, and the respective folders are now also created with ownership belonging to my own user's UID/GID.To be precise, I changed the following lines in
docker-compose.yml
:If the data/media directories are changed to e.g. also be mounted locally (
./data
), they would also need the:z
flag.Hope this helps someone!
Beta Was this translation helpful? Give feedback.
All reactions