initial commit
This commit is contained in:
commit
6c1da8fe71
39
README.md
Normal file
39
README.md
Normal 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
13
sshfs-docker-driver.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user