adlogix / docker-machine-nfs

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

Allow nfs mount options to be configurable through the CLI #45

Closed cameronmaske closed 8 years ago

cameronmaske commented 8 years ago

Related issues #6 and #38

Need to run some tests to verify this operates correctly, but wanted to gauge if this functionality you would be willing to accept and if so, does the naming scheme make sense?

tonivdv commented 8 years ago

Hey @cameronmaske,

This is definitely a good approach. I don't have any objections besides the duplication in the readme.

cameronmaske commented 8 years ago

@tonivdv Good spot on the README! That should be resolved. Tested this locally and it works a charm. Let me know if there are any other outstanding issues.

tonivdv commented 8 years ago

I tested it and it works like a charm ;)

I would simply add a (debug) echo message to show the mount options it will apply at line https://github.com/cameronmaske/docker-machine-nfs/blob/mount-options/docker-machine-nfs.sh#L196

And regarding the var name 'mount-options'. I tend to prefer 'mount-opts' ... but it's a matter of taste. What do you think?

yoshz commented 8 years ago

Works for me guys! Thanks for adding, I was looking for this.

cameronmaske commented 8 years ago

@tonivdv Renamed it to mount-opts and added the debug message.

sh docker-machine-nfs.sh dev --mount-opts="noacl,async,nolock,vers=3,udp,noatime,actimeo=1" --shared-folder="/Users/cameronmaske/Development/repos"
[INFO] Configuration:

    - Machine Name: dev 
    - Shared Folder: /Users/cameronmaske/Development/repos 
    - Mount Options: noacl,async,nolock,vers=3,udp,noatime,actimeo=1 
    - Force: false 

[INFO] machine presence ...             OK 
[INFO] machine running ...          OK 
[INFO] Lookup mandatory properties ... OK 

    - Machine IP: 192.168.99.100 
    - Network ID: vboxnet9 
    - NFSHost IP: 192.168.99.1 

[INFO] Configure NFS ... 

 !!! Sudo will be necessary for editing /etc/exports !!! 
Password:
                        OK 
[INFO] Configure Docker Machine ...         OK 
[INFO] Restart Docker Machine ...       OK 
[INFO] Verify NFS mount ...             OK 

--------------------------------------------

 The docker-machine 'dev'
 is now mounted with NFS!

 ENJOY high speed mounts :D

--------------------------------------------
tonivdv commented 8 years ago

Many thanks for the contribution @cameronmaske