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

Difficulty running this container as non-root user -- Suggestions? #45

Closed
kevdogg opened this issue Feb 19, 2022 · 2 comments
Closed

Difficulty running this container as non-root user -- Suggestions? #45

kevdogg opened this issue Feb 19, 2022 · 2 comments
Labels
enhancement New feature or request type: backup

Comments

@kevdogg
Copy link

kevdogg commented Feb 19, 2022

I took your image and rebuilt is using a Dockerfile:

FROM ttionya/vaultwarden-backup:latest

# Referenced image uses busybox

ENV BITWARDEN_GID=8081
ENV BITWARDEN_UID=8081
ENV BITWARDEN_USER=bitwarden
ENV BITWARDEN_GROUP=bitwarden

RUN addgroup -g $BITWARDEN_GID bitwarden
RUN adduser -u $BITWARDEN_UID -G $BITWARDEN_GROUP -D -H -g '' $BITWARDEN_USER

USER $BITWARDEN_USER

I then started the container to create the config like this:

sudo docker run --rm -it --mount type=bind,source=/home/bitwarden/.config/vaultwarden_backup,target=/config --user 8081:8081 bitwardenrs-rclone:latest rclone config

The container started, however the directory that was created --> /home/bitwarden/.config/vaultwarden_backup/rclone --> was owned by the root user.
The container however tried to write rclone.conf within this directory as the non-root user, however it could create this file due to permissions.

In summary -- the rclone subdirectory was created as the root user, but the rclone.conf file was created as the non-root user.

@ttionya
Copy link
Owner

ttionya commented Feb 19, 2022

Hey @kevdogg ,

I tried to run the container with a non-root user (with --user 8081:8081) and generate a new configuration file, but the owner of the /home/bitwarden/.config/vaultwarden_backup/rclone directory is 8081.

Make sure you use user 8081 every time you run the container? Try deleting the /rclone directory and retry.

@ttionya ttionya added the troubleshooting There might be bug or it could be user error, more info needed label Feb 20, 2022
@ttionya
Copy link
Owner

ttionya commented Jun 30, 2022

See #47

@ttionya ttionya added enhancement New feature or request type: backup and removed troubleshooting There might be bug or it could be user error, more info needed labels Jun 30, 2022
@ttionya ttionya closed this as completed in c24263d Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request type: backup
Projects
None yet
Development

No branches or pull requests

2 participants