I’ve built this Docker image over the months of using NGINX in Docker as the reverse proxy of most of my services, and this is the result.
NGINX is pulled, verified and built-from-source during build, all the necessary libraries are pulled, verified and included during build too.
Once compiled, the binary is put into an empty base image (“FROM scratch”) with only it’s necessary runtime dependencies too.
The result is a ~13MB image that contains only those files required to run NGINX, and nothing else. No bash, to UNIX toolset, no package manager…