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

allow settable state.source #30

Merged
merged 1 commit into from
Aug 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .travis/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,30 @@ docker run -d -p 2222:22 rastasheep/ubuntu-sshd:14.04
docker volume create -d vieux/sshfs:next -o sshcmd=root@localhost:/ -o port=2222 -o password=root sshvolume
docker run --rm -v sshvolume:/write busybox sh -c "echo hello > /write/world"
docker run --rm -v sshvolume:/read busybox grep -Fxq hello /read/world
sudo cat /var/lib/docker/plugins/sshfs-state.json
docker volume rm sshvolume

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

# test3: compression
docker volume create -d vieux/sshfs:next -o sshcmd=root@localhost:/ -o Ciphers=arcfour -o Compression=no -o port=2222 -o password=root sshvolume
docker run --rm -v sshvolume:/write busybox sh -c "echo hello > /write/world"
docker run --rm -v sshvolume:/read busybox grep -Fxq hello /read/world
sudo cat /var/lib/docker/plugins/sshfs-state.json
docker volume rm sshvolume

# test4: source
docker plugin disable vieux/sshfs:next
docker plugin set vieux/sshfs:next state.source=/tmp
docker plugin enable vieux/sshfs:next
docker volume create -d vieux/sshfs:next -o sshcmd=root@localhost:/ -o Ciphers=arcfour -o Compression=no -o port=2222 -o password=root sshvolume
docker run --rm -v sshvolume:/write busybox sh -c "echo hello > /write/world"
docker run --rm -v sshvolume:/read busybox grep -Fxq hello /read/world
sudo cat /tmp/sshfs-state.json
docker volume rm sshvolume

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ This plugin allows you to mount remote folder using sshfs in your container easi
1 - Install the plugin

```
$ docker plugin install vieux/sshfs # or docker plugin install vieux/sshfs DEBUG=1
$ docker plugin install vieux/sshfs

# or to enable debug
docker plugin install vieux/sshfs DEBUG=1

# or to change where plugin state is stored
docker plugin install vieux/sshfs state.source=<any_folder>
```

2 - Create a volume
Expand Down
90 changes: 47 additions & 43 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,50 @@
{
"description": "sshFS plugin for Docker",
"documentation": "https://docs.docker.com/engine/extend/plugins/",
"entrypoint": [
"/docker-volume-sshfs"
"description": "sshFS plugin for Docker",
"documentation": "https://docs.docker.com/engine/extend/plugins/",
"entrypoint": [
"/docker-volume-sshfs"
],
"env": [
{
"name": "DEBUG",
"settable": [
"value"
],
"value": "0"
}
],
"interface": {
"socket": "sshfs.sock",
"types": [
"docker.volumedriver/1.0"
]
},
"linux": {
"capabilities": [
"CAP_SYS_ADMIN"
],
"env": [
{
"name": "DEBUG",
"settable": [
"value"
],
"value": "0"
}
],
"interface": {
"socket": "sshfs.sock",
"types": [
"docker.volumedriver/1.0"
]
},
"linux": {
"capabilities": [
"CAP_SYS_ADMIN"
],
"devices": [
{
"path": "/dev/fuse"
}
]
},
"mounts": [
{
"destination": "/mnt/state",
"options": [
"rbind"
],
"source": "/var/lib/docker/plugins/",
"type": "bind"
}
],
"network": {
"type": "host"
},
"propagatedmount": "/mnt/volumes"
"devices": [
{
"path": "/dev/fuse"
}
]
},
"mounts": [
{
"destination": "/mnt/state",
"options": [
"rbind"
],
"name": "state",
"source": "/var/lib/docker/plugins/",
"settable": [
"source"
],
"type": "bind"
}
],
"network": {
"type": "host"
},
"propagatedmount": "/mnt/volumes"
}