Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Volume plugin not installing on Raspbian/ARM64 #5870

Closed
madhavtummala opened this issue Dec 14, 2021 · 32 comments
Closed

Docker Volume plugin not installing on Raspbian/ARM64 #5870

madhavtummala opened this issue Dec 14, 2021 · 32 comments

Comments

@madhavtummala
Copy link

madhavtummala commented Dec 14, 2021

What is the problem you are having with rclone?

rclone docker volume plugin fails installation

What is your rclone version (output from rclone version)

rclone v1.57.0

  • os/version: raspbian 11.1 (64 bit)
  • os/kernel: 5.10.63-v8+ (aarch64)
  • os/type: linux
  • os/arch: arm64
  • go/version: go1.17.2
  • go/linking: static
  • go/tags: none

Which OS you are using and how many bits (e.g. Windows 7, 64 bit)

Raspi OS, arm64

Which cloud storage system are you using? (e.g. Google Drive)

Google Drive

The command you were trying to run (e.g. rclone copy /tmp remote:tmp)

docker plugin install rclone/docker-volume-rclone:arm64 args="-v" --alias rclone --grant-all-permissions

A log from the command with the -vv flag (e.g. output from rclone -vv copy /tmp remote:tmp)

docker plugin install rclone/docker-volume-rclone:arm64 args="-v" --alias rclone --grant-all-permissions
amd64: Pulling from rclone/docker-volume-rclone
Digest: sha256:dd64dace6106c548bb75419fab36b6c04ca2394e542e10490e08ce62581f26c4
65cdd3e5660b: Complete
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/var/lib/docker-plugins/rclone/config" to rootfs at "/data/config" caused: stat /var/lib/docker-plugins/rclone/config: no such file or directory: unknown

I have the folders required for mounting,

pi@raspberrypi:~ $ ls -lrth /var/lib/docker-plugins/rclone/
total 8.0K
drwxr-xr-x 2 root root 4.0K Dec 14 15:24 config
drwxr-xr-x 2 root root 4.0K Dec 14 15:28 cache

I try to enable the rclone plugin, but it throws the error

pi@raspberrypi:~ $ docker plugin enable rclone:latest
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/var/lib/docker-plugins/rclone/config" to rootfs at "/data/config" caused: stat /var/lib/docker-plugins/rclone/config: no such file or directory: unknown
@Animosity022
Copy link
Collaborator

Did you follow the steps here? You've only listed one step.

https://rclone.org/docker/

@Animosity022
Copy link
Collaborator

As I think you picked the wrong architecture:

You have:

arm64

and tried to install amd64.

@madhavtummala
Copy link
Author

Hey, sorry updated the issue, I actually used arm64

@remidebette
Copy link

Hi, same issue here on macos Apple silicon (arm64) even after creating the folders:

sudo mkdir -p /var/lib/docker-plugins/rclone/config
sudo mkdir -p /var/lib/docker-plugins/rclone/cache

@Animosity022
Copy link
Collaborator

Yep, I think we need @ivandeex for some help here.

@Animosity022 Animosity022 added bug and removed question labels Dec 15, 2021
@DrSkunk
Copy link

DrSkunk commented Dec 26, 2021

Currently receiving the same error on Apple silicon (M1 Pro, arm64).

@asdffdsazqqq
Copy link
Contributor

hi, same issue on amd64, running wsl2 linux.
https://forum.rclone.org/t/docker-plugin-getting-error-oci-runtime-create-failed/28226

@lopelisoli
Copy link

I would just like to add that the same error is produced when running the docker plugin install command directly in a Windows Powershell:

rclone v1.57.0
- os/version: Microsoft Windows 10 Home Single Language 2009 (64 bit)
- os/kernel: 10.0.22000.376 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.2
- go/linking: dynamic
- go/tags: cmount

https://forum.rclone.org/t/installing-docker-volume-plugin-on-a-windows-host/28300

@ivandeex
Copy link
Member

ivandeex commented Dec 31, 2021

Guys, I can't help much with Mac's or anything Apple as I don't use/own their devices.
When we released the Arm64 plugin build, I tested it on Linux/Arm64, namely Oracle Ampere box.
The original PR author tested it somewhere else, on their available hardware/OS. I believe it was Linux too
You can look at the pull request history for details: #5462

Moreover, I don't really understand how Docker can work natively on MacOS. In my understanding, Docker is a user-space framework and wrapper around a number of LINUX kernel features such as process/mount/network namespaces and resource usage controllers named cgroups. MacOS is NOT Linux, I see it as a deeply reworked BSD platform. If Docker Inc released its product for MacOS they must be using with it some sort of Virtual machine running Linux kernel inside, like they did for Windows. In fact, it's box in box, with its virtual devices etc. I have written frankly and clearly in the plugin docs that
such configurations is NOT YET supported: https://rclone.org/docker/#running-plugin-under-systemd

However if one of you is desperate enough, you might want to give me a ssh access to your box. I will then allocate time and investigate how Docker works on your system and probably release a patch and submit it for the main rclone tree. Be aware that access to docker is in fact root access to your system. If you are not scared, PM me at gmail.com and let's discuss.

@animosity22
HAPPY NEW 2022 YEAR and deep THANK YOU from me for taking care of rclone tracker, janitoring and keeping it alive.

@asdffdsazqqq
Copy link
Contributor

hi, welcome back,

now i understand. when you wrote "Windows do not support native Docker plugins", that mean wsl, including wsl2g
thanks,

@ivandeex
Copy link
Member

ivandeex commented Jan 1, 2022

when you wrote "Windows do not support native Docker plugins", that mean wsl, including wsl2g

Docker Desktop on Windows will run some sort (don't ask me which one, probably Virtual Box, probably not, dunno) of virtual machine [vm1] under the hood, run docker engine in it to control Linux kernel in the same VM, then forward its virtual network interfaces to the outta world.

WSL2 will run another VM (Hyper-V this time) with its own set of virtual devices and network subnet, and another Linux kernel in it [vm2]. If you run systemd with native rclone plugin there, it will run on another Linux kernel. You can't easily make it talk to VM1 without a shaman dance (I can recommend you sacrifice a virgin on the power adapter crate).

Managed plugin (docker plugin install) will run special container with rclone in the same docker instance where you run your normal docker containers (vm1). That's what I meant.

WSL1 is a thin "dynamic library" converting some POSIX (libc.so) calls into Windows kernel (winnt.dll). No traces of Linux kernel and consequently Docker here, at all.

@ivandeex
Copy link
Member

ivandeex commented Jan 1, 2022

UPDATE
Even managed plugin has a problem with Docker Desktop on Windows. The plugin needs host directories for cache and config files. However in this case host is in fact a virtual machine (vm1). I don't yet know an easy way to create a directory in it. Until I know, consider even managed mode completely unsupported on Windows/MacOS.

Volunteers, welcome!

@ivandeex ivandeex added this to the Help Wanted milestone Jan 1, 2022
@Animosity022
Copy link
Collaborator

So I really don't use dockers as they over complicate things for me. I did some testing.

If I turn off a new file sharing, I can enable the plugin:

image

Here is my trying on the first line when the option was on:

etexter@seraphite docker-plugins % docker plugin enable rclone:latest
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/var/lib/docker-plugins/rclone/config" to rootfs at "/data/config" caused: stat /var/lib/docker-plugins/rclone/config: no such file or directory: unknown

I toggled it off / restarted and looks good now.

etexter@seraphite docker-plugins % docker plugin enable rclone:latest
rclone:latest
etexter@seraphite docker-plugins % docker plugin list
ID             NAME            DESCRIPTION                       ENABLED
421ebc1d37b0   rclone:latest   Rclone volume plugin for Docker   true

and now I get further.

etexter@seraphite docker-plugins % docker volume create firstvolume -d rclone -o type=sftp -o sftp-host=_hostname_ -o sftp-user=_username_ -o sftp-pass=_password_ -o allow-other=true
Error response from daemon: create firstvolume: VolumeDriver.Create: input too short when revealing password - is it obscured?

As a test and if I toggle it back on and try something. I tried adding that path into the file sharing section, but that didn't seem to fix it. If I get some more time, I'll play around a bit more.

@ivandeex
Copy link
Member

ivandeex commented Jan 1, 2022

The plugin needs host directories for cache and config files. However in this case host is in fact a virtual machine (vm1). I don't yet know an easy way to create a directory in it.

There may be a workaround. If you (1) don't care about rclone cache contents and (2) can configure your remote completely from docker volume create command line (normally it means you don't use GDrive, OneDrive or anything that uses OAuth tokens), then instead of creating /var/lib/docker-plugins/something you can change plugin's host directories to point at ANY existing directory in the virtual machine created by Docker Desktop. They must be using some stripped down Linux distro behind the scenes, so I guess at least /tmp will probably exist.

