How to properly set up rclone with docker-compose?

Hello,
I find the official documentation on setting up rclone with Docker rather confusing, I've got a few questions on how am I actually meant to use it. I would be very grateful if someone would share working configuration of rclone on Docker.

Here is my current Docker-compose config:

version: "3.4"

services:
    rclone_backup:
        image: rclone/rclone:latest
        container_name: rclone_backup
        restart: unless-stopped
        volumes:
            - ./rclone/config:/config/rclone
        user: "${UID}:${GID}"
        command: tail -f /dev/null
  1. How to do actual configuration of rclone? I've pulled rclone's docker image, but executing it does nothing interesting (it runs rclone command by default, which prints help). I can't run rclone config through docker-compose as this command is interactive and docker-compose is not. Am I supposed to log in inside container and run rclone config or generate config outside container and then copy/paste it inside?
  2. How to keep it running? As you can see in my docker-compose config, I've tried to use tail -f /dev/null to keep it running, but it doesn't work in this case. Container keeps restarting.

Thank you in advance for your help.

hello and welcome to the forum,

  1. do the rclone config on the host, and point the docker to it, as per the docs.
    "You need to mount the host rclone config dir at /config/rclone into the Docker container. Due to the fact that rclone updates tokens inside its config file, and that the update process involves a file rename, you need to mount the whole host rclone config dir, not just the single host rclone config file."
  2. most, but not all, rclone commands runs then exit after completion. if you need something specific, let us know.....

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