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
Digest: sha256:1d3c3e42c12138da5ef7873b97f7f32cf99fb6edde75fa4f0bcf9ed277855811
52d435ada6a4: Complete
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
testsshvolume
dockerUser@uWeb:~$ docker volume ls
DRIVER VOLUME NAME
vieux/sshfs:latest testsshvolume
dockerUser@uWeb:~$ docker volume inspect testsshvolume
[
{
"CreatedAt": "0001-01-01T00:00:00Z",
"Driver": "vieux/sshfs:latest",
"Labels": {},
"Mountpoint": "/mnt/volumes/9f9d256a5fbcc046e8826c439083837a",
"Name": "testsshvolume",
"Options": {
"IdentityFile": "/home/dockerUser/.ssh/id_rsa",
"allow_other": "",
"sshcmd": "datamgr@uData.lan:/home/datamgr/data/docker/volumes/"
},
"Scope": "local"
}
]
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
Digest: sha256:097c3a0913d7e3a5b01b6c685a60c03632fc7a2b50bc8e35bcaa3691d788226e
Status: Downloaded newer image for nginx:latest
8b44dd517ba610900a47d6660f26745d35f4a98f708e5def2143abe3478457ae
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).