I recently installed RancherOS in a Docker VM on FreeNAS 11.2. I’m using Portainer to manage the containers. Right now I have one share mapped using the rancheros-cloud-config.yml file, which would be fine for containers that I only want to operate and access that share but I would like to be able to access other shares that I already have setup on FreeNAS but I can’t seem to find any recent information on how to properly modify the .yml to allow multiple shares. Every post I’ve found has been several years old or older and the syntax doesn’t seem to exactly match what I have in the file now that works with one share. So what is the best method to mount multiple NFS shares in Rancher? I’ve pasted the text of the .yml file that used for a single share below. I would appreciate it if someone could give me some advice on how to modify this to allow as many shares as I need.
#cloud-config
# /var/lib/rancher/conf/cloud-config.d/nfs.yml
# https://github.com/rancher/os/issues/641
write_files:
- path: /etc/rc.local
permissions: "0755"
content: |
#!/bin/bash
[ ! -e /usr/bin/docker ] && ln -s /usr/bin/docker.dist /usr/bin/docker
rancher:
services:
nfs:
image: walkerk1980/rancher-nfs-client
labels:
io.rancher.os.after: console, preload-user-images
io.rancher.os.scope: system
net: host
privileged: true
restart: always
volumes:
- /usr/bin/iptables:/sbin/iptables:ro
- /mnt/nfs-1:/mnt/nfs-1:shared
environment:
SERVER: X.X.X.X
SHARE: /shared_path