Created
December 29, 2017 12:04
-
-
Save n-sviridenko/43e9e6bcaab2be356ae3af128c0e6d0b to your computer and use it in GitHub Desktop.
NFS for OSX on minikube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
HOST_PATH=$(pwd) | |
GUEST_PATH=/usr/app | |
HOST_EXPORT="${HOST_PATH} -network 192.168.99.0 -mask 255.255.255.0 -alldirs -maproot=root:wheel" | |
if ! grep -q "$HOST_EXPORT" /etc/exports; then | |
echo $HOST_EXPORT | sudo tee -a /etc/exports | |
sudo nfsd restart | |
fi | |
if minikube ssh -- mount | grep $GUEST_PATH > /dev/null; then | |
minikube ssh -- sudo umount $GUEST_PATH | |
fi | |
# TODO: Create it only if directory does not exist | |
minikube ssh -- sudo mkdir $GUEST_PATH | |
minikube ssh -- sudo mount 192.168.99.1:$HOST_PATH $GUEST_PATH -o rw,async,noatime,rsize=32768,wsize=32768,proto=tcp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment