-
Notifications
You must be signed in to change notification settings - Fork 33
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
Docker schedule as non root user #321
Comments
Hey! I'm not sure I understand your issue, can you explain how you're trying to do your backups? |
Sure, I try to explain what I'm about do to: First of all I'm working with a Synology NAS and it should backup its own data to a restic repo. Therefore I want to use a Docker container running on the NAS. Following the best practices of Docker this container should not run as root and I created an user for backup purposes. Then I'm using the following "Stack" with Portainer (this is similar to docker compose):
Some snippets from the profiles.toml:
This leads to the following logs in the container:
As far as I understand, the user I provide is not allowed to run crond. Therefore I asked if it is possible to modify your Dockerfile to give the container user access to crond. Disclaimer: Being no docker expert, I might miss another approach to solve the issue. |
Update: I also tried to set schedule-permission to "user" in the profiles.toml. The result is another error:
|
Thank you for your detailed description. The problem is because I'm using I'm going to try if it works with adding the package busybox-suid. With this package, Then I need to test if resticprofile/restic do work fine with a non-root user. If it fails I guess I can also provide a Debian base image. |
Thanks a lot, I really appreciate your willingness to change the image. I also came across the busybox-suid suggestion, that might work. Let me know if you need further information or someone to test the image whenever you're ready. |
So, in the end I didn't like the idea of having suid on all the busybox binaries. I prepared a contribution based on supercronic instead. See here: #348 |
I tried this very good contribution of how to schedule jobs with Docker.
Unfortunately crond cannot be used when I'm using a non root user for the docker container, as it has no permissions to execute it.
Can this be solved withing the resticprofile docker image? I only see the solution to build my own image and modify the user permissions but it would be nice if I could use the image without modifying it.
The text was updated successfully, but these errors were encountered: