By default, the container runs the backup script as the root user. If you wish to run the container as a non-root user, there are a few things you need to set.
You can use the built-in non-root user and group, named backuptool, with the UID and GID of 1100.
- Make sure that the rclone config file in the mounted
rclone-backup-datavolume is writable bybackuptooluser.
# enter the container
docker run --rm -it \
--mount type=volume,source=rclone-backup-data,target=/config/ \
--entrypoint=bash \
adrienpoupa/rclone-backup:latest
# modify the rclone config file owner in the container
chown -R 1100:1100 /config/
# exit the container
exit- If you want a full backup of the
rsa_key*, you need to allow thebackuptooluser to read thersa_key*.
With Docker Compose
# enter the container
docker run --rm -it \
--mount type=volume,source=rclone-backup-data,target=/data/ \
--entrypoint=bash \
adrienpoupa/rclone-backup:latest
# make files readable for all users in the container
chmod -R +r /data/
# exit the container
exitWith Automatic Backups
# enter the container
docker run --rm -it \
--volumes-from=your-container \
--entrypoint=bash \
adrienpoupa/rclone-backup:latest
# make files readable for all users in the container
chmod -R +r /data/
# exit the container
exit- Start the container with proper parameters.
With Docker Compose
# docker-compose.yml
services:
backup:
image: adrienpoupa/rclone-backup:latest
user: 'backuptool:backuptool'
...With Automatic Backups
docker run -d \
...
--user backuptool:backuptool \
...
adrienpoupa/rclone-backup:latestPerform the restore normally, nothing special.