You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 6, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+22-10Lines changed: 22 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,9 +41,9 @@ You will need to provide your desired [NFS exports](https://linux.die.net/man/5/
41
41
-v /host/files:/nfs \
42
42
--cap-add SYS_ADMIN \
43
43
-p 2049:2049 \
44
-
erichough/nfs-server:latest
44
+
erichough/nfs-server
45
45
46
-
1.**Provide each line of `/etc/exports` as an environment variable**.
46
+
1.**Provide each line of `/etc/exports` as an environment variable**
47
47
48
48
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.
49
49
@@ -54,16 +54,16 @@ You will need to provide your desired [NFS exports](https://linux.die.net/man/5/
54
54
-v /host/path/bar:/nfs/bar \
55
55
--cap-add SYS_ADMIN \
56
56
-p 2049:2049 \
57
-
erichough/nfs-server:latest
57
+
erichough/nfs-server
58
58
59
59
1.**Bake `/etc/exports` into a custom image**
60
60
61
61
e.g. in a `Dockerfile`:
62
62
63
-
FROM ehough/nfs-server:latest
63
+
FROM ehough/nfs-server
64
64
ADD /host/path/to/exports.txt /etc/exports
65
65
66
-
### (Optional) User ID Mapping
66
+
### (Optional) NFSv4 User ID Mapping
67
67
68
68
If you'd like to run [`idmapd`](http://man7.org/linux/man-pages/man8/idmapd.8.html) to map between NFSv4 IDs (e.g. `[email protected]`) and local users, simply provide [`idmapd.conf`](https://linux.die.net/man/5/idmapd.conf) and `/etc/passwd` to the container. This step is required for Kerberos.
69
69
@@ -74,7 +74,7 @@ If you'd like to run [`idmapd`](http://man7.org/linux/man-pages/man8/idmapd.8.ht
74
74
-v /etc/passwd:/etc/passwd:ro \
75
75
--cap-add SYS_ADMIN \
76
76
-p 2049:2049 \
77
-
erichough/nfs-server:latest
77
+
erichough/nfs-server
78
78
79
79
### (Optional) Kerberos
80
80
@@ -85,7 +85,7 @@ You can enable Kerberos security by performing the following additional actions:
85
85
1. provide `/etc/krb5.keytab` which contains a principal of the form `nfs/<hostname>`, where `<hostname>` is the hostname you supplied in the previous step.
86
86
1. provide [`/etc/krb5.conf`](https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html)
87
87
1. provide [`/etc/idmapd.conf`](https://linux.die.net/man/5/idmapd.conf)
88
-
1. provide `/etc/passwd`that contains your NFS client users
88
+
1. provide `/etc/passwd`containing your NFS client users
89
89
90
90
Here's an example:
91
91
@@ -100,7 +100,7 @@ Here's an example:
100
100
-v /etc/passwd:/etc/passwd:ro \
101
101
--cap-add SYS_ADMIN \
102
102
-p 2049:2049 \
103
-
erichough/nfs-server:latest
103
+
erichough/nfs-server
104
104
105
105
### Environment Variables
106
106
@@ -136,7 +136,19 @@ The following optional environment variables allow you to adjust the server sett
136
136
137
137
-**`NFS_ENABLE_KERBEROS`** (*not set by default*)
138
138
139
-
Set to a non-empty value (e.g. `NFS_ENABLE_KERBEROS=1`) to enable Kerberos on this server. See "Kerberos" section above for further details.
139
+
Set to a non-empty value (e.g. `NFS_ENABLE_KERBEROS=1`) to enable Kerberos on this server. See the [Kerberos](#kerberos) section above for further details.
140
+
141
+
### Which ports need to be exposed?
142
+
143
+
* NFSv4
144
+
*`2049`
145
+
* NFSv3
146
+
*`111` & `111/udp`
147
+
*`2049` & `2049/udp`
148
+
*`32765` & `32765/udp`
149
+
*`32767` & `32767/udp`
150
+
151
+
These ports can be exposed using the usual [Docker syntax](https://docs.docker.com/engine/reference/run/#expose-incoming-ports) (e.g. `-p 2049:2049`), and most can be customized via [environment variables](#environment-variables).
140
152
141
153
### Mounting filesystems from a client
142
154
@@ -157,7 +169,7 @@ The following optional environment variables allow you to adjust the server sett
0 commit comments