@ivandeex
Copy link
Member

ivandeex commented Jan 1, 2022

Again, frankly, I don't understand why all this pain. Docker engine is a native Linux child, you can use it on Linux without much hassle. Docker Desktop for Windows/MacOS introduces too much heavy stuff (VM, virtual net etc) behind the scenes to make Docker run in alien environment. It's rather for corporations bound to Windows/Mac due to policies or owner requirements. Too much hassle for a private developer.

@madhavtummala
Copy link
Author

Hi @ivandeex , I am using ubuntu server 21.04 arm64 on raspberry pi 4b. rclone volume plugin has not worked for me due to this path issue. I have an rclone config that works, and am currently using rclone mount for my docker containers through systemd at startup. I wanted to use it as a docker volume instead for better dependency management.

@ivandeex
Copy link
Member

ivandeex commented Jan 2, 2022

@madhavtummala
UPDATE
There must be something blocking docker daemon from bind-mounting /var/lib/docker-plugins/rclone/config into newly created OCI container for plugin. The directory exists but docker engine claims it does not exist. It's not just permissions issue as docker daemon runs as root. Probably an external process or kernel thread holds kernel (mount?) locks on the path.

Is the above path or one of its parents a mount? Run mount as root without options or just cat /proc/mounts. It will print the main kernel mount table. Does it contain our path or its parents?

If looking at the mount table does not help, let's stop docker daemon from contending on the problematic path with yet unknown lock holder. Make a temporary directory with unique name /rclone and try to use it for plugin:

mkdir -p /rclone/config /rclone/cache
docker plugin disable rclone
docker plugin set rclone config=/rclone/config cache=/rclone/cache
docker plugin enable rclone

Will it help?

Also, take a close look at /var/log/syslog or output of journalctl -u docker (if you run docker daemon as a systemd service). If nothing else helps, disable swarm if enabled, and reinstall docker engine from scratch.

@Animosity022
Copy link
Collaborator

The more I use docker, the more annoying I find it.

I tried that on MacOS and didn't work. I thought it might have to do with the file sharing as I did try adding paths/restarting and that did not work either.

The default paths look like this:

image

So I tried just pointing to /tmp and see if that worked.

etexter@seraphite ~ % docker plugin set rclone config=/rclone/config cache=/tmp/rclone/config
etexter@seraphite ~ % docker plugin enable rclone
Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/rclone/config" to rootfs at "/data/config" caused: stat /rclone/config: no such file or directory: unknown

I looked as the console logs as that was a suggestion on the page and that gave me no useful information about that is going wrong.

