-
Unsure if this is the best place to ask, since this is not specific to this seafile image, but a general docker or seafile-image question. Maybe someone here has encountered and solved the same problem, given the emphasis on a clean image and service design! TL;DR : docker-compose option like user: "1000:1000" for user permissions on local folder/volume seafile-data? I am running a variety of different docker services on arm and x86-64, besides seafile-clients and seafile-server via docker-compose, as non-root user. I back these up via daily cronjob scripts that essentially take the container down, archive the entire docker folder via borg, and then bring container back up. For that to work I've made all config folders local volumes, and all external folders mapped in docker-compose.yml . Seafile-server is my last service still needing/having folders with non-user permissions, for which as a clutch I use some root owned cronjob to first rsync the entire docker-seafile-server folder and later on backup this mirror as user. For all other services I've found some kind of 'rootless' option, most of the time as well placed version of option user under some service in docker-compose.yml. I don't really know what I'm doing when it come to building images, and much prefer to use a simple option intended for this purpose. Or maybe I'm approaching this all wrong and the permission issue is just a red herring? I have been running the stock (haiwen) image via their docker-compose.yml for a few years now, and other users reported similar ideas but no solution. This only affects seafile-server, the docker-compose.yml for seafile-client has user permissions out of the box. I've been playing around with this image for a couple of days, running it in parallel on about ~700GB of mixed data. The main feature of seafile I'm using in practice is the file version control, data is rarely accessed via web GUI, and distribution is done via resilio-sync or syncthing. Grateful for any pointers or ideas! (The work-around with root rsync mirror copy works reliably, apart from taking up double the disk space I just don't like it) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Several ideas and questions came to my mind.
From a security perspective you make it even worse. By default The permission system inside a container is entirely independent from the host system. So for instance if you configure a container to start its app as user with UID X, this UID likely has root access within the domain of the container, while the UID X on your host could be just any user-level user. So additionally, you're trying to bridge permissions from two different domains.
It's simply enough to backup the volumes. Since containers are - or at least should be - stateless, there is no need to back them up. The rest of your docker infrastructure, like networks and so on, should be defined by compose files. So when you want to recover from a backup, you just copy in all volumes, apply all compose files and the system should have the same state as before.
I don't know borg but usually backup software allows you to create snapshots from active databases. |
Beta Was this translation helpful? Give feedback.
Several ideas and questions came to my mind.
From a security perspective you make it even worse. By default
/var/lib/docker/volumes
is only accessible for root users. In your system, the volumes are accessible on user-level. Making it even more vulnerable. What you're doing is essentially copying files on user-level, which should be protected by root-level, just to execute the backup as non-root user. It doesn't make sense. I don't understand why you specifically want to execute the backup as non-root user.The permission system inside a container is entirely independent from the host system. So for instance if you configure a container to star…