lobaro / restic-backup-docker

A docker container to automate backups with restic
Apache License 2.0
330 stars 114 forks source link

Fix permission denied on OpenShift #48

Closed daquinoaldo closed 3 years ago

daquinoaldo commented 4 years ago

OpenShift Container Platform runs containers using an arbitrarily assigned user ID instead of privileged user (root). Since the user inside the container is not root, it hasn't the permissions to perform some operations you do in the bootstrap script, like creating directory inside /mnt or setup the cron job.

This fix follows the official OpenShift Container Platform guidelines. It simply gives the needed permissions on the involved directories to users of the root group. Since the random user is in the root group, it will have the permissions to perform the operations, while basic users that are not in the root group still won't have permissions in order to preserve security.

This pull request will allow OpenShift users to use your image.
I've successfully built and tested the new image on an OpenShift v4.4 cluster.
You can find the built image on the DockerHub (I'll remove it if you merge the PR).

This closes #47.