2022-01-02 07:19:06.540108-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSBundlePath="/Applications/Docker.app/Contents/MacOS/Docker Desktop.app", }, success=true, cacheable=false, } (for client 3041)
2022-01-02 07:19:06.540318-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSApplicationHasSignalledItIsReady=true, ApplicationType="BackgroundOnly", ChangeCount=525, pid=15580, LSDisplayName="Keychain (Docker)", }, success=true, cacheable=false, } (for client 3041)
2022-01-02 07:19:07.800912-0500  localhost docker[23222]: (libsystem_info.dylib) Created Activity ID: 0x139020, Description: Retrieve User by ID
2022-01-02 07:19:07.841509-0500  localhost com.docker.cli[23223]: (libsystem_info.dylib) Created Activity ID: 0x139030, Description: Retrieve User by ID
2022-01-02 07:19:07.848734-0500  localhost com.docker.driver.amd64-linux[15770]: proxy >> HEAD /_ping
2022-01-02 07:19:07.851706-0500  localhost com.docker.driver.amd64-linux[15770]: proxy << HEAD /_ping (3.132625ms)
2022-01-02 07:19:07.863530-0500  localhost com.docker.cli[23224]: (libsystem_info.dylib) Created Activity ID: 0x139040, Description: Retrieve User by ID
2022-01-02 07:19:07.869935-0500  localhost com.docker.driver.amd64-linux[15770]: proxy >> HEAD /_ping
2022-01-02 07:19:07.872572-0500  localhost com.docker.driver.amd64-linux[15770]: proxy << HEAD /_ping (2.662583ms)
2022-01-02 07:19:07.883850-0500  localhost com.docker.cli[23225]: (libsystem_info.dylib) Created Activity ID: 0x139050, Description: Retrieve User by ID
2022-01-02 07:19:07.891257-0500  localhost com.docker.driver.amd64-linux[15770]: proxy >> HEAD /_ping
2022-01-02 07:19:07.893311-0500  localhost com.docker.driver.amd64-linux[15770]: proxy << HEAD /_ping (2.07625ms)
2022-01-02 07:19:07.893560-0500  localhost com.docker.driver.amd64-linux[15770]: proxy >> POST /v1.41/plugins/rclone/enable?timeout=30
2022-01-02 07:19:07.947041-0500  localhost com.docker.driver.amd64-linux[15770]: proxy << POST /v1.41/plugins/rclone/enable?timeout=30 (53.461334ms)
2022-01-02 07:19:07.948944-0500  localhost com.docker.backend[15494]: (6d2ea3b4) 1ee1a413-CliAPI S<-C Go-http-client/1.1 POST /usage
2022-01-02 07:19:07.949223-0500  localhost com.docker.backend[15494]: (6d2ea3b4) 1ee1a413-CliAPI S<-C Go-http-client/1.1 bind: {"command":"plugin enable","context":"moby","source":"cli","status":"failure"}
2022-01-02 07:19:07.949282-0500  localhost com.docker.backend[15494]: (6d2ea3b4-1) 679feda9-BackendCMD C->S SwiftAPI POST /usage/cli: {"command":"plugin enable","context":"moby","source":"cli","status":"failure"}
2022-01-02 07:19:07.965739-0500  localhost com.docker.backend[15494]: (6d2ea3b4-1) 679feda9-BackendCMD C<-S 7165df7c-SwiftAPI POST /usage/cli (16.455125ms): OK
2022-01-02 07:19:07.965793-0500  localhost com.docker.backend[15494]: (6d2ea3b4) 1ee1a413-CliAPI S->C Go-http-client/1.1 POST /usage (16.99325ms): OK
2022-01-02 07:19:10.552259-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSApplicationHasSignalledItIsReady=true, ApplicationType="UIElement", ChangeCount=566, pid=15491, LSDisplayName="Docker", }, success=true, cacheable=false, } (for client 698)
2022-01-02 07:19:10.552443-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSApplicationHasSignalledItIsReady=true, ApplicationType="Foreground", ChangeCount=529, pid=15550, Hidden=false, LSDisplayName="Docker Desktop", }, success=true, cacheable=false, } (for client 698)
2022-01-02 07:19:10.552626-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSApplicationHasSignalledItIsReady=true, ApplicationType="BackgroundOnly", ChangeCount=525, pid=15580, LSDisplayName="Keychain (Docker)", }, success=true, cacheable=false, } (for client 698)
2022-01-02 07:19:11.559950-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSApplicationHasSignalledItIsReady=true, ApplicationType="UIElement", ChangeCount=566, pid=15491, LSDisplayName="Docker", }, success=true, cacheable=false, } (for client 3041)
2022-01-02 07:19:11.560077-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSBundlePath="/Applications/Docker.app", }, success=true, cacheable=false, } (for client 3041)
2022-01-02 07:19:11.560237-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSApplicationHasSignalledItIsReady=true, ApplicationType="Foreground", ChangeCount=529, pid=15550, Hidden=false, LSDisplayName="Docker Desktop", }, success=true, cacheable=false, } (for client 3041)
2022-01-02 07:19:11.560458-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSBundlePath="/Applications/Docker.app/Contents/MacOS/Docker Desktop.app", }, success=true, cacheable=false, } (for client 3041)
2022-01-02 07:19:11.560636-0500  localhost launchservicesd[346]: [com.apple.launchservices:cas] MESSAGE: reply={result={LSApplicationHasSignalledItIsReady=true, ApplicationType="BackgroundOnly", ChangeCount=525, pid=15580, LSDisplayName="Keychain (Docker)", }, success=true, cacheable=false, } (for client 3041)

