Nginx (engine x) is a high-performance HTTP server, reverse proxy and load balancer. It’s known for its stability, rich feature set, simple configuration, and low resource consumption.
This Docker image provides a clean, lightweight Nginx stable release installed on Sourcemation’s Debian 13 Slim.
Run a temporary container with Nginx:
docker run --rm -it sourcemation/nginx-stable
Creating customized Nginx with a custom configuration file:
FROM sourcemation/nginx-stable
COPY nginx.conf /etc/nginx/nginx.conf
Mounting a local directory ./content to the container named static-website:
docker run -v ./content:/usr/share/nginx/html:ro --name static-website sourcemation/nginx-stable
Or create a custom image with the same content:
FROM sourcemation/nginx-stable
COPY ./content /usr/share/nginx/html
You can use the nginx.conf file as a template to create custom
configurations, but you can also create templates that use environment
variables. This image uses the envsubst to substitute environment variables in
the templating file.
The templates should be stored in the /etc/nginx/templates directory of your
customized image (it's also changeable with the NGINX_TEMPLATES_DIR
environment).
For more information about templating read the templating script (you should probably change the image tag):
docker run --rm -it sourcemation/nginx-stable /usr/bin/cat /docker-entrypoint.d/20-envsubst-on-templates.sh
The most important environment variables are:
NGINX_VERSION=X.YY.Z # Example: 1.27.5
There are also other VERSION variables, but they are more for building the image.
We welcome your contributions! If you have new feature requests, want to report a bug, or wish to submit a pull request with your code or an image request, you can do so via the Sourcemation GitHub repository for this image.
This image, unlike other images, does not remove the Nginx repository from its configuration, so it is possible to install additional Nginx-related packages.
Detailed risk analysis reports for our images and their components are available on the Sourcemation platform.
Note: Risk analysis reports are not yet available for all images. Contact us for additional software components or inquiries.
The core license for Nginx is the 2-clause BSD License.
Content type
Image
Digest
sha256:6a09f428b…
Size
61.4 MB
Last updated
13 days ago
docker pull sourcemation/nginx-stable