greyltc / docker-owncloud

Arch linux based docker container with owncloud
111 stars 37 forks source link

External storage / persistant volume permissions #74

Closed absudabsu closed 8 years ago

absudabsu commented 8 years ago

Hello,

I am attempting to run this container on a F22 server, as follows:

sudo docker run -v /srv/ownCloud/ocConfig:/usr/share/webapps/owncloud/config -v /srv/ownCloud/ocData:/usr/share/webapps/owncloud/data --name my_owncloud -p 833:833 -p 443:443 --restart='always' -d l3iggs/owncloud

but when i navigate to https://mydomain/owncloud, I get the error:

Can't write into config directory! This can usually be fixed by giving the webserver write access to the config directory.

The persistent storage location was created as directed in the Wiki:

mkdir /srv/ownCloud

mkdir /srv/ownCloud/ocData
sudo chgrp 33 /srv/ownCloud/ocData
sudo chmod 0770 /srv/ownCloud/ocData

mkdir /srv/ownCloud/ocConfig
sudo chgrp 33 /srv/ownCloud/ocConfig
sudo chmod 0770 /srv/ownCloud/ocConfig

I even tried chmod -R 777 /srv/ownCloud, but no luck. Stopped, removed, and docker run between each try.

Any ideas?

absudabsu commented 8 years ago

To clarify, I got an error when i tried to map 80:80 in the docker run command, so I ran on 81 like this:

sudo docker run -v /srv/ownCloud/ocConfig:/usr/share/webapps/owncloud/config -v /srv/ownCloud/ocData:/usr/share/webapps/owncloud/data --name abhe_owncloud -p 81:80 -p 443:443 --restart='always' -d l3iggs/owncloud

but still no luck.

greyltc commented 8 years ago

I think your issue stems from some sort of syslinux protection mechanism (see here). I've just made a few changes to the container to attempt to address this. Please pull the latest version and let me know how it goes.

absudabsu commented 8 years ago

I think you're right, because disabled selinux and jumbled with the permissions, and it sort of worked -- but left my system pretty vulnerable.

I tried with the latest image, as you suggested, but same result.

Perhaps I can ask, what should the permissions be on the folders? What owner and group, specifically? I'm not sure what chgrp 33 does. Here's what I have:

drwxrwxrwx. 4 root root 35 Mar 11 12:12 ..
drwxrwx---. 2 root tape  6 Mar 14 17:29 ocConfig
drwxrwx---. 2 root tape  6 Mar 14 17:29 ocData
greyltc commented 8 years ago

chgrp 33 changes the group to user with id 33. ID 33 is the "http" user inside the container.

I've written up some notes on resolving permissions issues like yours in the wiki. I'm 99% sure that if you follow them your issue here will be resolved: https://github.com/l3iggs/docker-owncloud/wiki/Notes-on-resolving-permissions-problems

Closing this now. If my instructions do not solve your issue, write back here and I'll reopen this.