initial commit

This commit is contained in:
ale 2023-08-08 21:47:23 +02:00
commit 6c1da8fe71
2 changed files with 52 additions and 0 deletions

39
README.md Normal file
View File

@ -0,0 +1,39 @@
# sshfs docker driver
## docker driver to mount and share volumes over sshd service
## Requirements
```
docker, git, sudo and ssh
```
## Install
```
./sshfs-docker-driver.sh
```
## docker-compose volume config example with some options
```
volumes:
ssh-nginx:
driver: vieux/sshfs
driver_opts:
sshcmd: user@host:/var/www/html
password: p4ssw0rd
port: 22
# sftp_server: "/usr/bin/sudo /usr/lib/openssh/sftp-server"
allow_other: ""
reconnect: ""
StrictHostKeyChecking: "no"
```
## add volume in docker-compose service config
```
volumes:
- ssh-nginx:/var/www/html
```
## License
```
MIT
```

13
sshfs-docker-driver.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
git clone --depth 1 https://github.com/vieux/docker-volume-sshfs
cd docker-volume-sshfs/
docker build -t rootfsimage .
cd ..
mkdir -p docker-volume-sshfs/rootfs
id=$(docker create rootfsimage true)
sudo docker export "$id" | sudo tar -x -C docker-volume-sshfs/rootfs
docker rm -vf "$id"
docker rmi rootfsimage
sudo docker plugin create vieux/sshfs docker-volume-sshfs/
docker plugin enable vieux/sshfs
docker plugin ls