Unable to create docker volume on remote machine using ssh

Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:43:04 2024
OS/Arch: linux/amd64
Context: default

I am trying to create docker volume on remote machine using ssh login (first time) below is my docker compose file contents:

services:
webapp:
image: tomcat
container_name: webapp
hostname: webapp-hostname
ports:
- 8180:80
volumes:
#- sshvolume:/usr/local/tomcat/logs
- sshvolume:/app/
volumes:
sshvolume:
external: true

Below is my docker volume creation command:

docker volume create --driver vieux/sshfs -o sshcmd=satishkumar@debian:/home/satishkumar/source-code/ -o password=**** -o debug sshvolume

when i am running my docker compose file with docker compose up -d then I am getting below error:

level=error msg=“Handler for POST /v1.47/containers/aab8f6c64eb737a3837145c8953a9712de15ec36f13c3029825d87a6290dfc11/start returned error: error while mounting volume ‘/mnt/volumes/0636282671f4b97401c51a710fa108ec’: Post "http://plugin.moby.localhost/VolumeDriver.Mount\”: context deadline exceeded" spanID=1519bad0ef0df066 traceID=2b2316f5d13df2d2d9a1eca66d061c4a

Please help me to resolve this issue I am totally new and learing docker.

Hey! Have you resolved it?

Did you follow the Volume Driver doc?

What is the output of docker info?

The plugin is more then 7 years old and already archived on GitHub so I would not expect much from it.

I know it is still mentioned in the documentation as an example of using a volume driver, but it should be changed probably. It still has the most stars and most downloads, but most likely because it was in the official documentation so everyone found this one.

You can search for more recent volume plugins

https://hub.docker.com/search?q=sshfs&type=plugin or try alternative ways with built-in support like NFS.

Or you can also use SSHFS on the host to mount the folder to your machine and mount something from there into the container.

Note: I’m not saying the plugin would not work, only that even if it works, I would not trust in a plugin which is not supported anymore.

1 Like