It is possible to run rclone inside the docker container and mount the folder to host?

What is the problem you are having with rclone?

Using rclone inside docker so I don't have to deal with systemd and it is easier to migrate. With the config properly set up, I want to mount the remotes and access them in the host machine.

Run the command 'rclone version' and share the full output of the command.

Pulling via docker hub

The latest

Which cloud storage system are you using? (eg Google Drive)

Backblaze B2

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Not specifically a command.

The rclone config contents with secrets removed.

[1]
type = b2
account = xxx
key = xxx
hard_delete = true

[2]
type = b2
account = xxx
key = xxx
hard_delete = true

[1-encrypted]
type = crypt
remote = 1:encrypted
password = xxx
password2 = xxx

A log from the command with the -vv flag

No log

Compose file

version: "3.4"

services:
    rclone_backup:
        image: rclone/rclone:latest
        container_name: rclone
        restart: unless-stopped
        volumes:
            - ./config:/config/rclone
        user: "1000:1000"
        #command: some type of mount command?

hi,
as i understand it, rclone can do that.
https://rclone.org/install/

1 Like

Took me a day, this is the prize:

version: '3.3'
services:
    rclone0:
        image: rclone/rclone:latest
        volumes:
            - ./config:/config/rclone
            - ./data:/data:shared
            - /etc/passwd:/etc/passwd:ro
            - /etc/group:/etc/group:ro
            - /etc/fuse.conf:/etc/fuse.conf:ro
        devices:
            - /dev/fuse:/dev/fuse:rwm
        cap_add:
            - SYS_ADMIN
        security_opt:
            - apparmor:unconfined
        user: 1000:1000
        network_mode: npm_default
        container_name: rclone0
        command: 'serve webdav xxx: --addr :8080 --user xxx --pass xxx --vfs-cache-mode full --cache-dir=/data/cache/0'

    rclone1:
        image: rclone/rclone:latest
        volumes:
            - ./config:/config/rclone
            - ./data:/data:shared
            - /etc/passwd:/etc/passwd:ro
            - /etc/group:/etc/group:ro
            - /etc/fuse.conf:/etc/fuse.conf:ro
        devices:
            - /dev/fuse:/dev/fuse:rwm
        cap_add:
            - SYS_ADMIN
        security_opt:
            - apparmor:unconfined
        user: 1000:1000
        container_name: rclone1
        command: 'mount xxx: xxx --allow-other --vfs-cache-mode full --cache-dir=/data/cache1'

Now I want to know, is there a way to avoid the transport endpoint not connected problem?

2 Likes

not an expert at docker but if you want the host to see port 8080, don't you need to something like this

ports:
  - 8080:8080

No not really, I actually switched to SFTP because that works so much better with nextcloud. I actually use the mount to host for my uploads using rsync.

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