borgmatic-collective / docker-borgmatic

Borgmatic in Docker
GNU General Public License v3.0
314 stars 88 forks source link

bash_completion.sh: No such file or directory #268

Closed ilium007 closed 9 months ago

ilium007 commented 9 months ago

Not a biggie but when you enter the docker image with bash the intended bash_completion is not in the location that is sourced in .bashrc:

xxxx@synology01:~$ sudo docker run --hostname borgbackup-synology01 --rm -it -v /volume1/photos/:/mnt/photos/ -v /volume1/borgbackup/borgmatic.d:/etc/borgmatic.d/ -v /volume1/borgbackup/.config/borg:/root/.config/borg -v /volume1/borgbackup/.ssh:/root/.ssh -v /volume1/borgbackup/.cache/borg:/root/.cache/borg -e TZ=Australia/Sydney ghcr.io/borgmatic-collective/borgmatic bash
borgmatic 1.8.2
borg 1.2.6
apprise 1.5.0
bash: /etc/profile.d/bash_completion.sh: No such file or directory
borgbackup-synology01:/#

The issue seems to be in the Dockerfile where the bash completion is piped to a different location to what is sourced into /root/.bashrc:

RUN borgmatic --bash-completion > /usr/share/bash-completion/completions/borgmatic && echo "source /etc/profile.d/bash_completion.sh" > /root/.bashrc
grantbevis commented 9 months ago

If you're able to, raise a PR with the fix and I'll review

ilium007 commented 9 months ago

PR raised: https://github.com/borgmatic-collective/docker-borgmatic/pull/269