Good day rimelek
Eventually, I found a way to install the vieux/sshfs plugin on my rootless docker environment. I had to specify the “state.source” (which --in the absence of documentation-- I understood as the path to the plugin directory).
dockerUser@uWeb:~$ docker plugin install vieux/sshfs state.source=/home/dockerUser/.local/share/docker/plugins/ sshkey.source=/home/dockerUser/.ssh
Plugin "vieux/sshfs" is requesting the following privileges:
- network: [host]
- mount: [/var/lib/docker/plugins/]
- mount: 
- device: [/dev/fuse]
- capabilities: [CAP_SYS_ADMIN]
Do you grant the above permissions? [y/N] y
latest: Pulling from vieux/sshfs
dockerUser@uWeb:~$ docker plugin ls
ID NAME DESCRIPTION ENABLED
2d8337628b16 vieux/sshfs:latest sshFS plugin for Docker true
Then I can create a volume. Unfortunately, the plugin has hardcoded the volumes’ directory to “mnt/volumes/” (see config.json), where is not accessible for the rootless user. So what happens actually is, the volume creation doesn’t fail at this point, rather the volume gets created by the plugin, but there is no “actual” volume created at “mnt/volumes” of course (or anywhere else).
dockerUser@uWeb:~$ docker volume create -d vieux/sshfs -o sshcmd=datamgr@uData.lan:/home/datamgr/data/docker/volumes/ -o IdentityFile=/home/dockerUser/.ssh/id_rsa -o allow_other testsshvolume
dockerUser@uWeb:~$ docker volume ls
DRIVER VOLUME NAME
dockerUser@uWeb:~$ docker volume inspect testsshvolume
Indeed the plugin hasn’t been updated in the past 4 years and nobody cared to check that it works in a rootless environment… This particular plugin is used as an example throughout the official docker documentation!
I do not know what else to do, someone needs to update the plugin I suppose…
And I cannot get the direct SSHFS mount to the host’s /volumes directory to work either! I will not setup the horrendous and slow NFS in my NAS just because SSHFS is not really supported by docker. I am thinking to have a look at podman or other container solutions.
And for the sake of completion, here is confirmation the volume doesn’t actually exist:
dockerUser@uWeb:~$ docker run -d --name sshtest -v testsshvolume:/app nginx:latest
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
eff15d958d66: Pull complete
1e5351450a59: Pull complete
2df63e6ce2be: Pull complete
9171c7ae368c: Pull complete
020f975acd28: Pull complete
266f639b35ad: Pull complete
Status: Downloaded newer image for nginx:latest
docker: Error response from daemon: error while mounting volume '/mnt/volumes/9f9d256a5fbcc046e8826c439083837a': VolumeDriver.Mount: sshfs command execute failed: exit status 1 (read: Connection reset by peer).