Rclone dockerized not showing files in the host

What is the problem you are having with rclone?

When Rclone mounts a remote directory as a dockerized application, the files on the host are not displayed.
In this case, this happened when I run ls /mnt/Scaleway command.
I tried the same command by installing rclone on the host and running the mount command directly on the host and everything worked perfectly. The problem is when I use docker.

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

rclone v1.58.1

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.0-1003-oracle (aarch64)
  • os/type: linux
  • os/arch: arm64
  • go/version: go1.17.9
  • go/linking: static
  • go/tags: none

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

Scaleway (Also tried with Mega)

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

version: "3.9"

services:
  rclone:
    container_name: rclone
    image: rclone/rclone:latest
    restart: unless-stopped
    privileged: true
    volumes:
      - /etc/passwd:/etc/passwd:ro
      - /etc/group:/etc/group:ro
      - /mnt:/data:rshared
      - config:/config/rclone
      - logs:/logs
    command: "mount scaleway:fedex-dev-nextcloud /data/Scaleway --debug-fuse --allow-other --log-level DEBUG --log-file /logs/scaleway.log --gid 1001 --uid 1001"
    environment:
      - PHP_TZ=Europe/Madrid
      - PUID=1001
      - PGID=1001
    cap_add:
      - SYS_ADMIN
    devices:
      - /dev/fuse
    security_opt:
      - apparmor:unconfined

volumes:
  logs:
  config:

The rclone config contents with secrets removed.

[mega]
type = mega
user = removed
pass = removed

[scaleway]
type = s3
storage_class = ONEZONE_IA
provider = Scaleway
access_key_id = removed
secret_access_key = removed
region = fr-par
endpoint = s3.fr-par.scw.cloud
acl = private

A log from the command with the -vv flag

2022/06/26 19:29:19 DEBUG : rclone: Version "v1.58.1" starting with parameters ["rclone" "mount" "scaleway:fedex-dev-nextcloud" "/data/Scaleway" "--debug-fuse" "--allow-other" "--log-level" "DEBUG" "--log-file" "/logs/scaleway.log" "--gid" "1001" "--uid" "1001"]
2022/06/26 19:29:19 DEBUG : Creating backend with remote "scaleway:fedex-dev-nextcloud"
2022/06/26 19:29:19 DEBUG : Using config file from "/config/rclone/rclone.conf"
2022/06/26 19:29:19 INFO  : S3 bucket fedex-dev-nextcloud: poll-interval is not supported by this remote
2022/06/26 19:29:19 DEBUG : S3 bucket fedex-dev-nextcloud: Mounting on "/data/Scaleway"
2022/06/26 19:29:19 DEBUG : : Root:
2022/06/26 19:29:19 DEBUG : : >Root: node=/, err=<nil>

Finally, it is working!!
For anyone who face the same problem, at least in my setup, docker compose doesnt like this syntaxis to declare shared propagation:

...
    volumes:
      - /etc/passwd:/etc/passwd:ro
      - /etc/group:/etc/group:ro
      - /mnt:/data:shared  # replace this with ....
...
...
    volumes:
      - /etc/passwd:/etc/passwd:ro
      - /etc/group:/etc/group:ro
      - type: bind     # this other syntax
        source: /mnt
        target: /data
        bind:
          propagation: shared
...

Also, check your permissions for the /mnt/directory, I keep all files (logs, config and mnt directories) as root

1 Like

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