Return to Image List

nginx

Nginx is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server). The nginx project started with a strong focus on high concurrency, high performance and low memory usage. It is licensed under the 2-clause BSD-like license and it runs on Linux, BSD variants, Mac OS X, Solaris, AIX, HP-UX, as well as on other *nix flavors. It also has a proof of concept port for Microsoft Windows.

See nginx.org for more information

This image is built by IBM to run on the IBM Z architecture and is not affiliated with any other community that provides a version of this image.


License

View license information here

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.


Versions

Use the pull string below for the version of this image you require.
1.23.3 docker pull icr.io/ibmz/nginx@sha256:c68e9da49b80b8c65f25d6ab55509f8639134932e9fd1e3a698dd3fce100505a Vulnerability Report03-13-2023
1.23.1 docker pull icr.io/ibmz/nginx@sha256:4d86144c4e399881b1ceb056a25f185453136d4b202ded3199dff6416c2561cb Vulnerability Report08-26-2022
1.21.6 docker pull icr.io/ibmz/nginx@sha256:692304f94c2ccebc7e5de8b1c333b92c22c578398edf637e4a2f429fdf024531 Vulnerability Report06-10-2022
1.21.3 docker pull icr.io/ibmz/nginx@sha256:2ec9f7168d9c0e679c61d2656183ad921c919cfc77c58d4f2f7c0e59da0b7b8a Vulnerability Report10-01-2021
Version Pull String Security (IBM Cloud) Created

Usage Notes

Hosting some simple static content:

docker run --name some-nginx -v {nginx-volume}:/usr/share/nginx/html:ro \
        -d icr.io/ibmz/nginx:[version]

Note: As a security measure, bind mounts are disabled in ZCX. Instead, please use Docker Volumes to specify configuration files.

Alternatively, a simple Dockerfile can be used to generate a new image that includes the necessary content (which is a much cleaner solution than the bind mount above):

FROM icr.io/ibmz/nginx:[version]
COPY static-html-directory /usr/share/nginx/html

Place this file in the same directory as your directory of content ("static-html-directory"),

run docker build -t some-content-nginx .

then start your container:

docker run --name some-nginx -d icr.io/ibmz/nginx:[version]

Exposing an External Port

docker run --name some-nginx -d -p 8080:80 icr.io/ibmz/nginx:[version]

Then you can access host-ip:8080 in your browser.

Complex Configuration

docker run --name my-custom-nginx-container -v {nginx-volume}:/etc/nginx/nginx.conf:ro -d nginx

For information on the syntax of the nginx configuration files, see the official documentation. If you wish to adapt the default configuration, use something like the following to copy it from a running nginx container:

docker run --name tmp-nginx-container -d icr.io/ibmz/nginx:[version]
docker cp tmp-nginx-container:/etc/nginx/nginx.conf /host/path/nginx.conf
docker rm -f tmp-nginx-container

This can also be accomplished more cleanly using a simple Dockerfile (in /host/path/):

FROM icr.io/ibmz/nginx:[version]
COPY nginx.conf /etc/nginx/nginx.conf

If you add a custom CMD in the Dockerfile, be sure to include -g daemon off; in the CMD in order for nginx to stay in the foreground, so that Docker can track the process properly (otherwise your container will stop immediately after starting)! Then build the image with docker build -t custom-nginx . and run it as follows:

docker run --name my-custom-nginx-container -d custom-nginx