ehough / docker-nfs-server

A lightweight, robust, flexible, and containerized NFS server.
https://hub.docker.com/r/erichough/nfs-server/
GNU General Public License v3.0
669 stars 221 forks source link

Documentation update needed for describing binding export folders through environment variables #83

Open cybericius opened 5 months ago

cybericius commented 5 months ago

Using quotes ('/") won't work, resulting in this log:

----> WARNING: skipping NFS_EXPORT_1 environment variable since '/mnt/disk1 is not a container directory,
----> collected 0 valid export(s) from NFS_EXPORT_* environment variables,
----> ERROR: no valid exports,
provide each line of /etc/exports as an environment variable

The container will look for environment variables that start with NFS_EXPORT_ and end with an integer. e.g. NFS_EXPORT_0, NFS_EXPORT_1, etc.

docker run                                                                       \
  -e NFS_EXPORT_0='/container/path/foo                  *(ro,no_subtree_check)'  \
  -e NFS_EXPORT_1='/container/path/bar 123.123.123.123/32(rw,no_subtree_check)'  \
  ...                                                                            \
  erichough/nfs-server

Correct:

provide each line of /etc/exports as an environment variable

The container will look for environment variables that start with NFS_EXPORT_ and end with an integer. e.g. NFS_EXPORT_0, NFS_EXPORT_1, etc.

docker run                                                                       \
  -e NFS_EXPORT_0=/container/path/foo                  *(ro,no_subtree_check)  \
  -e NFS_EXPORT_1=/container/path/bar 123.123.123.123/32(rw,no_subtree_check)  \
  ...                                                                            \
  erichough/nfs-server