adlogix / docker-machine-nfs

Activates NFS on docker-machine
MIT License
794 stars 104 forks source link

Bug line 130 with () #57

Closed ericis closed 8 years ago

ericis commented 8 years ago

/usr/local/bin/docker-machine-nfs: line 130: syntax error: unexpected "(" (expecting "}")

Boot2Docker version 1.9.1, build master : cef800b - Fri Nov 20 19:33:59 UTC 2015

tonivdv commented 8 years ago

Hey @ericis,

Can you share the command you are executing?

ericis commented 8 years ago

Possibly a user error (PEBKAC Linux noob). I first tried running the curl command to download, tee, and chmod inside of the default boot2docker image (docker-machine ssh default).

I then realized that this was probably meant to be run on the host outside of boot2docker and ran it in MINGW64 without the sudo commands (default Docker Toolbox installation doesn't recognized sudo).

I was able to successfully run docker-machine-nfs default on host with the output:

$ docker-machine-nfs default
[INFO] Configuration:

\t\033[0;35m- Machine Name: default \033[0m
\t\033[0;35m- Shared Folder: /Users \033[0m
\t\033[0;35m- Mount Options: noacl,async \033[0m
\t\033[0;35m- Force: false \033[0m

[INFO] machine presence ...                     \033[0;32mOK \033[0m
[INFO] machine running ...                      \033[0;32mOK \033[0m
[INFO] Lookup mandatory properties ... \033[0;32mOK \033[0m

\t\033[0;35m- Machine IP: 192.168.99.100 \033[0m
\t\033[0;35m- Network ID: VirtualBox Host-Only Ethernet Adapter #2 \033[0m
\t\033[0;35m- NFSHost IP: 192.168.99.1 \033[0m

[INFO] Configure NFS ...
\033[0;33m\n !!! Sudo will be necessary for editing /etc/exports !!! \033[0m
/usr/local/bin/docker-machine-nfs: line 336: sudo: command not found

But, I have no idea how to use it. For example, what does running docker-machine-nfs default --shared-folder=/Users do that the default VirtualBox and Boot2Docker setup for /c/Users doesn't do? Do, I run that and then simply run my docker image with the normal volume mount? Below is an example:

$ docker run -d -v //c/Users/Eric/Documents/src/aa/ecs/ecs-labs-dkr-spring/src: /usr/local/src -p 8080:8080 labs-spring spring run app.groovy

ericis commented 8 years ago

Confirmed! It worked perfectly once I ran it on the host as just docker-image-nfs default without any other options and then performed my normal volume mount when running my docker image. I also had to add --watch to the docker run command as spring run app.groovy --watch to enable Spring to auto-watch the file for changes.

Thanks!