- Docker Machine 0.5.0+
Activates NFS for an existing boot2docker box created through Docker Machine.
- Install WSL
- Install VirtualBox
- Setup Docker-machine for WSL
- Install haneWIN NFS server
- Install
docker-machine-nfs
- Mount drives under root (e.g.
/c
) - Can be configured in/etc/wsl.conf
-automount
- Tested with these attributes:
docker-machine-nfs MACHINE-NAME --shared-folder=/c/Users/ --mount-opts="rw,vers=3,tcp,nolock,noacl,async"
curl -s https://raw.githubusercontent.com/adlogix/docker-machine-nfs/master/docker-machine-nfs.sh |
sudo tee /usr/local/bin/docker-machine-nfs > /dev/null && \
sudo chmod +x /usr/local/bin/docker-machine-nfs
brew install docker-machine-nfs
- Virtualbox
- Parallels
- VMware Fusion
- VMware Vsphere
- Xhyve
- Hyperkit
- Create
docker-machine
as usual - Run
docker-machine-nfs
## .
## ## ## == _ _ _____ ____
## ## ## ## ## === | \ | | ___/ ___|
/"""""""""""""""""\___/ === | \| | |_ \___ \
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ | |\ | _| ___) |
\______ o __/ |_| \_|_| |____/
\ \ __/
\____\_______/
Usage: $ docker-machine-nfs <machine-name> [options]
Options:
-f, --force Force reconfiguration of nfs
-n, --nfs-config NFS configuration to use in /etc/exports. (default to '-alldirs -mapall=\$(id -u):\$(id -g)')
-s, --shared-folder,... Folder to share (default to /Users)
-m, --mount-opts NFS mount options (default to 'noacl,async')
Examples:
$ docker-machine-nfs test
> Configure the /Users folder with NFS
$ docker-machine-nfs test --shared-folder=/Users --shared-folder=/var/www
> Configures the /Users and /var/www folder with NFS
$ docker-machine-nfs test --shared-folder=/var/www --nfs-config="-alldirs -maproot=0"
> Configure the /var/www folder with NFS and the options '-alldirs -maproot=0'
$ docker-machine-nfs test --mount-opts="noacl,async,nolock,nfsvers=3,udp,noatime,actimeo=1"
> Configure the /User folder with NFS and specific mount options.
$ docker-machine-nfs test --ip 192.168.1.12
> docker-machine will connect to your host machine via this address
- Failed to mount on WSL
Allow following exe's in "Windows Firewall" or any other firewall software used
Directory -- c:/Program Files/nfsd
- pmapd.exe
- nfssrv.exe
- nfsd.exe
- Heavily inspired by @mattes ruby version boot2docker-nfs.rb.
- @DzeryCZ added support for Windows with WSL