Docker Volume Plugin: Is there a way to map (or bind) the remote drive mounted inside the container with a local folder outside the container?

What is the problem you are having with rclone?

I have successfully mounted a remote drive in a docker container via the rclone Docker Volume Plugin, and everything works fine within the container.

I am wondering if it is possible to map that mounted drive to a local folder that is outside of the container?

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

❯ rclone version
rclone v1.63.0
- os/version: arch (64 bit)
- os/kernel: 6.3.7-arch1-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.5
- go/linking: dynamic
- go/tags: none

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

Google Drive

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

docker plugin install rclone/docker-volume-rclone:amd64 args="-v" --alias rclone --grant-all-permissions
docker plugin rclone disable
docker plugin set rclone RCLONE_VERBOSE=2 args="--uid 1000 --gid 1000 --umask 022 --buffer-size 128M"
docker plugin rclone enable

The rclone config (unnecessary) docker compose contents with secrets removed.

compose.yaml
❯ cat compose.yaml
version: "3.8"

networks:
  default:
    name: base
    driver: bridge
    attachable: true

volumes:
  gd:
    name: gd
    driver: rclone
    driver_opts:
      remote: 'g:'
      allow_other: 'true'
      vfs_cache_mode: full
      vfs_cache_max_size: 100G
      vfs_cache_max_age: 12h
      dir_cache_time: 168h
      poll_interval: 0

services:
  busybox:
    image: busybox:latest
    container_name: busybox
    tty: true
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=EST
    volumes:
      - gd:/mnt/gd

A log from the command with the -vv flag

N/A

Question

So, when I am inside the container busybox, I can access the remote drive gd fine at /mnt/gd (container fs). I am wondering if it is possible to map (or bind) a local folder outside the docker container, say ~/gd (local machine fs) to the volume gd mounted within the busybox docker container? So that I don't need to mount the remote drive with another dedicated rclone daemon.

Any help is much appreciated. Thank you!

I think you might have more luck answering this question on docker forum as it is about docker not rclone functionality.

1 Like

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