• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    Go
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use Rclone as a backend for docker volume (also as a plugin). This permit to easely mount a lot of cloud provider (https://rclone.org/overview).

docker-volume-rclone License Project Status

GitHub release Go Report Card codecov master : Travis master develop : Travis develop

Use Rclone as a backend for docker volume. This permit to easely mount a lot of cloud provider (https://rclone.org/overview/).

Status : BETA (work and in use but still need improvements)

Use Rclone cli in the plugin container so it depend on fuse on the host.

Docker plugin (Easy method) Docker Pulls ImageLayers Size

docker plugin install sapk/plugin-rclone
docker volume create --driver sapk/plugin-rclone --opt config="$(base64 ~/.config/rclone/rclone.conf)" --opt remote=some-remote:bucket/path --name test
docker run -v test:/mnt --rm -ti ubuntu

Build

make

Start daemon

./docker-volume-rclone daemon
OR in a docker container
docker run -d --device=/dev/fuse:/dev/fuse --cap-add=SYS_ADMIN --cap-add=MKNOD  -v /run/docker/plugins:/run/docker/plugins -v /var/lib/docker-volumes/rclone:/var/lib/docker-volumes/rclone:shared sapk/docker-volume-rclone

For more advance params : ./docker-volume-rclone --help OR ./docker-volume-rclone daemon --help

Run listening volume drive deamon to listen for mount request

Usage:
  docker-volume-rclone daemon [flags]

Global Flags:
  -b, --basedir string   Mounted volume base directory (default "/var/lib/docker-volumes/rclone")
  -v, --verbose          Turns on verbose logging

Create and Mount volume

docker volume create --driver rclone --opt config="$(base64 ~/.config/rclone/rclone.conf)" --opt remote=some-remote:bucket/path --name test
docker run -v test:/mnt --rm -ti ubuntu

Allow acces to non-root user

Some image doesn't run with the root user (and for good reason). To allow the volume to be accesible to the container user you need to add some mount option: --opt args="--uid 1001 --gid 1001 --allow-root --allow-other".

For example, to run an ubuntu image with an non root user (uid 33) and mount a volume:

docker volume create --driver sapk/plugin-rclone --opt config="$(base64 ~/.config/rclone/rclone.conf)" --opt args="--uid 33 --gid 33 --allow-root --allow-other" --opt remote=some-remote:bucket/path --name test
docker run -i -t -u 33:33 --rm -v test:/mnt ubuntu /bin/ls -lah /mnt

Docker-compose

First put your rclone config in a env variable:

export RCLONE_CONF_BASE64=$(base64 ~/.config/rclone/rclone.conf)

And setup you docker-compose.yml file like that

volumes:
  some_vol:
    driver: sapk/plugin-rclone
    driver_opts:
      config: "${RCLONE_CONF_BASE64}"
      args: "--read-only --fast-list"
      remote: "some-remote:bucket/path"

You can also hard-code your config in the docker-compose file in place of the env variable.

Healthcheck

The docker plugin volume protocol doesn't allow the plugin to inform the container or the docker host that the volume is not available anymore. To ensure that the volume is always live, It is recommended to setup an healthcheck to verify that the mount is responding.

You can add an healthcheck like this example:

services:
  server:
    image: my_image
    healthcheck:
      test: ls /my/rclone/mount/folder || exit 1
      interval: 1m
      timeout: 15s
      retries: 3
      start_period: 15s

Inspired from :

How to debug docker managed plugin :

#Restart plugin in debug mode
docker plugin disable sapk/plugin-rclone
docker plugin set sapk/plugin-rclone DEBUG=1
docker plugin enable sapk/plugin-rclone

#Get files under /var/log of plugin
runc --root /var/run/docker/plugins/runtime-root/plugins.moby list
runc --root /var/run/docker/plugins/runtime-root/plugins.moby exec -t $CONTAINER_ID cat /var/log/rclone.log
runc --root /var/run/docker/plugins/runtime-root/plugins.moby exec -t $CONTAINER_ID cat /var/log/docker-volume-rclone.log

More Repositories

1

docker-volume-gluster

Use GlusterFS as a backend for docker volume (also as a plugin)
Go
94
star
2

dockerfiles

Various Dockerfiles
Dockerfile
45
star
3

docker-volume-gvfs

Use GVfs as a backend for docker volume
Go
13
star
4

vue-svg-charts

Simple charts build with svg without external deps
Vue
6
star
5

simplerak

Simplement affiche le menu du rak du jour en cours et des suivants.
Vue
6
star
6

go-genesys

Go library to communicate with Genesys
Go
5
star
7

docker-lab-genesys

A custom Genesys lab setup on docker
Shell
4
star
8

jrecon

Un logiciel de découverte réseau local et web.
Java
3
star
9

genesys-tools

A cli command to interact with GAX api
Go
3
star
10

pharma-quiz-app

Quiz Pharma (Valeurs Normales)
HTML
2
star
11

benthos-plugin-sereal

Add sereal encoding and decoding support to benthos via bloblang plugin
Go
2
star
12

got

Go implementation of map tile server
Go
2
star
13

rtme-browser

Display informations from Genesys RTME table that can be usefull for debugging
Go
2
star
14

docker-volume-helpers

Common base for multiple docker volume plugin.
Go
2
star
15

bonamy

Application mobile de decouverte de la botanique, d'un point de vue ludique ou didactique. L'application utilise les données ouvertes de la ville de Nantes.
JavaScript
2
star
16

go-photon

A tools to manage .photon files for anycubic photon printer (heavily based on: https://github.com/fookatchu/SL1toPhoton)
Go
2
star
17

gocqlcli

A simple wrapper around https://github.com/gocql/gocql to execute script file (try to keep compat args with cqlsh)
Go
2
star
18

simple-two-factor-auth

A simple script to enable two-factor auth by mail.
Shell
1
star
19

GoWatch

Simple network visualizer
Go
1
star
20

bug-rclone

a repo with data for reproduce a rclone bug.
1
star
21

benthos-plugin-couchbase

Add couchbase processor to retrieve and update document from couchbase.
Go
1
star
22

gitea-explore-webapp

Vue
1
star
23

simple_bench

Some stupid bench to determine some micro optimization
Go
1
star
24

Make-Them-Slow-Down

A Node.JS app to reduce the Slashdot effect
1
star
25

gitea-explore

A POC for indexing public gitea instances (backup repo)
Go
1
star
26

bench-db

benchmark various database for testing
Go
1
star