Comments (6)
I’ll give it a try, but I’ve never used go, so don’t put too much hopes in my attempts ;-).
I’m currently busy but when I got a minute I’ll give it a shot.
from rclone.
Do you want to make a patch for this? We don't currently have maintainer for the docker plugin.
from rclone.
I have recently set up the rclone docker volume plugin for docker in rootless-mode using a custom systemd service (basically the systemd setup as described in the docs, but with adjusted paths) instead of the docker plugin install
command. Works without problems so far.
Here are the basic steps:
- Create
~/.config/systemd/user/docker-volume-rclone.service
:[Unit] Description=Docker Volume Plugin for rclone (Rootless) Before=docker.service After=network.target docker-volume-rclone.socket Requires=docker-volume-rclone.socket docker.service [Service] ExecStart=/usr/bin/rclone serve docker \ --base-dir $HOME/.local/share/docker-volumes/rclone \ --socket-addr $XDG_RUNTIME_DIR/docker/plugins/rclone.sock ExecStartPre=/usr/bin/mkdir -p $HOME/.local/share/docker-volumes/rclone ExecStartPre=/usr/bin/mkdir -p $HOME/.local/share/docker-plugins/rclone/config ExecStartPre=/usr/bin/mkdir -p $HOME/.local/share/docker-plugins/rclone/cache Environment=RCLONE_CONFIG=$HOME/.local/share/docker-plugins/rclone/config/rclone.conf Environment=RCLONE_CACHE_DIR=$HOME/.local/share/docker-plugins/rclone/cache Environment=RCLONE_VERBOSE=1 [Install] WantedBy=default.target
- Create
~/.config/systemd/user/docker-volume-rclone.socket
:[Unit] Description=Docker Volume Plugin for rclone (Rootless) [Socket] ListenStream=$XDG_RUNTIME_DIR/docker/plugins/rclone.sock [Install] WantedBy=sockets.target
- Reload system units with
systemctl --user daemon-reload
- Start the rclone volume plugin with
systemctl --user start docker-volume-rclone.socket && systemctl --user start docker-volume-rclone.service
Important
You should replace the environment variables ($HOME
, $XDG_RUNTIME_DIR
, etc.) with their respective values in the systemd file. It don't think systemd will replace them itself.
So pretty much replace $HOME
with /home/<username>
and $XDG_RUNTIME_DIR
with /run/user/<uid>
Let me know if you have problems setting this up and I'll try to help!
from rclone.
I have recently set up the rclone docker volume plugin for docker in rootless-mode using a custom systemd service (basically the systemd setup as described in the docs, but with adjusted paths) instead of the
docker plugin install
command. Works without problems so far.Here are the basic steps:
- Create
~/.config/systemd/user/docker-volume-rclone.service
:[Unit] Description=Docker Volume Plugin for rclone (Rootless) Before=docker.service After=network.target docker-volume-rclone.socket Requires=docker-volume-rclone.socket docker.service [Service] ExecStart=/usr/bin/rclone serve docker \ --base-dir $HOME/.local/share/docker-volumes/rclone \ --socket-addr $XDG_RUNTIME_DIR/docker/plugins/rclone.sock ExecStartPre=/usr/bin/mkdir -p $HOME/.local/share/docker-volumes/rclone ExecStartPre=/usr/bin/mkdir -p $HOME/.local/share/docker-plugins/rclone/config ExecStartPre=/usr/bin/mkdir -p $HOME/.local/share/docker-plugins/rclone/cache Environment=RCLONE_CONFIG=$HOME/.local/share/docker-plugins/rclone/config/rclone.conf Environment=RCLONE_CACHE_DIR=$HOME/.local/share/docker-plugins/rclone/cache Environment=RCLONE_VERBOSE=1 [Install] WantedBy=default.target
- Create
~/.config/systemd/user/docker-volume-rclone.socket
:[Unit] Description=Docker Volume Plugin for rclone (Rootless) [Socket] ListenStream=$XDG_RUNTIME_DIR/docker/plugins/rclone.sock [Install] WantedBy=sockets.target
- Reload system units with
systemctl --user daemon-reload
- Start the rclone volume plugin with
systemctl --user start docker-volume-rclone.socket && systemctl --user start docker-volume-rclone.service
Important
You should replace the environment variables (
$HOME
,$XDG_RUNTIME_DIR
, etc.) with their respective values in the systemd file. It don't think systemd will replace them itself. So pretty much replace$HOME
with/home/<username>
and$XDG_RUNTIME_DIR
with/run/user/<uid>
Let me know if you have problems setting this up and I'll try to help!
Hi,
I may have appeared out of the blue, but I would really like some helping hand. I am not using a systemd-based distro (alpine), but as far as I could understand, this does not really involve anything related to systemd. Could you describe exactly how you utilize this setup with examples using a mount from rclone?
Thanks a lot!
from rclone.
@srfsh wrote:
I may have appeared out of the blue, but I would really like some helping hand. I am not using a systemd-based distro (alpine), but as far as I could understand, this does not really involve anything related to systemd. Could you describe exactly how you utilize this setup with examples using a mount from rclone?
I'm not sure I can help in this case since I've never used anything other than systemd. Does your distro use some other service manager? You basically need a service which runs the rclone serve docker
command in the background and handles the socket file and other prerequisites like env vars, folders, and startup order.
from rclone.
@srfsh wrote:
I may have appeared out of the blue, but I would really like some helping hand. I am not using a systemd-based distro (alpine), but as far as I could understand, this does not really involve anything related to systemd. Could you describe exactly how you utilize this setup with examples using a mount from rclone?I'm not sure I can help in this case since I've never used anything other than systemd. Does your distro use some other service manager? You basically need a service which runs the
rclone serve docker
command in the background and handles the socket file and other prerequisites like env vars, folders, and startup order.
I thought maybe you had some other hidden (as in forgotten) commands that you used to bind things together.
But I have good news. You don't need to bother with this at all. Here is what you have to do:
- Define where you'll put your rclone config and the cache directories.
$HOME/.local/share/docker-plugins
seems to be a nice place in terms of mimicking/var/lib/docker
and/var/lib/docker-plugins
. The config directory must have a single file calledrclone.conf
. I am not sure about the very purpose of the cache directory. Seems to hold a single file with a dummy content. Maybe if I tweak with vfs, it would be populated. Yet to experiment. - Create the directories. I choose the
$HOME/.local/share/docker/rclone
since I didn't want to have an extradocker-plugins
directory, which I won't be using either way, laying around. For instance:mkdir -p .local/share/docker/rclone/config .local/share/docker/rclone/cache
. - Place your
rclone.conf
file under the config directory you've just created. - Make sure your rootless dockerd is running. Uninstall the rclone plugin if you had installed it previously. Then install it again with:
docker plugin install --alias rclone --disable --grant-all-permissions rclone/docker-volume-rclone:amd64
. With this, we are essentially not enabling it just for the time being, to let us configure it. - Set your desired config and cache directories. This step is the essential part where it makes it possible to use the plugin with rootless dockerd:
docker plugin set rclone "config=$HOME/.local/share/docker/rclone/config/" "cache=$HOME/.local/share/docker/rclone/cache/"
. Again, the paths could be tweaked as your heart desires. The most important one is the config, which holds ourrclone.conf
file. - Enable the plugin and enjoy your free time:
docker plugin enable rclone
. - (Optional) Create a volume using the aliased driver name
rclone
:docker volume create mygdrive -d rclone -o remote=gdrive:
. - (Optional) Enjoy it even more using Alpine:
docker run --rm -it -v mygdrive:/hellofromgdrive alpine ls /hellofromgdrive
I hope that helps. I have only tested it on Alpine v3.20.3 (the latest as of writing).
from rclone.
Related Issues (20)
- mailru backend "invalid characters in object name" for paths containing U+0439 (cyrylic й) on macos HOT 4
- Deprecate the current SIA backend. HOT 3
- Error on folder rename (new or existing one) HOT 1
- Publish & tag beta versions of rclone/docker-volume-rclone HOT 3
- Unable to perform server-side copy between two Azure Blob Storage accounts HOT 3
- can't set config_is_local or config_refresh_token when using rcd config/create endpoint HOT 4
- Fish shell completions error HOT 2
- completion of remote paths fails on spaces HOT 3
- This program can only be run on AMD64 processors with v3 microarchitecture support. HOT 7
- v1.68.0 Docker image build failed HOT 10
- `RCLONE_` prefixed environment variables for multi-valued options not working in v1.68.0 HOT 7
- DigitalOcean setup with env variables is not working anymore HOT 7
- Git-Annex Clone to Dropbox Fails HOT 3
- rclone is ignoring --s3-upload-cutoff 5G, uploads a 4.5G file as multipart HOT 2
- Backblaze with Crypt HOT 2
- Backblaze directory markers PBS datastore HOT 4
- `--rc-addr` argument for rc command not functioning as expected in v1.68.0 HOT 1
- panic during copy HOT 6
- AzureBlobStorage Env_Auth setting forces system managed identity HOT 7
- Unable to copy to FTP Write-Only Directories HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rclone.