All Projects → sapk → docker-volume-rclone

sapk / docker-volume-rclone

Licence: MIT license
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).

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-volume-rclone

docker-volume-git
Docker Volume GIT plugin allows to mount git repository in container
Stars: ✭ 23 (-76.29%)
Mutual labels:  docker-plugin, docker-volume-plugin
docker-volume-linode
Docker Volume driver for Linode Block Storage
Stars: ✭ 39 (-59.79%)
Mutual labels:  docker-plugin, docker-volume
Cloud Media Scripts
Upload and stream media from the cloud with or without encryption. Cache all new and recently streamed media locally to access quickly and reduce API calls
Stars: ✭ 84 (-13.4%)
Mutual labels:  rclone
docker-volume-hetzner
Docker Volume Plugin for accessing Hetzner Cloud Volumes
Stars: ✭ 81 (-16.49%)
Mutual labels:  docker-volume-plugin
Rclonetray
Simple cross-platform GUI for Rclone
Stars: ✭ 148 (+52.58%)
Mutual labels:  rclone
Aria2.conf
Aria2 配置文件 | OneDrive & Google Drvive 离线下载 | 百度网盘转存
Stars: ✭ 1,321 (+1261.86%)
Mutual labels:  rclone
Gooby
Gooby: The ultimate infinite Plex media server using a VPS and Cloud service
Stars: ✭ 230 (+137.11%)
Mutual labels:  rclone
Rclonebrowser
Simple cross platform GUI for rclone
Stars: ✭ 1,162 (+1097.94%)
Mutual labels:  rclone
Any-file-to-Google-Drive
This Google Colab notebook will help you download any file directly to Google Drive with the help of the JDownloader web interface
Stars: ✭ 47 (-51.55%)
Mutual labels:  rclone
Ytdlrc
☁️ Downloads videos and metadata with youtube-dl and moves each file on completion to an rclone remote
Stars: ✭ 140 (+44.33%)
Mutual labels:  rclone
scripts
Scripts for managing my Ubuntu / Rclone / Plex Server
Stars: ✭ 20 (-79.38%)
Mutual labels:  rclone
Plexguide.com
Welcome to https://PlexGuide.com ~ Rapidly deploy multiple-hasty Docker Containers through Ansible with local or Unlimited Google HD Space!
Stars: ✭ 1,631 (+1581.44%)
Mutual labels:  rclone
Cloudbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 1,763 (+1717.53%)
Mutual labels:  rclone
Rcloneosx
A macOS GUI for rclone
Stars: ✭ 249 (+156.7%)
Mutual labels:  rclone
Kube Rclone
kube-rclone is a rclone mount solution for Kubernetes
Stars: ✭ 87 (-10.31%)
Mutual labels:  rclone
Rclonewrapper
Simple wrapper to use rclone in your PHP projects.
Stars: ✭ 17 (-82.47%)
Mutual labels:  rclone
Plexus
A suite of tools to help manage your media collection.
Stars: ✭ 78 (-19.59%)
Mutual labels:  rclone
Rcloneexplorer
rclone GUI for Windows
Stars: ✭ 129 (+32.99%)
Mutual labels:  rclone
Plexinthecloud
Scripts to install & configure: Plex, nzbget, sickrage, couchpotato, mylar, with rclone mounted Google Drive storage and full post-processing.
Stars: ✭ 148 (+52.58%)
Mutual labels:  rclone
TorrentLeechBot
A powerful telegram mirror bot..
Stars: ✭ 94 (-3.09%)
Mutual labels:  rclone

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].