How to mount FreeNAS NFS paths into a rancherOS docker container? - Bitwarden

beedix

Dabbler
Joined
Aug 11, 2017
Messages
20
So I'm wanting to use a local bitwarden (password management software) backend on my FreeNAS for the obvious reasons of the encrypted data being handled locally. Specifically, my problem is that once I have my host up and running bitwarden, I can't seem to mount a freeNAS path to the "/data" directory.

So, here is what I've done:
  • Created a rancherOS VM - Success
  • Setup a basic host in rancher
  • Added bitwarden (docker run -d --name bitwarden -v /bw-data/:/data/ -p 80:80 mprasil/bitwarden:latest
I'm able to access bitwarden as expected. But I've struggled to find a way to properly mount an NFS share. I've been able to add the official docker-nfs and create a volume within a container ourside of the bitwarden container, but I'm just unable to get the NFS mount placed within the bitwarden container.

Any help or pointers would be so appreciated!
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
You could add mounts to your rancheros VM cloud-config. This ref: shows the basic idea for non-network mounts: https://rancher.com/docs/os/v1.2/en/storage/additional-mounts/

I donlt think docker-nfs from within rancheros, and I've not found docs in the past for the mysterious in-built volume-nfs service.

I've forgotten the exact notation for a NFS mount, but there are examples here on the forum and in the resources section. Using NFSv3 might avoid any id mapping complications.
 

hugopoi

Cadet
Joined
Dec 8, 2016
Messages
2
  • RancherOS doesn't support NFSv3 out of the box
  • Use NFSv4
Step by step
  1. Enable NFSv4 in Freenas in /ui/services/nfs
  2. In ROS sudo ros config set rancher.modules "['nfs']"
  3. And sudo ros config set mounts '[["192.168.1.13:/mnt/Mainraidz2/RancherOsData","/mnt/freenas","nfs","nfsvers=4"]]'
  4. Then reboot ROS with sudo reboot
 
Top