Rclone in gitlab pipeline

Hi,

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...

welcome to the forum,

not sure what the issue, just wanted to point out

  1. to find the config file, rclone config file
  2. to hardcode the config file location, --config=

Many thanks! I'll try that.

$ 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

find the config file inside docker, without using rclone.
or
if you want to use rclone, try something like
rclone ls / --include=rclone.conf

$ 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

I get the same notice

ok. so not a rclone issue.

this worked for me

docker run --rm --volume $(pwd)/.config/rclone:/mnt rclone/rclone --config=/mnt/rclone.conf -vv listremotes
2024/08/26 22:58:16 DEBUG : rclone: Version "v1.67.0" starting with parameters ["rclone" "--config=/mnt/rclone.conf" "-vv" "listremotes"]
2024/08/26 22:58:16 DEBUG : Using config file from "/mnt/rclone.conf"
zork:

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!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.