How does the rclone docker volume plugin work?

The rclone plugin looks awesome.
I wonder how does it use rclone ?
I mean, does it use a rclone executable, or a rclone library ?

I am asking since I will probably need my hack (cf rclone mount over S3 seems to do extra calls in large directories · Issue #5553 · rclone/rclone · GitHub) with the plugin, and since it does not seem to get attention, I will probably need to patch it myself.
What would then be the best way to patch the plugin ?

plugin is rclone serve docker running in plugin container

Thanks.

  • Where is the rclone executable stored ?
  • where does the docker plugin install fetches from ?
  • How can I modify it for my needs ? I suppose there's a github or dockerhub repo, how can I fork it, and how do I tell docker plugin install to use my forked plugin ?

Still looking where is the source code.
From docker plugin install rclone/docker-volume-rclone I would assume that it is a reference to a github repo.
But https://github.com/orgs/rclone/docker-volume-rclone does not seem to exist or be accessible.
Is this a private repo ? What did I miss ?

It's on docker not github.

https://hub.docker.com/u/rclone

it is based on the rclone serve docker command, source here:
https://github.com/rclone/rclone/tree/master/cmd/serve/docker

Yes thank you. But that's not what I'm asking.
If I want to do and test some hacks on that plugin, where do I start in practice ?
I need to be able to install my modified plugin, right ?

That's just reference the docker image or whatever. Not where is the source.

You may be looking for this:
rclone/Makefile#L273-L291 - GitHub

and in the contributing guide will find instructions to make an rclone development environment: rclone/CONTRIBUTING.md at master · rclone/rclone · GitHub

You may be looking for this:
Makefile#L273-L291

Yes, that looks really promising. Thanks!

Yeah, wasn't sure what you were asking.

@kforner
So you want make derivative kforner/docker-volume-rclone on docker hub.
First off, everything in rclone/docker-plugin-rclone is built from and by the main rclone repo.

I do have mine ivandeex/docker-volume-rclone on docker hub based on rclone master with a few patches that I need now, still waiting for ncw attention for some months.

The commit below has all you needed to derive a.t.m.:

Use the line PLUGIN_IMAGE_USER=kforner, reverse-engineer down to Makefile/Dockerfile and voila.

How does the docker plugin work?

RTFM Docker Volume Plugin

Managed plugin is in fact a special container running in a namespace separate from normal docker containers. Inside it runs the rclone serve docker command.

The config and cache directories are bind-mounted into the container at start. The docker daemon connects to a unix socket created by the command inside the container. The command creates on-demand remote mounts right inside, then docker machinery propagates them through kernel mount namespaces and bind-mounts into requesting user containers.