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 Jan 11, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+28-17Lines changed: 28 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,6 @@ Lua is a lightweight, high-level, multi-paradigm programming language designed p
56
56
- Security checks: Docker Bench Security, Snyk.
57
57
- Docker Healthchecks.
58
58
- Exposes default ports (`80` and `443`), easy to extend.
59
-
- Runs as non-root UID/GID `32548` (selected randomly to avoid mapping to an existing user) and uses [dumb-init](https://github.com/Yelp/dumb-init) to reap zombie processes.
60
59
- Support for multiple linux distros: Alpine, Amazon, CentOS, Debian, Fedora, Ubuntu.
If you have a more advanced configuration that requires nginx to write to other locations, simply add more volume mounts to those locations.
171
170
172
-
### Running nginx in debug mode
171
+
### Entrypoint quiet logs
173
172
174
-
Images since version 1.9.8 come with `nginx-debug` binary that produces verbose output when using higher log levels. It can be used with simple CMD substitution:
173
+
Since version 1.19.0, a verbose entrypoint was added. It provides information on what's happening during container startup. You can silence this output by setting environment variable `NGINX_ENTRYPOINT_QUIET_LOGS`:
$ docker run -d -e NGINX_ENTRYPOINT_QUIET_LOGS=1 nginx
177
176
```
178
-
Similar configuration in docker-compose.yml may look like this:
179
-
```yaml
180
-
web:
181
-
image: nginx
182
-
volumes:
183
-
- ./nginx.conf:/etc/nginx/nginx.conf:ro
184
-
command: [nginx-debug, '-g', 'daemon off;']
177
+
178
+
### User and group id
179
+
180
+
Since 1.17.0, both alpine- and debian-based images variants use the same user and group ids to drop the privileges for worker processes:
181
+
```console
182
+
$ id
183
+
uid=101(nginx) gid=101(nginx) groups=101(nginx)
185
184
```
186
185
187
-
### Entrypoint quiet logs
186
+
### Running nginx as a non-root user
188
187
189
-
Since version 1.19.0, a verbose entrypoint was added. It provides information on what's happening during container startup. You can silence this output by setting environment variable `NGINX_ENTRYPOINT_QUIET_LOGS`:
188
+
It is possible to run the image as a less privileged arbitrary UID/GID. This, however, requires modification of nginx configuration to use directories writeable by that specific UID/GID pair:
190
189
```console
191
-
$ docker run -d -e NGINX_ENTRYPOINT_QUIET_LOGS=1 nginx
190
+
$ docker run -d -v $PWD/nginx.conf:/etc/nginx/nginx.conf nginx
191
+
```
192
+
where nginx.conf in the current directory should have the following directives re-defined:
193
+
```nginx
194
+
pid /tmp/nginx.pid;
195
+
```
196
+
And in the http context:
197
+
```nginx
198
+
http {
199
+
client_body_temp_path /tmp/client_temp;
200
+
proxy_temp_path /tmp/proxy_temp_path;
201
+
fastcgi_temp_path /tmp/fastcgi_temp;
202
+
uwsgi_temp_path /tmp/uwsgi_temp;
203
+
scgi_temp_path /tmp/scgi_temp;
204
+
...
205
+
}
192
206
```
193
207
194
208
## Specs
@@ -282,7 +296,6 @@ The following are the available build-time options. They can be set using the `-
| BUILD_DEPS | Differs based on the distro | List of needed packages to build properly the software. |
284
298
| NGINX_BUILD_DEPS | Differs based on the distro | List of needed packages to build properly nginx. |
285
-
| VER_DUMBINIT | `1.2.2` | The version of [dumb-init](https://github.com/Yelp/dumb-init) to use. |
286
299
| PKG_DEPS | Differs based on the distro | List of needed packages to run properly the software. |
287
300
288
301
These built-from-source flavors include the following modules by default, but one can easily increase or decrease that with the custom build options above:
0 commit comments