Rclone as a Docker Plugin

Not really a rclone problem, but maybe a implementation problem.

I'm trying to move my working plex setup up to a dockerised setup, so I have moved plex to a container but am unable to mount the rclone windows mount as a volume.
plex docker-compose.yaml:

version: '3'
services:
    pms-docker:
        image: plexinc/pms-docker:plexpass
        container_name: plex
        ports:
            - '32400:32400/tcp'
            - '3005:3005/tcp'
            - '8324:8324/tcp'
            - '32469:32469/tcp'
            - '1900:1900/udp'
            - '32410:32410/udp'
            - '32412:32412/udp'
            - '32413:32413/udp'
            - '32414:32414/udp'
        environment:
            - TZ=Australia/Brisbane
        env_file:
            - ./data/environment/plex.env
        volumes:
            - ./data/config:/config
            - ./data/transcode:/transcode
            - X:/:/mnt

I just get the error:

ERROR: for plex  Cannot create container for service pms-docker: The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.

Removing the X:/:/mnt and the plex docker works as it should, but with out access the mount

Ok, maybe its a windows thing, so rclone has a docker I'll try that.
rclone docker-compose.yaml:

version: '3'
services:
    rclone-docker:
        image: rclone/rclone
        container_name: rclone
        restart: unless-stopped
        command:
            - "mount crypt_gd: /data/media"
            - "--config /config/rclone.conf"
            - "--read-only"
            - "--allow-other"
            - "--buffer-size 512M"
            - "--dir-cache-time 24h"
            - "--poll-interval 15s"
            - "--timeout 1h"
            - "--user-agent 'yendorapp'"
        environment:
            - TZ=Australia/Brisbane
        volumes:
            - ./data/config:/config/rclone
            - ./data/logs:/logs
            - ./data/media:/data/media:shared
        cap_add:
            - SYS_ADMIN
        devices:
            - /dev/fuse
        security_opt:
            - apparmor:unconfined

but again I error out with:

ERROR: for rclone  Cannot start service rclone-docker: lstat /host_mnt: function not implemented

after googling for a while I found a github project sapk/docker-volume-rclone and it looks like a good idea, It uses rclone as a driver for a docker volume and then attaches the volume to the (plex) container:
plex with rclone volume docker-compose.yaml:

version: '3'
services:
    pms-docker:
        image: plexinc/pms-docker:plexpass
        container_name: plex
        ports:
            - '32400:32400/tcp'
            - '3005:3005/tcp'
            - '8324:8324/tcp'
            - '32469:32469/tcp'
            - '1900:1900/udp'
            - '32410:32410/udp'
            - '32412:32412/udp'
            - '32413:32413/udp'
            - '32414:32414/udp'
        environment:
            - TZ=Australia/Brisbane
            - PLEX_CLAIM=${PLEX_CLAIM}
        volumes:
            - ./data/config:/config
            - ./data/transcode:/transcode
            - media_vol:/mnt
        

volumes:
    media_vol:
        driver: sapk/plugin-rclone:latest
        driver_opts:
            config: ${RCLONE_CONFIG_BASE64}
            args: "--read-only --allow-other --buffer-size 512M --dir-cache-time 24h --poll-interval 15s --timeout 1h --user-agent 'yendorapp'"
            remote: "crypt_gd:"

environment file:

PLEX_CLAIM=claim-...
RCLONE_CONFIG_BASE64=W2dk...==

docker runs without error but there is no rclone mount, so this is where I got suck and am asking for help.

docker-compose exec pms-docker /bin/bash
root@61f52b2134df:/# ls -ahl /mnt/
total 8.0K
drwxr-xr-x 2 root root 4.0K Jan 15 02:51 .
drwxr-xr-x 1 root root 4.0K May 20 14:04 ..
root@61f52b2134df:/#

so does anyone else here have a plex docker running with a rclone mount on a windows 10 system? if so can you tell me how you got it running, Thanks.

You can do an rclone mount on a directory in windows. The directory has to be nonexistent (unlike unix). I don't know if you'll get better results with that rather than mounting it as a drive letter?

rclone mount remote: \path\to\dir

on windows, try running the mount as system user.

Thanks @ncw, tired doing a rclone mount (locally) to a directory and I can see my files through windows explorer but still got the plex container error:

ERROR: for plex  Cannot create container for service pms-docker: The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.

@asdffdsa have been running rclone mount as local system using nssm to set it up as a service, even running interactively via cli I still get the container errors when adding it as a volume.

Edit:
I got rclone working as a volume driver, the problem was the conversion of the config file to base64 windows powershell was doing it differently to a Linux os.

So I ssh in to my vps copied my rclone.conf and run

echo $(base64 ./data/rclone.config)
SGVsbG8gd29ybGQK

copied the output to the .env file for my plex container

PLEX_CLAIM=claim-...
RCLONE_CONFIG_BASE64="SGVsbG8gd29ybGQK"

and run docker-compose up on:

version: '3'
services:
    pms-docker:
        image: plexinc/pms-docker:plexpass
        container_name: plex
        ports:
            - '32400:32400/tcp'
            - '3005:3005/tcp'
            - '8324:8324/tcp'
            - '32469:32469/tcp'
            - '1900:1900/udp'
            - '32410:32410/udp'
            - '32412:32412/udp'
            - '32413:32413/udp'
            - '32414:32414/udp'
        environment:
            - TZ=Australia/Brisbane
            - PLEX_CLAIM=${PLEX_CLAIM}
        volumes:
            - ./data/config:/config
            - ./data/transcode:/transcode
            - media_vol:/mnt
        

volumes:
    media_vol:
        driver: sapk/plugin-rclone:latest
        driver_opts:
            config: ${RCLONE_CONFIG_BASE64}
            args: "--read-only --allow-other --buffer-size 512M --dir-cache-time 24h --poll-interval 15s --timeout 1h --user-agent 'yendorapp'"
            remote: "crypt_gd:"

plex starts and I can see my gdrive files under /mnt.

for reference I was using this in powershell to convert my rclone.conf to base64:

[Convert]::ToBase64String([IO.File]::ReadAllBytes('C:\rclone\rclone.conf'))
SGVsbG8gd29ybGQNCg==

but all in all I think running rclone as a volume is a good idea, easy to add to any container that needs access.

Thanks for the help.

1 Like