docker-volume-rclone
docker-volume-rclone copied to clipboard
Integrate rclone process
Three notes on rclone integration:
-
mount Currently when docker-volume-rclone starts an rclone mount it has to manually check.... that the mount has been successful. In the next release (v1.54 or v1.55)
rclone mount --daemon remote: /mnt/path
will natively fork and internally perform a check similar to isMounted().... and returnexit code 1
if it fails (see https://github.com/rclone/rclone/issues/2968#issuecomment-716679470 and below). That change is currently being planned. -
unmount The rclone background process will stop a mount on one of two conditions: signal 15 (requires pid, not used here) or external unmount, so that docker-volume-rclone's method.... continues to work. Just a note: it uses root-only
umount
whilefusermount -u
could be run by a non-root user that made a mount (with fallback to umount if package fuse is not installed). Also, both umount and fusermount -u will fail if a process keeps using the directory mounted. To be more robust, docker-volume-rclone could fallback toumount -l
orfusermount -u -l
after a timeout to avoid cascading deadlocks in docker applications. -
zombies After unmount the rclone background process should be normally reaped by systemd but in a docker container this is not done by default. This issue was mentioned in https://github.com/vieux/docker-volume-sshfs/issues/78, discussed in https://github.com/trajano/docker-volume-plugins/issues/29 and fixed in https://github.com/trajano/docker-volume-plugins/pull/30#issuecomment-700856794 (see the config.json patch....). docker-volume-rclone also needs to incorporate
tini
in its config to avoid zombies.
While embedding rclone as a library is out of scope of this issue, FYI there is a ticket https://github.com/rclone/rclone/issues/633 to implement support for that in future.
I think it should be fairly possible to add a rclone serve docker
command exposing a docker volume api if allowed by rclone maintainers.