I'd guess something changed in versions that require something different to access a local file system to map it.

@ivandeex
Copy link
Member

ivandeex commented Jan 2, 2022

@animosity22
When I advised to use /rclone host directory I was answering to @madhavtummala on his Raspberry/Linux case (architecture Linux Host -> Docker containers).

Of course your Linux VM created by Docker Desktop for Mac does not have this directory. It has some stripped down Linux distribution with standard POSIX set of directories (/etc, /var, /usr, /tmp and so on) plus something Docker decided to add for convenience. No /rclone there, for sure.

It has an extra architecture layer (MacOS host -> Linux VM -> Docker containers) and consequently extra settings like mapping/mounting directories between MacOS host and Linux VM (for user convenience to blur the boundary between Mac host and Linux VM). It is this architecture that allows to run Docker (Linux framework) on alien MacOS kernel at cost of complexity that confuses you.

@ivandeex
Copy link
Member

ivandeex commented Jan 2, 2022

@DrSkunk @animosity22 @remidebette

The original request was about issue on Linux (Ubuntu) based Raspberry box.
Your issues with MacOS/Apple/M1 are irrelevant here.
Docker on MacOS/Windows is very special beast.
I do not have Apple hardware or Mac experience. I can't reproduce or investigate your issues.
Please open another thread. I will continue here with @madhavtummala madhav-the-topic-starter.

@ivandeex ivandeex removed this from the Help Wanted milestone Jan 2, 2022
@ivandeex ivandeex changed the title Rclone Docker Volume plugin not installing Docker Volume plugin not installing on Raspbian/ARM64 Jan 2, 2022
@ivandeex
Copy link
Member

ivandeex commented Jan 2, 2022

@madhavtummala
In top post you wrote RaspiOS. Now you claim it's Ubuntu 21.
If my advise worked for you, then we don't care.
If it didn't I will need access to your box to investigate more as I don't have Raspy hardware/software at hand.

@madhavtummala
Copy link
Author

