Skip to content
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 compose setup: restored files have wrong owner and group #573

Open
gturi opened this issue Nov 20, 2024 Discussed in #471 · 0 comments
Open

Docker compose setup: restored files have wrong owner and group #573

gturi opened this issue Nov 20, 2024 Discussed in #471 · 0 comments

Comments

@gturi
Copy link

gturi commented Nov 20, 2024

I am opening this issue to track down the problem with file restore functionality that arises with docker compose based setup, so that it is not lost in the discussion section :)

To sum up the issue this is the result of running ls -la after restoring the same file (my-script.sh) from a previous backup:

# restored using binary based setup
drwx------.  2 myuser myuser 4096 20 nov 18.29 my-script.sh-backrest-restore-64b0f3f7
# restored using docker compose based setup
drwx------.  2 root root 4096 20 nov 15.17 my-script.sh-backrest-restore-93d6208c

Discussed in #471

Originally posted by robflate September 12, 2024
I'm running Backrest in Docker. When it creates a repo and subsequent snapshots, all file permissions of the original files are ignored and all files are owned by root when restored. How can I run Backrest in Docker and respect file permissions and user:group?

Also, how can I run the container as a non-root user but still run HOOK commands with docker e.g. docker stop container? If I set user: 1000:1000 (my host user) in my compose, I get permission denied errors when running docker commands. Incidentally, I can run rclone commands. Also, when using user: 1000:1000, Backrest fails on files where that user doesn't have permission inside the container.

To simplify, I want to;

  • Run the container as 1000:1000 so bind mounts (/data, /config, /repos etc) have the same owner as my host.
  • Respect file permissions when restoring files.
  • Run docker commands without getting permission denied.
  • Run Backups on files/folders regardless of user:group.

Maybe it would be possible to to have env vars PUID and PGID that set the user inside the container. This user could also be added to the Docker group inside the container?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant