I am trying to integrate rclone into a gitlab pipeline and what I was thinking to do was to put the config file in a repository (I created a config folder in the repo and I added an empty rclone.conf file in it) and mount it in the rclone image but it doesn't seem to mount.
To be more specific, my pipeline looks something like this:
image: docker:latest
services:
- docker:dind
stages:
- test
test:
stage: test
before_script:
- echo "name_of_remote" >> config/rclone.conf
- echo "rest of the settings" >> config/rclone.conf
script:
- docker run --rm --volume $(pwd)/config:/config/rclone rclone/rclone listremotes
and what i get is
NOTICE: Config file "/config/rclone/rclone.conf" not found - using defaults
I tried this with rclone:latest and with rclone:beta (my goal is to use beta as I intend to connect to Proton Drive). I also tried with the option --user $(id -u):$(id -g) but every time I got the same result.
Also doing
docker run --rm --volume $(pwd)/config:/config/rclone rclone/rclone:beta ls /config/rclone
gives the same notification.
I am not sure what I am doing wrong because on my Debian 12 machine everything works like a charm...
$ docker run --rm --volume $(pwd)/config:/mnt rclone/rclone:beta --config=/mnt/rclone.conf listremotes
2024/08/26 13:32:59 NOTICE: Config file "/mnt/rclone.conf" not found - using defaults
$ docker run --rm -v ./config:/mnt rclone/rclone:beta ls /mnt
2024/08/26 15:03:30 NOTICE: Config file "/config/rclone/rclone.conf" not found - using defaults
so the file is not there so for some reason it is not mounting the volume, i guess
Actually, I got it fixed. the issue indeed was not with the rclone image but with the configuration of the docker executor in the gitlab runner. I switched to shell executor and the volume got mounted.
Many thanks for making me realize that!