Skip to content
This repository was archived by the owner on Oct 19, 2022. It is now read-only.

Commit 8a6a77c

Browse files
authored
Merge pull request #30 from vieux/settable_source
allow settable state.source
2 parents 1913825 + 0fc99c4 commit 8a6a77c

File tree

3 files changed

+67
-44
lines changed

3 files changed

+67
-44
lines changed

.travis/integration.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,30 @@ docker run -d -p 2222:22 rastasheep/ubuntu-sshd:14.04
2222
docker volume create -d vieux/sshfs:next -o sshcmd=root@localhost:/ -o port=2222 -o password=root sshvolume
2323
docker run --rm -v sshvolume:/write busybox sh -c "echo hello > /write/world"
2424
docker run --rm -v sshvolume:/read busybox grep -Fxq hello /read/world
25+
sudo cat /var/lib/docker/plugins/sshfs-state.json
2526
docker volume rm sshvolume
2627

2728
# test2: allow_other
2829
docker volume create -d vieux/sshfs:next -o sshcmd=root@localhost:/ -o allow_other -o port=2222 -o password=root sshvolume
2930
docker run --rm -v sshvolume:/write -u nobody busybox sh -c "echo hello > /write/world"
3031
docker run --rm -v sshvolume:/read -u nobody busybox grep -Fxq hello /read/world
32+
sudo cat /var/lib/docker/plugins/sshfs-state.json
3133
docker volume rm sshvolume
3234

3335
# test3: compression
3436
docker volume create -d vieux/sshfs:next -o sshcmd=root@localhost:/ -o Ciphers=arcfour -o Compression=no -o port=2222 -o password=root sshvolume
3537
docker run --rm -v sshvolume:/write busybox sh -c "echo hello > /write/world"
3638
docker run --rm -v sshvolume:/read busybox grep -Fxq hello /read/world
39+
sudo cat /var/lib/docker/plugins/sshfs-state.json
40+
docker volume rm sshvolume
41+
42+
# test4: source
43+
docker plugin disable vieux/sshfs:next
44+
docker plugin set vieux/sshfs:next state.source=/tmp
45+
docker plugin enable vieux/sshfs:next
46+
docker volume create -d vieux/sshfs:next -o sshcmd=root@localhost:/ -o Ciphers=arcfour -o Compression=no -o port=2222 -o password=root sshvolume
47+
docker run --rm -v sshvolume:/write busybox sh -c "echo hello > /write/world"
48+
docker run --rm -v sshvolume:/read busybox grep -Fxq hello /read/world
49+
sudo cat /tmp/sshfs-state.json
3750
docker volume rm sshvolume
3851

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ This plugin allows you to mount remote folder using sshfs in your container easi
1010
1 - Install the plugin
1111

1212
```
13-
$ docker plugin install vieux/sshfs # or docker plugin install vieux/sshfs DEBUG=1
13+
$ docker plugin install vieux/sshfs
14+
15+
# or to enable debug
16+
docker plugin install vieux/sshfs DEBUG=1
17+
18+
# or to change where plugin state is stored
19+
docker plugin install vieux/sshfs state.source=<any_folder>
1420
```
1521

1622
2 - Create a volume

config.json

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,50 @@
11
{
2-
"description": "sshFS plugin for Docker",
3-
"documentation": "https://docs.docker.com/engine/extend/plugins/",
4-
"entrypoint": [
5-
"/docker-volume-sshfs"
2+
"description": "sshFS plugin for Docker",
3+
"documentation": "https://docs.docker.com/engine/extend/plugins/",
4+
"entrypoint": [
5+
"/docker-volume-sshfs"
6+
],
7+
"env": [
8+
{
9+
"name": "DEBUG",
10+
"settable": [
11+
"value"
12+
],
13+
"value": "0"
14+
}
15+
],
16+
"interface": {
17+
"socket": "sshfs.sock",
18+
"types": [
19+
"docker.volumedriver/1.0"
20+
]
21+
},
22+
"linux": {
23+
"capabilities": [
24+
"CAP_SYS_ADMIN"
625
],
7-
"env": [
8-
{
9-
"name": "DEBUG",
10-
"settable": [
11-
"value"
12-
],
13-
"value": "0"
14-
}
15-
],
16-
"interface": {
17-
"socket": "sshfs.sock",
18-
"types": [
19-
"docker.volumedriver/1.0"
20-
]
21-
},
22-
"linux": {
23-
"capabilities": [
24-
"CAP_SYS_ADMIN"
25-
],
26-
"devices": [
27-
{
28-
"path": "/dev/fuse"
29-
}
30-
]
31-
},
32-
"mounts": [
33-
{
34-
"destination": "/mnt/state",
35-
"options": [
36-
"rbind"
37-
],
38-
"source": "/var/lib/docker/plugins/",
39-
"type": "bind"
40-
}
41-
],
42-
"network": {
43-
"type": "host"
44-
},
45-
"propagatedmount": "/mnt/volumes"
26+
"devices": [
27+
{
28+
"path": "/dev/fuse"
29+
}
30+
]
31+
},
32+
"mounts": [
33+
{
34+
"destination": "/mnt/state",
35+
"options": [
36+
"rbind"
37+
],
38+
"name": "state",
39+
"source": "/var/lib/docker/plugins/",
40+
"settable": [
41+
"source"
42+
],
43+
"type": "bind"
44+
}
45+
],
46+
"network": {
47+
"type": "host"
48+
},
49+
"propagatedmount": "/mnt/volumes"
4650
}

0 commit comments

Comments
 (0)