@ivandeex
I tried to use the plugin in both RaspiOS (arm64) and Ubuntu Server 21.04 (arm64) and it didn't work in both of them.
I checked the mount list, there are no parent directories as mounts
Sharing the output of mount list:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=1886684k,nr_inodes=471671,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=388148k,mode=755,inode64)
/dev/sdb2 on / type ext4 (rw,relatime,discard,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=34452)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/var/lib/snapd/snaps/core20_1171.snap on /snap/core20/1171 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core18_2252.snap on /snap/core18/2252 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/snapd_13269.snap on /snap/snapd/13269 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/docker_1124.snap on /snap/docker/1124 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core20_1274.snap on /snap/core20/1274 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/lxd_21623.snap on /snap/lxd/21623 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/lxd_22151.snap on /snap/lxd/22151 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/snapd_14296.snap on /snap/snapd/14296 type squashfs (ro,nodev,relatime,x-gdu.hide)
/dev/sda1 on /mnt/volume type fuseblk (rw,noatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdb1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
landsraad:TV on /mnt/volume/TV type fuse.rclone (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,nodev,noexec,relatime,size=388148k,mode=755,inode64)
nsfs on /run/snapd/ns/lxd.mnt type nsfs (rw)
nsfs on /run/snapd/ns/docker.mnt type nsfs (rw)
landsraad:MOVIES on /mnt/volume/MOVIES type fuse.rclone (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=388144k,nr_inodes=97036,mode=700,uid=1000,gid=1000,inode64)

After setting different paths as you suggested:

Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/rclone/config" to rootfs at "/data/config" caused: stat /rclone/config: no such file or directory: unknown

@Animosity022
Copy link
Collaborator

This worked for me:

https://www.reddit.com/r/docker/comments/rue93w/comment/hqyz42n/?utm_source=share&utm_medium=web2x&context=3

etexter@seraphite ~ % docker plugin install rclone/docker-volume-rclone:arm64 \
       --alias rclone --grant-all-permissions \
       args="-v --allow-other" \
       config="/private/var/lib/docker-plugins/rclone/config" \
       cache="/private/var/lib/docker-plugins/rclone/cache"
arm64: Pulling from rclone/docker-volume-rclone
Digest: sha256:4796d2cf7c8eca95d945b64a16fcb382c3978972edfe407ef3e8fe9dcfa5281f
c06e19ea97b8: Complete
Installed plugin rclone/docker-volume-rclone:arm64

etexter@seraphite ~ % docker plugin list
ID             NAME            DESCRIPTION                       ENABLED
5f7540a1a800   rclone:latest   Rclone volume plugin for Docker   true

@ivandeex
Copy link
Member

ivandeex commented Jan 2, 2022

@madhavtummala
Let's save Raspy for later. For now we'll look at your Ubuntu 21. And what I see in your mount list? I see this

/var/lib/snapd/snaps/docker_1124.snap on /snap/docker/1124 type squashfs (ro,nodev,relatime,x-gdu.hide)

The cause
Instead of vanilla Docker you have Docker raped by Canonical where Docker daemon runs in a sandbox controlled by Snap/LXR (a hybrid of package manager and light containerization system from Ubuntu maintainers). It's similar to above Win/Mac case i.e. it introduces another "semi-VM" layer between docker and host. But in Win/Mac it was at least warranted by the need to put Linux kernel in alien environment. This time it just adds yet another level of indirection and hassle for you (and me btw). Your "Snapped Docker" controls containers (including normal containers) but in turn is controlled by Snap. Consequently instead of access to the whole file system it has access only to parts of it, probably remapped.

What you can do?

Option 1. Learn snap, learn snapped docker. Find out how it's limited by Snap. Create an rclone directory under your home directory e.g. /home/yourname/rclone/config, /home/yourname/rclone/cache (or in /private file name space like above) and configure rclone volume plugin appropriately.

Option 2. Get rid of extra indirection layer. Use vanilla Docker.

https://www.unixtutorial.org/how-to-install-docker-in-ubuntu-using-snap/

Apparently, snap model is not fully compatible with Docker right now, this means starting and using docker that you installed via snap is not as simple as you might expect. [...] If you just need a hassle free Docker setup, install Docker using apt-get from the official Docker repositories.

How to remove snappy docker and install vanilla docker:

Background
Linux kernel maintains in it tables of processes, network devices, mounts etc. It allows groups of processes "live" in different tables. Each group will see its own set of mounts (one file tree), network connections, processes etc. In other words these groups of processes (containers) are semi-isolated from each other. Kernel provides administrative processes with a number of low-level APIs (via kernel calls, procfs and other messaging means). Docker framework provides high level APIs around this low-level APIs and a daemon that does the translation of logic. However there are other frameworks that allow to control process isolation, e.g. systemd or LXR, the less known grandpa of the two.
Canonical Inc (Ubuntu maintainers) attempts to push their Snap product (yet another software packager which involves isolation of packages using Linux kernel namespaces but with LXR.
Their convoluted minds decided to distribute Docker (containerization system) containerized by Snap/LXR.
My personal opinion: too much hassle, too many levels of indirection, extra complexity without any perks for you as a user. Don't use it. I've learned about its existence just now by googling after your report. I don't like it at all. It's nonsense.

P. S. @madhavtummala
If this worked for you, could you contribute a quick page on rclone wiki https://github.com/rclone/rclone/wiki explaining how to get rid of snappy docker? Thank you!

@ivandeex
Copy link
Member

ivandeex commented Jan 2, 2022

P.P.S. I still see Snap useful for distributing complex software e.g. browsers. Canonical will compile Chrome/Opera/Brave once with a single set of shared libraries for e.g. Ubuntu 18. Then use Snap/LXR (and Linux kernel mount tables under the hood) to remap host directories for each package so each browser will see its required shared libraries on Ubuntu 19/20/21 without interfering with other packages/browsers. Also remap user home subdirectories to let it keep internet caches. But remapping a remapper (aka snapping docker) is way too much.

@ivandeex
Copy link
Member

ivandeex commented Jan 2, 2022

@madhavtummala
I quickly googled for Raspberry OS and docker (1, 2, 3, 4). From what I see RaspOS is yet another Debian derivative. I guess if you installed the vanilla Docker, there should be no problems basically.

  • Have you installed vanilla, raspbian-provided or some customized Docker?
  • Will docker run hello-world work for you?
  • What is printed by docker info?
  • What does your main mount table cat /proc/mounts look like?

@madhavtummala
Copy link
Author

madhavtummala commented Jan 3, 2022

@ivandeex thank you very much! this works.
I was able to fix my previous issues with just rclone docker container as well. I was trying to make rclone mount from container provide the mount to host, which had some "but is not a shared mount" issue.
Now I am able to use rclone properly through docker - as a bind mount!
I am pretty sure this would work in RaspiOS as well, if I install it without snap.

For anyone facing bind mount issue, this is what I used:

  landsraad_movies:
    container_name: landsraad_movies
    image: rclone/rclone
    restart: unless-stopped
    network_mode: host
    cap_add:
      - SYS_ADMIN
    devices:
      - /dev/fuse
    security_opt:
      - "apparmor:unconfined"
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
      - RCLONE_DIR_CACHE_TIME=30m
      - RCLONE_VFS_CACHE_MODE=full
      - RCLONE_CACHE_DIR=/mnt/volume/cache1
      - RCLONE_VFS_CACHE_MAX_SIZE=1000G
      - RCLONE_VFS_WRITE_BACK=30m
      - RCLONE_VFS_CACHE_MAX_AGE=720h
      - RCLONE_LOG_LEVEL=INFO
      - RCLONE_LOG_FILE=/config/rclone/movies.log
      - RCLONE_ALLOW_OTHER=true
      - RCLONE_ALLOW_NON_EMPTY=true
      - RCLONE_VFS_READ_AHEAD=256M
      - RCLONE_UID=${PUID}
      - RCLONE_GID=${PGID}
      - RCLONE_ATTR_TIMEOUT=1m
    volumes:
      - ${BASE_ROOT}/config/rclone:/config/rclone
      - ${DATA_ROOT}:/media:rshared
      - /etc/passwd:/etc/passwd:ro
      - /etc/group:/etc/group:ro
    command: ["mount", "landsraad:MOVIES", "/media/MOVIES"]

@ivandeex
Copy link
Member

ivandeex commented Jan 3, 2022

Note The last question is irrelevant to rclone volume plugin. It's about a different case of running rclone as application in a normal docker container, specifically to mount remote storage by containerized rclone and propagate the mount to the host OS (unlike volume plugin which propagates mounts from plugin to other containers).

rshared is the key to let outer processes bind-remount (back-propagate) a mount originally created inside a container

volumes:
- ${DATA_ROOT}:/media:rshared
  • docker bind-mounts /data/root from main mount table (aka main file tree) as /media into container
  • rclone in container mounts external storage under /media
  • rshared back-propagates mount bound to /media back from container into main filesystem as /data/root
  • non-containerized processes living in main file tree see the mount living in /data/root

@ivandeex
Copy link
Member

ivandeex commented Jan 3, 2022

Solved

@ivandeex ivandeex closed this as completed Jan 3, 2022
@madhavtummala
Copy link
Author

madhavtummala commented Jan 3, 2022 via email

@ivandeex
Copy link
Member

ivandeex commented Jan 3, 2022

Note The very last question is irrelevant to volume plugin either. It's also irrelevant to publishing containerized mounts to the host OS as it asks about dependencies between several containers. I am going to answer it then end this Q/A session. I prefer self-contained tickets.

Docker Compose/Swarm service order

The Problem

Ready Solutions (usually, waiting for IP or port)

Waiting for anything you want

Include bash in your image and write a simplistic polling loop.
Example of waiting for a mount by polling for a predefined directory or file:
https://github.com/rclone/rclone/wiki/rclone-mount-helper-script/b7090e6b98e37d6a8a9c2d1f7ac9a144d40c02eb

# WARNING: this will loop forever if remote is actually empty!
until [ "`ls -l $mountpoint`" != 'total 0' ]; do
    sleep 1
done

@ivandeex
Copy link
Member

ivandeex commented Jan 4, 2022

Note The last two questions were irrelevant to rclone volume plugin. Let's try to keep tickets self-contained vs endless QA sessions.

@rclone rclone locked as resolved and limited conversation to collaborators Jan 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants