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

Add allow_other option. Also, make error on unknown options more clear. #18

Merged
merged 6 commits into from
Aug 14, 2017

Conversation

koenlek
Copy link

@koenlek koenlek commented Mar 6, 2017

Addresses my issue #17.

@koenlek
Copy link
Author

koenlek commented Mar 13, 2017

@vieux, could you help me understand why the build is failing?

@vieux
Copy link
Owner

vieux commented Mar 30, 2017

@koenlek sorry, can you fix the conflict, I'll take a look right after

@koenlek
Copy link
Author

koenlek commented Apr 30, 2017

@vieux It took me a while to find some time to fix it. I think I've fixed it now, but strangely enough, I cannot get any custom build of the plugin to work anymore, even when I build the upstream master vieux/sshfs:next wont work. What I even tried, without luck, was:

# Cleanup
docker plugin disable vieux/sshfs:next
docker plugin rm vieux/sshfs:next
docker plugin disable vieux/sshfs:latest
docker plugin rm vieux/sshfs:latest

# Make & enable:
git checkout upstream/master
make
docker plugin enable vieux/sshfs:next

# Create volume:
docker volume create -d vieux/sshfs:next -o sshcmd=<me>@localhost:<my_home> -o password=<pw> test_home
docker run -it --rm -v test_home:/home/test ubuntu:16.04

But I get this error:

docker: Error response from daemon: error while mounting volume '/var/lib/docker/plugins/dc0a1b11f7ced0e73a4bc6c54e9d54a1b1a169978185a52add9fd45e2b2e6657/rootfs': Post http://%2Frun%2Fdocker%2Fplugins%2Fdc0a1b11f7ced0e73a4bc6c54e9d54a1b1a169978185a52add9fd45e2b2e6657%2Fsshfs.sock/VolumeDriver.Mount: dial unix /run/docker/plugins/dc0a1b11f7ced0e73a4bc6c54e9d54a1b1a169978185a52add9fd45e2b2e6657/sshfs.sock: connect: no such file or directory.

If I remove plugins again and install official plugin (docker plugin install vieux/sshfs), all works fine again...

I really don't understand. I use latest docker version on Ubuntu 16.04. Any help would be highly appreciated.

@cybertk
Copy link

cybertk commented Jun 28, 2017

Could someone review this PR and get it merged?

@cybertk
Copy link

cybertk commented Jun 28, 2017

@koenlek Could you share the validation steps, I can hep verify if needed.

@koenlek
Copy link
Author

koenlek commented Jul 16, 2017

Ok, to test, just run this with the current plugin:

# First we make an sshfs volume that points to you home direcotry at localhost
docker volume create -d vieux/sshfs -o sshcmd=<you>@localhost:$HOME -o password=<your_pwd> ssh_home

# Next we try to list the files as root, which is fine:
docker run -it --rm -v ssh_home:/tmp/home ubuntu:16.04 ls /tmp/home

# Now we try to list it as another user (UID=1000 in this case), which fails with a permission denied:
docker run -it --rm -u 1000:1000 -v ssh_home:/tmp/home ubuntu:16.04 ls /tmp/home

Now let's build the new plugin:

docker plugin disable vieux/sshfs:next # is not needed first time
docker plugin rm vieux/sshfs:next # is not needed first time
make
docker plugin enable vieux/sshfs:next

No lets again with the next plugin (vieux/sshfs:next), with the -o allow_other option:

# First we make an sshfs volume that points to you home directory at localhost, WITH the allow_other option.
docker volume create -d vieux/sshfs:next -o allow_other -o sshcmd=<you>@localhost:$HOME -o password=<your_pwd> ssh_home_next

# Next we try to list the files as root, which is fine:
docker run -it --rm -v ssh_home_next:/tmp/home ubuntu:16.04 ls /tmp/home

# Now we try to list it as another user (UID=1000 in this case), which succeeds too:
docker run -it --rm -u 1000:1000 -v ssh_home_next:/tmp/home ubuntu:16.04 ls /tmp/home

Please note that I found the whole behaviour of docker a bit buggy when testing this and switching between different versions of the plugin. Sometimes I just made a 'clean start' by removing all the sshfs plugin based volumes, removing the sshfs plugins (latest + next) and then restarting the docker daemon.

@koenlek
Copy link
Author

koenlek commented Jul 16, 2017

@vieux I found another bug which was introduced in #20. If you did not supply any port, the whole plugin would crash upon a docker run -v <sshfs_vol>:<some_path> <docker_img> call. I patched it in my last commit.

@vieux What I find strange is that the latest master branch version of the plugin wasn't pushed yet to the official docker plugin registry (because the version from docker plugin install vieux/sshfs does not contain this bug...). After this PR is merged, will it be released to the official registry?

@koenlek
Copy link
Author

koenlek commented Aug 1, 2017

@vieux or @cybertk: did you find the time to review this already?

@koenlek
Copy link
Author

koenlek commented Aug 14, 2017

@vieux reminder...

@vieux
Copy link
Owner

vieux commented Aug 14, 2017

@koenlek sorry about that. LGTM!

@vieux vieux merged commit bb06429 into vieux:master Aug 14, 2017
@vieux
Copy link
Owner

vieux commented Aug 14, 2017

@koenlek I pushed at vieux/sshfs:next if it seems to be stable, I'll probably cut 1.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants