From 0d138594af9bdfa0e8639e4c15bc41f6a2099ded Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Mon, 18 May 2026 17:04:25 +0200 Subject: [PATCH 01/13] Add dist-gen source files and infrastructure --- Makefile | 8 +- manifest.yml | 70 ++++++ specs/multispec.yml | 205 ++++++++++++++++++ src/Dockerfile | 92 ++++++++ src/Dockerfile.fedora | 89 ++++++++ src/README.md | 205 ++++++++++++++++++ .../opt/app-root/etc/generate_container_user | 9 + src/root/opt/app-root/etc/passwd.template | 15 ++ src/root/opt/app-root/nginxconf-rhscl.sed | 10 + src/root/opt/app-root/nginxconf.sed | 10 + .../share/container-scripts/nginx/common.sh | 31 +++ src/s2i/bin/assemble | 50 +++++ src/s2i/bin/run | 16 ++ src/s2i/bin/usage | 19 ++ 14 files changed, 828 insertions(+), 1 deletion(-) create mode 100644 manifest.yml create mode 100644 specs/multispec.yml create mode 100644 src/Dockerfile create mode 100644 src/Dockerfile.fedora create mode 100644 src/README.md create mode 100644 src/root/opt/app-root/etc/generate_container_user create mode 100644 src/root/opt/app-root/etc/passwd.template create mode 100644 src/root/opt/app-root/nginxconf-rhscl.sed create mode 100644 src/root/opt/app-root/nginxconf.sed create mode 100644 src/root/usr/share/container-scripts/nginx/common.sh create mode 100755 src/s2i/bin/assemble create mode 100755 src/s2i/bin/run create mode 100755 src/s2i/bin/usage diff --git a/Makefile b/Makefile index f8e8c69d..b4e01f7f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ # Variables are documented in common/build.sh. BASE_IMAGE_NAME = nginx VERSIONS = 1.20 1.22 1.22-micro 1.24 1.26 -OPENSHIFT_NAMESPACES = +OPENSHIFT_NAMESPACES = +NOT_RELEASED_VERSIONS = DOCKER_BUILD_CONTEXT = .. # HACK: Ensure that 'git pull' for old clones doesn't cause confusion. @@ -9,3 +10,8 @@ DOCKER_BUILD_CONTEXT = .. .PHONY: $(shell test -f common/common.mk || echo >&2 'Please do "git submodule update --init" first.') include common/common.mk + +# use clean-versions provided by common.mk +clean-hook: clean-versions + +script_env += NOT_RELEASED_VERSIONS="$(NOT_RELEASED_VERSIONS)" diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 00000000..cd165716 --- /dev/null +++ b/manifest.yml @@ -0,0 +1,70 @@ +# Manifest for image directories creation +# every dest path will be prefixed by $DESTDIR/$version + +# Files containing distgen directives +DISTGEN_RULES: + - src: src/README.md + dest: README.md + +# Files containing distgen directives, which are used for each +# (distro, version) combination not excluded in multispec +DISTGEN_MULTI_RULES: + - src: src/Dockerfile.fedora + dest: Dockerfile.fedora + + - src: src/Dockerfile + dest: Dockerfile.rhel8 + + - src: src/Dockerfile + dest: Dockerfile.rhel9 + + - src: src/Dockerfile + dest: Dockerfile.rhel10 + + - src: src/Dockerfile + dest: Dockerfile.c8s + + - src: src/Dockerfile + dest: Dockerfile.c9s + + - src: src/Dockerfile + dest: Dockerfile.c10s + + +# Files to copy +COPY_RULES: + - src: src/s2i/bin/assemble + dest: s2i/bin/assemble + mode: "0755" + + - src: src/s2i/bin/run + dest: s2i/bin/run + mode: "0755" + + - src: src/s2i/bin/usage + dest: s2i/bin/usage + mode: "0755" + + - src: src/root/opt/app-root/nginxconf.sed + dest: root/opt/app-root/nginxconf.sed + + - src: src/root/opt/app-root/nginxconf-rhscl.sed + dest: root/opt/app-root/nginxconf-rhscl.sed + + - src: src/root/opt/app-root/etc/generate_container_user + dest: root/opt/app-root/etc/generate_container_user + mode: "0755" + + - src: src/root/opt/app-root/etc/passwd.template + dest: root/opt/app-root/etc/passwd.template + + - src: src/root/usr/share/container-scripts/nginx/common.sh + dest: root/usr/share/container-scripts/nginx/common.sh + + +# Symbolic links +# This section is the last one on purpose because the generator.py +# does not allow dead symlinks. +SYMLINK_RULES: + - src: ../test + dest: test diff --git a/specs/multispec.yml b/specs/multispec.yml new file mode 100644 index 00000000..22a67806 --- /dev/null +++ b/specs/multispec.yml @@ -0,0 +1,205 @@ +version: 1 + +specs: + distroinfo: + fedora37: + distros: + - fedora-37-x86_64 + s2i_base: quay.io/fedora/s2i-core:37 + org: "fedora" + prod: "fedora" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" + pkg_manager: "dnf" + environment_setup: "" + + fedora38: + distros: + - fedora-38-x86_64 + s2i_base: quay.io/fedora/s2i-core:38 + org: "fedora" + prod: "fedora" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" + pkg_manager: "dnf" + environment_setup: "" + + fedora40: + distros: + - fedora-40-x86_64 + s2i_base: quay.io/fedora/s2i-core:40 + org: "fedora" + prod: "fedora" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" + pkg_manager: "dnf" + environment_setup: "" + + rhel8: + distros: + - rhel-8-x86_64 + s2i_base: ubi8/s2i-core:1 + org: "ubi8" + prod: "rhel8" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + pkgs: "nginx nginx-all-modules" + pkg_manager: "yum" + environment_setup: >-4 + yum -y module enable nginx:{{ spec.version }} && \ + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + + rhel9: + distros: + - rhel-9-x86_64 + s2i_base: ubi9/s2i-core:1 + org: "ubi9" + prod: "rhel9" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + pkgs: "nginx nginx-all-modules" + pkg_manager: "yum" + environment_setup: >-4 + yum -y module enable nginx:{{ spec.version }} && \ + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + + rhel10: + distros: + - rhel-10-x86_64 + s2i_base: ubi10/s2i-core + org: "ubi10" + prod: "rhel10" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" + pkg_manager: "dnf" + environment_setup: "" + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + + c8s: + distros: + - centos-stream-8-x86_64 + s2i_base: quay.io/sclorg/s2i-core-c8s:c8s + org: "sclorg" + prod: "c8s" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + pkgs: "nginx nginx-all-modules" + pkg_manager: "yum" + environment_setup: >-4 + yum -y module enable nginx:{{ spec.version }} && \ + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + + c9s: + distros: + - centos-stream-9-x86_64 + s2i_base: quay.io/sclorg/s2i-core-c9s:c9s + org: "sclorg" + prod: "c9s" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + pkgs: "nginx nginx-all-modules" + pkg_manager: "yum" + environment_setup: >-4 + yum -y module enable nginx:{{ spec.version }} && \ + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + + c10s: + distros: + - centos-stream-10-x86_64 + s2i_base: quay.io/sclorg/s2i-core-c10s:c10s + org: "sclorg" + prod: "c10s" + openshift_tags: "builder,nginx,nginx{{ spec.short }}" + redhat_component: "nginx-{{ spec.short }}-container" + img_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" + pkg_manager: "dnf" + environment_setup: "" + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + + version: + "1.20": + version: "1.20" + short: "120" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" + latest_fedora: "f37" + + "1.22": + version: "1.22" + short: "122" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" + latest_fedora: "f37" + + "1.22-micro": + version: "1.22" + short: "122" + suffix: "-micro" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-micro-{{ spec.prod }}" + latest_fedora: "f37" + + "1.24": + version: "1.24" + short: "124" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" + latest_fedora: "f38" + + "1.26": + version: "1.26" + short: "126" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" + latest_fedora: "f40" + +matrix: + include: + - version: "1.20" + distros: + - fedora-37-x86_64 + - rhel-8-x86_64 + - rhel-9-x86_64 + - centos-stream-9-x86_64 + + - version: "1.22" + distros: + - fedora-37-x86_64 + - rhel-8-x86_64 + - rhel-9-x86_64 + - centos-stream-9-x86_64 + + - version: "1.22-micro" + distros: + - fedora-37-x86_64 + - rhel-8-x86_64 + - centos-stream-9-x86_64 + + - version: "1.24" + distros: + - fedora-38-x86_64 + - rhel-8-x86_64 + - rhel-9-x86_64 + - centos-stream-8-x86_64 + - centos-stream-9-x86_64 + + - version: "1.26" + distros: + - fedora-40-x86_64 + - rhel-8-x86_64 + - rhel-9-x86_64 + - rhel-10-x86_64 + - centos-stream-9-x86_64 + - centos-stream-10-x86_64 diff --git a/src/Dockerfile b/src/Dockerfile new file mode 100644 index 00000000..8edc9003 --- /dev/null +++ b/src/Dockerfile @@ -0,0 +1,92 @@ +FROM {{ spec.s2i_base }} + +EXPOSE 8080 +EXPOSE 8443 + +ENV NAME=nginx \ + NGINX_VERSION={{ spec.version }} \ + NGINX_SHORT_VER={{ spec.short }} \ + VERSION=0 + +ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ + DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ +protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ +image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ +as a base image for other applications based on nginx $NGINX_VERSION web server. \ +Nginx server image can be extended using source-to-image tool." + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="Nginx ${NGINX_VERSION}" \ + io.openshift.expose-services="8080:http" \ + io.openshift.expose-services="8443:https" \ + io.openshift.tags="{{ spec.openshift_tags }}" \ + com.redhat.component="{{ spec.redhat_component }}" \ + name="{{ spec.img_name }}" \ +{% if spec.prod in ["rhel8", "rhel9", "c8s", "c9s"] %} + version="1" \ +{% endif %} +{% if spec.license_terms %} + com.redhat.license_terms="{{ spec.license_terms }}" \ +{% endif %} + maintainer="SoftwareCollections.org " \ + help="For more information visit https://github.com/sclorg/${NAME}-container" \ + usage="s2i build {{ spec.img_name }}:latest " + +ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ + NGINX_CONF_PATH=/etc/nginx/nginx.conf \ + NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ + NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ + NGINX_APP_ROOT=${APP_ROOT} \ + NGINX_LOG_PATH=/var/log/nginx \ + NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl + +RUN {{ spec.environment_setup }} + INSTALL_PKGS="nss_wrapper-libs gettext hostname {{ spec.pkgs }}" && \ + {{ spec.pkg_manager }} install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ + {{ spec.pkg_manager }} -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY {{ spec.version }}/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY {{ spec.version }}/root/ / + +# Changing ownership and user rights to support following use-cases: +# 1) running container on OpenShift, whose default security model +# is to run the container under random UID, but GID=0 +# 2) for working root-less container with UID=1001, which does not have +# to have GID=0 +# 3) for default use-case, that is running container directly on operating system, +# with default UID and GID (1001:0) +# Supported combinations of UID:GID are thus following: +# UID=1001 && GID=0 +# UID=&& GID=0 +# UID=1001 && GID= +RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ + mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ + mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ + mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ + mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + mkdir -p ${NGINX_LOG_PATH} && \ + mkdir -p ${NGINX_PERL_MODULE_PATH} && \ + chown -R 1001:0 ${NGINX_CONF_PATH} && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ + chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ + chmod ug+rw ${NGINX_CONF_PATH} && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ + chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + rpm-file-permissions + +USER 1001 + +STOPSIGNAL SIGQUIT + +CMD $STI_SCRIPTS_PATH/usage diff --git a/src/Dockerfile.fedora b/src/Dockerfile.fedora new file mode 100644 index 00000000..8a34b923 --- /dev/null +++ b/src/Dockerfile.fedora @@ -0,0 +1,89 @@ +FROM {{ spec.s2i_base }} + + +EXPOSE 8080 +EXPOSE 8443 + +ENV NAME=nginx \ + NGINX_VERSION={{ spec.version }} \ + NGINX_SHORT_VER={{ spec.short }} \ + VERSION=0 \ + ARCH=x86_64 + +ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ + DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ +protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ +image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ +as a base image for other applications based on nginx $NGINX_VERSION web server. \ +Nginx server image can be extended using source-to-image tool." + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="Nginx ${NGINX_VERSION}" \ + io.openshift.expose-services="8080:http" \ + io.openshift.expose-services="8443:https" \ + io.openshift.tags="{{ spec.openshift_tags }}" \ + com.redhat.component="{{ spec.redhat_component }}" \ + name="{{ spec.img_name }}" \ + version="${VERSION}" \ + maintainer="SoftwareCollections.org " \ + help="For more information visit https://github.com/sclorg/${NAME}-container" \ + usage="s2i build ${FGC}/nginx " + +ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ + NGINX_CONF_PATH=/etc/nginx/nginx.conf \ + NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ + NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ + NGINX_APP_ROOT=${APP_ROOT} \ + NGINX_LOG_PATH=/var/log/nginx \ + NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl + +RUN {{ spec.pkg_manager }} install -y gettext hostname && \ + INSTALL_PKGS="nss_wrapper-libs {{ spec.pkgs }}" && \ + {{ spec.pkg_manager }} install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ + {{ spec.pkg_manager }} clean all + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY {{ spec.version }}/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY {{ spec.version }}/root/ / + +# Changing ownership and user rights to support following use-cases: +# 1) running container on OpenShift, whose default security model +# is to run the container under random UID, but GID=0 +# 2) for working root-less container with UID=1001, which does not have +# to have GID=0 +# 3) for default use-case, that is running container directly on operating system, +# with default UID and GID (1001:0) +# Supported combinations of UID:GID are thus following: +# UID=1001 && GID=0 +# UID=&& GID=0 +# UID=1001 && GID= +RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ + mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ + mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ + mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ + mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + mkdir -p ${NGINX_LOG_PATH} && \ + mkdir -p ${NGINX_PERL_MODULE_PATH} && \ + chown -R 1001:0 ${NGINX_CONF_PATH} && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ + chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ + chmod ug+rw ${NGINX_CONF_PATH} && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ + chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + rpm-file-permissions + +USER 1001 + +STOPSIGNAL SIGQUIT + +CMD $STI_SCRIPTS_PATH/usage diff --git a/src/README.md b/src/README.md new file mode 100644 index 00000000..a9ea1f5e --- /dev/null +++ b/src/README.md @@ -0,0 +1,205 @@ +Nginx {{ spec.version }} server and a reverse proxy server container image +============================================================ +This container image includes Nginx {{ spec.version }} server and a reverse server for OpenShift and general usage. +Users can choose between RHEL, CentOS Stream and Fedora based images. +The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), +and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). +The resulting image can be run using [podman](https://github.com/containers/libpod). + +Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. + + +Description +----------- + +Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP +protocols, with a strong focus on high concurrency, performance and low memory usage. The container +image provides a containerized packaging of the nginx {{ spec.version }} daemon. The image can be used +as a base image for other applications based on nginx {{ spec.version }} web server. +Nginx server image can be extended using Openshift's `Source` build feature. + + +Usage in OpenShift +------------------ +In this example, we assume that you are using the `ubi9/nginx-{{ spec.short }}` image, available through the `nginx:{{ spec.version }}` imagestream tag in Openshift. +To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/{{ spec.version }}/test-app) application in Openshift: + +``` +oc new-app nginx:{{ spec.version }}~https://github.com/sclorg/nginx-container.git --context-dir={{ spec.version }}/test/test-app/ +``` + +To access the application: +``` +$ oc get pods +$ oc exec -- curl 127.0.0.1:8080 +``` + + +Source-to-Image framework and scripts +------------------------------------- +This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) +(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework +which makes it easy to write images that take application source code as +an input, use a builder image like this Nginx container image, and produce +a new image that runs the assembled application as an output. + +In case of Nginx container image, the application source code is typically +either static HTML pages or configuration files. + +To support the Source-to-Image framework, important scripts are included in the builder image: + +* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). + +* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: + +**`./nginx.conf`**-- + The main nginx configuration file + +**`./nginx-cfg/*.conf`** + Should contain all nginx configuration we want to include into image + +**`./nginx-default-cfg/*.conf`** + Contains any nginx config snippets to include in the default server block + +**`./nginx-start/*.sh`** + Contains shell scripts that are sourced right before nginx is launched + +**`./nginx-perl/*.pm`** + Contains perl modules to be use by `perl_modules` and `perl_require` directives + +**`./`** + Should contain nginx application source code + + +Build an application using a Dockerfile +--------------------------------------- +Compared to the Source-to-Image strategy, using a Dockerfile is a more +flexible way to build an Nginx container image with an application. +Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or +when you build the image outside of the OpenShift environment. + +To use the Nginx image in a Dockerfile, follow these steps: + +#### 1. Pull a base builder image to build on + +podman pull ubi9/nginx-{{ spec.short }} + +#### 2. Pull an application code + +An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. + +``` +git clone https://github.com/sclorg/nginx-container.git nginx-container +cd nginx-container/examples/{{ spec.version }}/ +``` + +#### 3. Prepare an application inside a container + +This step usually consists of at least these parts: + +* putting the application source into the container +* moving configuration files to the correct place (if available in the application source code) +* setting the default command in the resulting image + +For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. + +##### 3.1. To use your own setup, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-{{ spec.short }} + +# Add application sources +ADD test-app/nginx.conf "${NGINX_CONF_PATH}" +ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" +ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" +ADD test-app/*.html . + +# Run script uses standard ways to run the application +CMD nginx -g "daemon off;" +``` + +##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-{{ spec.short }} + +# Add application sources to a directory where the assemble script expects them +# and set permissions so that the container runs without root access +# With older docker that does not support --chown option for ADD statement, +# use these statements instead: +# USER 0 +# ADD app-src /tmp/src +# RUN chown -R 1001:0 /tmp/src +# USER 1001 +ADD --chown=1001:0 app-src /tmp/src + +# Let the assemble script to install the dependencies +RUN /usr/libexec/s2i/assemble + +# Run script uses standard ways to run the application +CMD /usr/libexec/s2i/run +``` + +#### 4. Build a new image from a Dockerfile prepared in the previous step +``` +podman build -t nginx-app . +``` + +#### 5. Run the resulting image with the final application +``` +podman run -d nginx-app +``` + + +Direct usage with a mounted directory +------------------------------------- +An example of the data on the host for the following example: +``` +$ ls -lZ /wwwdata/html +-rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html +-rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html +``` + +If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host +as a container volume, execute the following command: + +``` +$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-{{ spec.short }} nginx -g "daemon off;" +``` + +This creates a container named `nginx` running the Nginx server, serving data from +the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. +You can pull the data from the nginx container using this command: + +``` +$ curl -Lk 127.0.0.1:8080 +``` + +You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. + + +Environment variables and volumes +--------------------------------- +The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: + + +**`NGINX_LOG_TO_VOLUME`** + When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. + + +Troubleshooting +--------------- +By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: + + podman logs + +See also +-------- +Dockerfile and other sources for this container image are available on +https://github.com/sclorg/nginx-container. +In that repository you also can find another versions of Python environment Dockerfiles. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. + diff --git a/src/root/opt/app-root/etc/generate_container_user b/src/root/opt/app-root/etc/generate_container_user new file mode 100644 index 00000000..229b986a --- /dev/null +++ b/src/root/opt/app-root/etc/generate_container_user @@ -0,0 +1,9 @@ +# Set current user in nss_wrapper +PASSWD_DIR="/opt/app-root/etc" + +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +envsubst < ${PASSWD_DIR}/passwd.template > ${PASSWD_DIR}/passwd +export LD_PRELOAD=libnss_wrapper.so +export NSS_WRAPPER_PASSWD=${PASSWD_DIR}/passwd +export NSS_WRAPPER_GROUP=/etc/group diff --git a/src/root/opt/app-root/etc/passwd.template b/src/root/opt/app-root/etc/passwd.template new file mode 100644 index 00000000..7ad0b787 --- /dev/null +++ b/src/root/opt/app-root/etc/passwd.template @@ -0,0 +1,15 @@ +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/sbin/nologin +daemon:x:2:2:daemon:/sbin:/sbin/nologin +adm:x:3:4:adm:/var/adm:/sbin/nologin +lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin +sync:x:5:0:sync:/sbin:/bin/sync +shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown +halt:x:7:0:halt:/sbin:/sbin/halt +mail:x:8:12:mail:/var/spool/mail:/sbin/nologin +operator:x:11:0:operator:/root:/sbin/nologin +games:x:12:100:games:/usr/games:/sbin/nologin +ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin +nobody:x:99:99:Nobody:/:/sbin/nologin +default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/sbin/nologin +apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin diff --git a/src/root/opt/app-root/nginxconf-rhscl.sed b/src/root/opt/app-root/nginxconf-rhscl.sed new file mode 100644 index 00000000..ed31f84c --- /dev/null +++ b/src/root/opt/app-root/nginxconf-rhscl.sed @@ -0,0 +1,10 @@ +/listen/s%80%8080 default_server% +s/^user *nginx;// +s%/etc/nginx/conf.d/%/opt/app-root/etc/nginx.d/% +s%/etc/nginx/default.d/%/opt/app-root/etc/nginx.default.d/% +s%/usr/share/nginx/html%/opt/app-root/src% + +# See: https://github.com/sclorg/nginx-container/pull/69 +/error_page/d +/40x.html/,+1d +/50x.html/,+1d diff --git a/src/root/opt/app-root/nginxconf.sed b/src/root/opt/app-root/nginxconf.sed new file mode 100644 index 00000000..ed31f84c --- /dev/null +++ b/src/root/opt/app-root/nginxconf.sed @@ -0,0 +1,10 @@ +/listen/s%80%8080 default_server% +s/^user *nginx;// +s%/etc/nginx/conf.d/%/opt/app-root/etc/nginx.d/% +s%/etc/nginx/default.d/%/opt/app-root/etc/nginx.default.d/% +s%/usr/share/nginx/html%/opt/app-root/src% + +# See: https://github.com/sclorg/nginx-container/pull/69 +/error_page/d +/40x.html/,+1d +/50x.html/,+1d diff --git a/src/root/usr/share/container-scripts/nginx/common.sh b/src/root/usr/share/container-scripts/nginx/common.sh new file mode 100644 index 00000000..319219cd --- /dev/null +++ b/src/root/usr/share/container-scripts/nginx/common.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# get_matched_files finds file for image extending +function get_matched_files() { + local custom_dir default_dir + custom_dir="$1" + default_dir="$2" + files_matched="$3" + find "$default_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" + [ -d "$custom_dir" ] && find "$custom_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" +} + +# process_extending_files process extending files in $1 and $2 directories +# - source all *.sh files +# (if there are files with same name source only file from $1) +function process_extending_files() { + local custom_dir default_dir + custom_dir=$1 + default_dir=$2 + while read filename ; do + if [ $filename ]; then + echo "=> sourcing $filename ..." + # Custom file is prefered + if [ -f $custom_dir/$filename ]; then + source $custom_dir/$filename + elif [ -f $default_dir/$filename ]; then + source $default_dir/$filename + fi + fi + done <<<"$(get_matched_files "$custom_dir" "$default_dir" '*.sh' | sort -u)" +} \ No newline at end of file diff --git a/src/s2i/bin/assemble b/src/s2i/bin/assemble new file mode 100755 index 00000000..0efe737d --- /dev/null +++ b/src/s2i/bin/assemble @@ -0,0 +1,50 @@ +#!/bin/bash + +set -e + +echo "---> Installing application source" +cp -Rf /tmp/src/. ./ + +# Fix source directory permissions +fix-permissions ./ + +if [ -f ./nginx.conf ]; then + echo "---> Copying nginx.conf configuration file..." + cp -v ./nginx.conf "${NGINX_CONF_PATH}" + rm -f ./nginx.conf +fi + +if [ -d ./nginx-cfg ]; then + echo "---> Copying nginx configuration files..." + if [ "$(ls -A ./nginx-cfg/*.conf)" ]; then + cp -av ./nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" + rm -rf ./nginx-cfg + fi + chmod -Rf g+rw ${NGINX_CONFIGURATION_PATH} +fi + +if [ -d ./nginx-default-cfg ]; then + echo "---> Copying nginx default server configuration files..." + if [ "$(ls -A ./nginx-default-cfg/*.conf)" ]; then + cp -av ./nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" + rm -rf ./nginx-default-cfg + fi + chmod -Rf g+rw ${NGINX_DEFAULT_CONF_PATH} +fi + +if [ -d ./nginx-start ]; then + echo "---> Copying nginx start-hook scripts..." + if [ "$(ls -A ./nginx-start/* 2>/dev/null)" ]; then + cp -av ./nginx-start/* "${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start/" + rm -rf ./nginx-start + fi +fi + +if [ -n "${NGINX_PERL_MODULE_PATH}" ] && [ -d ./nginx-perl ]; then + echo "---> Copying nginx perl module files..." + if [ "$(ls -A ./nginx-perl/*.pm)" ]; then + cp -av ./nginx-perl/*.pm "${NGINX_PERL_MODULE_PATH}" + rm -rf ./nginx-perl + fi + chmod -Rf g+rw ${NGINX_PERL_MODULE_PATH} +fi diff --git a/src/s2i/bin/run b/src/s2i/bin/run new file mode 100755 index 00000000..fd24fa40 --- /dev/null +++ b/src/s2i/bin/run @@ -0,0 +1,16 @@ +#!/bin/bash + +source /opt/app-root/etc/generate_container_user + +set -e + +source ${NGINX_CONTAINER_SCRIPTS_PATH}/common.sh + +process_extending_files ${NGINX_APP_ROOT}/src/nginx-start ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start + +if [ ! -v NGINX_LOG_TO_VOLUME -a -v NGINX_LOG_PATH ]; then + /bin/ln -sf /dev/stdout ${NGINX_LOG_PATH}/access.log + /bin/ln -sf /dev/stderr ${NGINX_LOG_PATH}/error.log +fi + +exec nginx -g "daemon off;" diff --git a/src/s2i/bin/usage b/src/s2i/bin/usage new file mode 100755 index 00000000..2abe6c1d --- /dev/null +++ b/src/s2i/bin/usage @@ -0,0 +1,19 @@ +#!/bin/sh + +DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` + +cat < Date: Mon, 18 May 2026 17:04:35 +0200 Subject: [PATCH 02/13] Regenerate version directories using dist-gen --- 1.20/.exclude-c9s | 0 1.20/.exclude-fedora | 0 1.20/.exclude-rhel8 | 0 1.20/Dockerfile.c9s | 20 ++-- 1.20/Dockerfile.fedora | 22 ++--- 1.20/Dockerfile.rhel8 | 18 ++-- 1.20/Dockerfile.rhel9 | 20 ++-- 1.20/README.md | 9 +- .../opt/app-root/etc/generate_container_user | 0 1.20/root/opt/app-root/nginxconf-rhscl.sed | 6 +- 1.20/s2i/bin/assemble | 2 +- 1.20/test | 1 + 1.20/test/__init__.py | 1 - 1.20/test/conftest.py | 1 - 1.20/test/constants.py | 1 - 1.20/test/examples | 1 - 1.20/test/imagestreams | 1 - 1.20/test/perl-test-app/index.html | 8 -- 1.20/test/perl-test-app/nginx-perl/Version.pm | 17 ---- 1.20/test/perl-test-app/nginx.conf | 99 ------------------- 1.20/test/run | 1 - 1.20/test/run-openshift-pytest | 1 - 1.20/test/run-openshift-remote-cluster | 1 - 1.20/test/run-pytest | 1 - 1.20/test/start-hook-test-app/index.html | 8 -- 1.20/test/start-hook-test-app/index2.html | 8 -- .../nginx-cfg/default.conf | 8 -- .../start-hook-test-app/nginx-start/init.sh | 19 ---- 1.20/test/test-app | 1 - 1.20/test/test-lib-nginx.sh | 1 - 1.20/test/test-lib-openshift.sh | 1 - 1.20/test/test-lib-remote-openshift.sh | 1 - 1.20/test/test-lib.sh | 1 - 1.20/test/test-openshift.yaml | 1 - 1.20/test/test_container_application.py | 1 - 1.20/test/test_container_basics.py | 1 - 1.20/test/test_container_example_apps.py | 1 - 1.20/test/test_container_sizes.py | 1 - 1.20/test/test_ocp_imagestream_s2i.py | 1 - 1.20/test/test_ocp_imagestreams.py | 1 - 1.20/test/test_ocp_local_example.py | 1 - 1.20/test/test_ocp_remote_example.py | 1 - .../test/test_ocp_shared_helm_imagestreams.py | 1 - 1.20/test/test_ocp_shared_helm_template.py | 1 - 1.20/test/test_ocp_template_example_app.py | 1 - 1.22-micro/.exclude-fedora | 0 1.22-micro/Dockerfile.c9s | 72 +++++--------- 1.22-micro/Dockerfile.fedora | 71 +++++-------- 1.22-micro/Dockerfile.rhel8 | 73 +++++--------- 1.22-micro/README.md | 25 +++-- 1.22-micro/core-scripts | 1 - 1.22-micro/root | 1 - .../opt/app-root/etc/generate_container_user | 9 ++ .../root/opt/app-root/etc/passwd.template | 15 +++ .../root/opt/app-root/nginxconf-rhscl.sed | 10 ++ 1.22-micro/root/opt/app-root/nginxconf.sed | 10 ++ .../share/container-scripts/nginx/common.sh | 31 ++++++ 1.22-micro/s2i | 1 - 1.22-micro/s2i/bin/assemble | 50 ++++++++++ 1.22-micro/s2i/bin/run | 16 +++ 1.22-micro/s2i/bin/usage | 19 ++++ 1.22-micro/test | 2 +- 1.22/.exclude-c9s | 0 1.22/.exclude-fedora | 0 1.22/Dockerfile.c9s | 24 ++--- 1.22/Dockerfile.fedora | 19 +--- 1.22/Dockerfile.rhel8 | 17 ++-- 1.22/Dockerfile.rhel9 | 19 ++-- 1.22/README.md | 6 +- .../opt/app-root/etc/generate_container_user | 0 1.22/test | 1 + 1.22/test/__init__.py | 1 - 1.22/test/conftest.py | 1 - 1.22/test/examples | 1 - 1.22/test/imagestreams | 1 - 1.22/test/perl-test-app/index.html | 8 -- 1.22/test/perl-test-app/nginx-perl/Version.pm | 17 ---- 1.22/test/perl-test-app/nginx.conf | 99 ------------------- 1.22/test/run | 1 - 1.22/test/run-openshift-pytest | 1 - 1.22/test/run-openshift-remote-cluster | 1 - 1.22/test/run-pytest | 1 - 1.22/test/start-hook-test-app/index.html | 8 -- 1.22/test/start-hook-test-app/index2.html | 8 -- .../nginx-cfg/default.conf | 8 -- .../start-hook-test-app/nginx-start/init.sh | 19 ---- 1.22/test/test-app | 1 - 1.22/test/test-lib-nginx.sh | 1 - 1.22/test/test-lib-openshift.sh | 1 - 1.22/test/test-lib-remote-openshift.sh | 1 - 1.22/test/test-lib.sh | 1 - 1.22/test/test-openshift.yaml | 1 - 1.22/test/test_container_application.py | 1 - 1.22/test/test_container_basics.py | 1 - 1.22/test/test_container_example_apps.py | 1 - 1.22/test/test_container_sizes.py | 1 - 1.22/test/test_ocp_imagestream_s2i.py | 1 - 1.22/test/test_ocp_imagestreams.py | 1 - 1.22/test/test_ocp_local_example.py | 1 - 1.22/test/test_ocp_remote_example.py | 1 - .../test/test_ocp_shared_helm_imagestreams.py | 1 - 1.22/test/test_ocp_shared_helm_template.py | 1 - 1.22/test/test_ocp_template_example_app.py | 1 - 1.24/.exclude-c8s | 0 1.24/.exclude-fedora | 0 1.24/Dockerfile.c8s | 16 +-- 1.24/Dockerfile.c9s | 17 ++-- 1.24/Dockerfile.fedora | 14 +-- 1.24/Dockerfile.rhel8 | 12 +-- 1.24/Dockerfile.rhel9 | 14 +-- 1.24/README.md | 4 +- .../opt/app-root/etc/generate_container_user | 0 1.24/test | 1 + 1.24/test/__init__.py | 1 - 1.24/test/conftest.py | 1 - 1.24/test/constants.py | 1 - 1.24/test/examples | 1 - 1.24/test/imagestreams | 1 - 1.24/test/perl-test-app/index.html | 8 -- 1.24/test/perl-test-app/nginx-perl/Version.pm | 17 ---- 1.24/test/perl-test-app/nginx.conf | 99 ------------------- 1.24/test/run | 1 - 1.24/test/run-openshift-pytest | 1 - 1.24/test/run-openshift-remote-cluster | 1 - 1.24/test/run-pytest | 1 - 1.24/test/start-hook-test-app/index.html | 8 -- 1.24/test/start-hook-test-app/index2.html | 8 -- .../nginx-cfg/default.conf | 8 -- .../start-hook-test-app/nginx-start/init.sh | 19 ---- 1.24/test/test-app | 1 - 1.24/test/test-lib.sh | 1 - 1.24/test/test_container_application.py | 1 - 1.24/test/test_container_basics.py | 1 - 1.24/test/test_container_example_apps.py | 1 - 1.24/test/test_container_sizes.py | 1 - 1.24/test/test_ocp_imagestream_s2i.py | 1 - 1.24/test/test_ocp_imagestreams.py | 1 - 1.24/test/test_ocp_local_example.py | 1 - 1.24/test/test_ocp_remote_example.py | 1 - .../test/test_ocp_shared_helm_imagestreams.py | 1 - 1.24/test/test_ocp_shared_helm_template.py | 1 - 1.24/test/test_ocp_template_example_app.py | 1 - 1.26/.exclude-rhel8 | 0 1.26/Dockerfile.c10s | 17 ++-- 1.26/Dockerfile.c9s | 17 ++-- 1.26/Dockerfile.fedora | 10 +- 1.26/Dockerfile.rhel10 | 16 +-- 1.26/Dockerfile.rhel8 | 16 +-- 1.26/Dockerfile.rhel9 | 14 +-- .../opt/app-root/etc/generate_container_user | 0 1.26/test | 1 + 1.26/test/__init__.py | 1 - 1.26/test/conftest.py | 1 - 1.26/test/examples | 1 - 1.26/test/imagestreams | 1 - 1.26/test/perl-test-app/index.html | 8 -- 1.26/test/perl-test-app/nginx-perl/Version.pm | 17 ---- 1.26/test/perl-test-app/nginx.conf | 99 ------------------- 1.26/test/run | 1 - 1.26/test/run-openshift-remote-cluster | 1 - 1.26/test/run-pytest | 1 - 1.26/test/start-hook-test-app/index.html | 8 -- 1.26/test/start-hook-test-app/index2.html | 8 -- .../nginx-cfg/default.conf | 8 -- .../start-hook-test-app/nginx-start/init.sh | 19 ---- 1.26/test/test-app | 1 - 1.26/test/test-lib-nginx.sh | 1 - 1.26/test/test-lib-openshift.sh | 1 - 1.26/test/test-lib-remote-openshift.sh | 1 - 1.26/test/test-lib.sh | 1 - 1.26/test/test-openshift.yaml | 1 - 1.26/test/test_container_application.py | 1 - 1.26/test/test_container_basics.py | 1 - 1.26/test/test_container_example_apps.py | 1 - 1.26/test/test_container_sizes.py | 1 - 1.26/test/test_ocp_imagestream_s2i.py | 1 - 1.26/test/test_ocp_imagestreams.py | 1 - 1.26/test/test_ocp_local_example.py | 1 - 1.26/test/test_ocp_remote_example.py | 1 - .../test/test_ocp_shared_helm_imagestreams.py | 1 - 1.26/test/test_ocp_shared_helm_template.py | 1 - 1.26/test/test_ocp_template_example_app.py | 1 - 182 files changed, 402 insertions(+), 1122 deletions(-) delete mode 100644 1.20/.exclude-c9s delete mode 100644 1.20/.exclude-fedora delete mode 100644 1.20/.exclude-rhel8 mode change 100644 => 100755 1.20/root/opt/app-root/etc/generate_container_user create mode 120000 1.20/test delete mode 120000 1.20/test/__init__.py delete mode 120000 1.20/test/conftest.py delete mode 120000 1.20/test/constants.py delete mode 120000 1.20/test/examples delete mode 120000 1.20/test/imagestreams delete mode 100644 1.20/test/perl-test-app/index.html delete mode 100644 1.20/test/perl-test-app/nginx-perl/Version.pm delete mode 100644 1.20/test/perl-test-app/nginx.conf delete mode 120000 1.20/test/run delete mode 120000 1.20/test/run-openshift-pytest delete mode 120000 1.20/test/run-openshift-remote-cluster delete mode 120000 1.20/test/run-pytest delete mode 100644 1.20/test/start-hook-test-app/index.html delete mode 100644 1.20/test/start-hook-test-app/index2.html delete mode 100644 1.20/test/start-hook-test-app/nginx-cfg/default.conf delete mode 100644 1.20/test/start-hook-test-app/nginx-start/init.sh delete mode 120000 1.20/test/test-app delete mode 120000 1.20/test/test-lib-nginx.sh delete mode 120000 1.20/test/test-lib-openshift.sh delete mode 120000 1.20/test/test-lib-remote-openshift.sh delete mode 120000 1.20/test/test-lib.sh delete mode 120000 1.20/test/test-openshift.yaml delete mode 120000 1.20/test/test_container_application.py delete mode 120000 1.20/test/test_container_basics.py delete mode 120000 1.20/test/test_container_example_apps.py delete mode 120000 1.20/test/test_container_sizes.py delete mode 120000 1.20/test/test_ocp_imagestream_s2i.py delete mode 120000 1.20/test/test_ocp_imagestreams.py delete mode 120000 1.20/test/test_ocp_local_example.py delete mode 120000 1.20/test/test_ocp_remote_example.py delete mode 120000 1.20/test/test_ocp_shared_helm_imagestreams.py delete mode 120000 1.20/test/test_ocp_shared_helm_template.py delete mode 120000 1.20/test/test_ocp_template_example_app.py delete mode 100644 1.22-micro/.exclude-fedora delete mode 120000 1.22-micro/core-scripts delete mode 120000 1.22-micro/root create mode 100755 1.22-micro/root/opt/app-root/etc/generate_container_user create mode 100644 1.22-micro/root/opt/app-root/etc/passwd.template create mode 100644 1.22-micro/root/opt/app-root/nginxconf-rhscl.sed create mode 100644 1.22-micro/root/opt/app-root/nginxconf.sed create mode 100644 1.22-micro/root/usr/share/container-scripts/nginx/common.sh delete mode 120000 1.22-micro/s2i create mode 100755 1.22-micro/s2i/bin/assemble create mode 100755 1.22-micro/s2i/bin/run create mode 100755 1.22-micro/s2i/bin/usage delete mode 100644 1.22/.exclude-c9s delete mode 100644 1.22/.exclude-fedora mode change 100644 => 100755 1.22/root/opt/app-root/etc/generate_container_user create mode 120000 1.22/test delete mode 120000 1.22/test/__init__.py delete mode 120000 1.22/test/conftest.py delete mode 120000 1.22/test/examples delete mode 120000 1.22/test/imagestreams delete mode 100644 1.22/test/perl-test-app/index.html delete mode 100644 1.22/test/perl-test-app/nginx-perl/Version.pm delete mode 100644 1.22/test/perl-test-app/nginx.conf delete mode 120000 1.22/test/run delete mode 120000 1.22/test/run-openshift-pytest delete mode 120000 1.22/test/run-openshift-remote-cluster delete mode 120000 1.22/test/run-pytest delete mode 100644 1.22/test/start-hook-test-app/index.html delete mode 100644 1.22/test/start-hook-test-app/index2.html delete mode 100644 1.22/test/start-hook-test-app/nginx-cfg/default.conf delete mode 100644 1.22/test/start-hook-test-app/nginx-start/init.sh delete mode 120000 1.22/test/test-app delete mode 120000 1.22/test/test-lib-nginx.sh delete mode 120000 1.22/test/test-lib-openshift.sh delete mode 120000 1.22/test/test-lib-remote-openshift.sh delete mode 120000 1.22/test/test-lib.sh delete mode 120000 1.22/test/test-openshift.yaml delete mode 120000 1.22/test/test_container_application.py delete mode 120000 1.22/test/test_container_basics.py delete mode 120000 1.22/test/test_container_example_apps.py delete mode 120000 1.22/test/test_container_sizes.py delete mode 120000 1.22/test/test_ocp_imagestream_s2i.py delete mode 120000 1.22/test/test_ocp_imagestreams.py delete mode 120000 1.22/test/test_ocp_local_example.py delete mode 120000 1.22/test/test_ocp_remote_example.py delete mode 120000 1.22/test/test_ocp_shared_helm_imagestreams.py delete mode 120000 1.22/test/test_ocp_shared_helm_template.py delete mode 120000 1.22/test/test_ocp_template_example_app.py delete mode 100644 1.24/.exclude-c8s delete mode 100644 1.24/.exclude-fedora mode change 100644 => 100755 1.24/root/opt/app-root/etc/generate_container_user create mode 120000 1.24/test delete mode 120000 1.24/test/__init__.py delete mode 120000 1.24/test/conftest.py delete mode 120000 1.24/test/constants.py delete mode 120000 1.24/test/examples delete mode 120000 1.24/test/imagestreams delete mode 100644 1.24/test/perl-test-app/index.html delete mode 100644 1.24/test/perl-test-app/nginx-perl/Version.pm delete mode 100644 1.24/test/perl-test-app/nginx.conf delete mode 120000 1.24/test/run delete mode 120000 1.24/test/run-openshift-pytest delete mode 120000 1.24/test/run-openshift-remote-cluster delete mode 120000 1.24/test/run-pytest delete mode 100644 1.24/test/start-hook-test-app/index.html delete mode 100644 1.24/test/start-hook-test-app/index2.html delete mode 100644 1.24/test/start-hook-test-app/nginx-cfg/default.conf delete mode 100644 1.24/test/start-hook-test-app/nginx-start/init.sh delete mode 120000 1.24/test/test-app delete mode 120000 1.24/test/test-lib.sh delete mode 120000 1.24/test/test_container_application.py delete mode 120000 1.24/test/test_container_basics.py delete mode 120000 1.24/test/test_container_example_apps.py delete mode 120000 1.24/test/test_container_sizes.py delete mode 120000 1.24/test/test_ocp_imagestream_s2i.py delete mode 120000 1.24/test/test_ocp_imagestreams.py delete mode 120000 1.24/test/test_ocp_local_example.py delete mode 120000 1.24/test/test_ocp_remote_example.py delete mode 120000 1.24/test/test_ocp_shared_helm_imagestreams.py delete mode 120000 1.24/test/test_ocp_shared_helm_template.py delete mode 120000 1.24/test/test_ocp_template_example_app.py delete mode 100644 1.26/.exclude-rhel8 mode change 100644 => 100755 1.26/root/opt/app-root/etc/generate_container_user create mode 120000 1.26/test delete mode 120000 1.26/test/__init__.py delete mode 120000 1.26/test/conftest.py delete mode 120000 1.26/test/examples delete mode 120000 1.26/test/imagestreams delete mode 100644 1.26/test/perl-test-app/index.html delete mode 100644 1.26/test/perl-test-app/nginx-perl/Version.pm delete mode 100644 1.26/test/perl-test-app/nginx.conf delete mode 120000 1.26/test/run delete mode 120000 1.26/test/run-openshift-remote-cluster delete mode 120000 1.26/test/run-pytest delete mode 100644 1.26/test/start-hook-test-app/index.html delete mode 100644 1.26/test/start-hook-test-app/index2.html delete mode 100644 1.26/test/start-hook-test-app/nginx-cfg/default.conf delete mode 100644 1.26/test/start-hook-test-app/nginx-start/init.sh delete mode 120000 1.26/test/test-app delete mode 120000 1.26/test/test-lib-nginx.sh delete mode 120000 1.26/test/test-lib-openshift.sh delete mode 120000 1.26/test/test-lib-remote-openshift.sh delete mode 120000 1.26/test/test-lib.sh delete mode 120000 1.26/test/test-openshift.yaml delete mode 120000 1.26/test/test_container_application.py delete mode 120000 1.26/test/test_container_basics.py delete mode 120000 1.26/test/test_container_example_apps.py delete mode 120000 1.26/test/test_container_sizes.py delete mode 120000 1.26/test/test_ocp_imagestream_s2i.py delete mode 120000 1.26/test/test_ocp_imagestreams.py delete mode 120000 1.26/test/test_ocp_local_example.py delete mode 120000 1.26/test/test_ocp_remote_example.py delete mode 120000 1.26/test/test_ocp_shared_helm_imagestreams.py delete mode 120000 1.26/test/test_ocp_shared_helm_template.py delete mode 120000 1.26/test/test_ocp_template_example_app.py diff --git a/1.20/.exclude-c9s b/1.20/.exclude-c9s deleted file mode 100644 index e69de29b..00000000 diff --git a/1.20/.exclude-fedora b/1.20/.exclude-fedora deleted file mode 100644 index e69de29b..00000000 diff --git a/1.20/.exclude-rhel8 b/1.20/.exclude-rhel8 deleted file mode 100644 index e69de29b..00000000 diff --git a/1.20/Dockerfile.c9s b/1.20/Dockerfile.c9s index 7295ee5f..7ecf681a 100644 --- a/1.20/Dockerfile.c9s +++ b/1.20/Dockerfile.c9s @@ -1,4 +1,4 @@ -FROM quay.io/sclorg/s2i-base-c9s:c9s +FROM quay.io/sclorg/s2i-core-c9s:c9s EXPOSE 8080 EXPOSE 8443 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}-c9s" \ + io.openshift.tags="builder,nginx,nginx120" \ + com.redhat.component="nginx-120-container" \ + name="sclorg/nginx-120-c9s" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c9s:latest " + usage="s2i build sclorg/nginx-120-c9s:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,9 +38,8 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -# Modules does not exist -# RUN yum -y module enable nginx:$NGINX_VERSION && \ -RUN INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN yum -y module enable nginx:1.20 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ @@ -86,9 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/Dockerfile.fedora b/1.20/Dockerfile.fedora index 4a5bce64..1c8a28da 100644 --- a/1.20/Dockerfile.fedora +++ b/1.20/Dockerfile.fedora @@ -1,9 +1,5 @@ FROM quay.io/fedora/s2i-core:37 -# nginx 1.20 image. -# -# Volumes: -# * /var/log/nginx/ - Storage for logs EXPOSE 8080 EXPOSE 8443 @@ -27,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx120" \ + com.redhat.component="nginx-120-container" \ + name="fedora/nginx-120" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -44,18 +40,17 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl RUN dnf install -y gettext hostname && \ - yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper nginx nginx-mod-stream nginx-mod-http-perl" && \ + INSTALL_PKGS="nss_wrapper-libs nginx nginx-mod-stream nginx-mod-http-perl" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.20/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.20/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -91,9 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/Dockerfile.rhel8 b/1.20/Dockerfile.rhel8 index 6070555c..e9cbdbf2 100644 --- a/1.20/Dockerfile.rhel8 +++ b/1.20/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx120" \ + com.redhat.component="nginx-120-container" \ + name="ubi8/nginx-120" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi8/nginx-120:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,8 +38,8 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN yum -y module enable nginx:1.20 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ @@ -51,7 +51,6 @@ COPY 1.20/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. COPY 1.20/root/ / - # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model # is to run the container under random UID, but GID=0 @@ -86,9 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/Dockerfile.rhel9 b/1.20/Dockerfile.rhel9 index 942f36a0..26d74d66 100644 --- a/1.20/Dockerfile.rhel9 +++ b/1.20/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx120" \ + com.redhat.component="nginx-120-container" \ + name="ubi9/nginx-120" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi9/nginx-120:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,17 +38,18 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-all-modules" && \ +RUN yum -y module enable nginx:1.20 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.20/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.20/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -84,9 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/README.md b/1.20/README.md index 6c11944b..a0839469 100644 --- a/1.20/README.md +++ b/1.20/README.md @@ -194,15 +194,12 @@ By default, nginx access logs are written to standard output and error logs are podman logs -**If `NGINX_LOG_TO_VOLUME` variable is set, nginx logs into `/var/log/nginx/`.** - - See also -------- Dockerfile and other sources for this container image are available on https://github.com/sclorg/nginx-container. In that repository you also can find another versions of Python environment Dockerfiles. -Dockerfile for RHEL8 it's `Dockerfile.rhel8`, -for RHEL9 it's `Dockerfile.rhel9`, Dockerfile for CentOS Stream 8 is called `Dockerfile.c8s`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s` and the Fedora Dockerfile is called `Dockerfile.fedora`. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. diff --git a/1.20/root/opt/app-root/etc/generate_container_user b/1.20/root/opt/app-root/etc/generate_container_user old mode 100644 new mode 100755 diff --git a/1.20/root/opt/app-root/nginxconf-rhscl.sed b/1.20/root/opt/app-root/nginxconf-rhscl.sed index 03cd00e0..ed31f84c 100644 --- a/1.20/root/opt/app-root/nginxconf-rhscl.sed +++ b/1.20/root/opt/app-root/nginxconf-rhscl.sed @@ -1,8 +1,8 @@ /listen/s%80%8080 default_server% s/^user *nginx;// -s%/etc/opt/rh/rh-nginx120/nginx/conf.d/%/opt/app-root/etc/nginx.d/% -s%/etc/opt/rh/rh-nginx120/nginx/default.d/%/opt/app-root/etc/nginx.default.d/% -s%/opt/rh/rh-nginx120/root/usr/share/nginx/html%/opt/app-root/src% +s%/etc/nginx/conf.d/%/opt/app-root/etc/nginx.d/% +s%/etc/nginx/default.d/%/opt/app-root/etc/nginx.default.d/% +s%/usr/share/nginx/html%/opt/app-root/src% # See: https://github.com/sclorg/nginx-container/pull/69 /error_page/d diff --git a/1.20/s2i/bin/assemble b/1.20/s2i/bin/assemble index 5aa2a954..0efe737d 100755 --- a/1.20/s2i/bin/assemble +++ b/1.20/s2i/bin/assemble @@ -40,7 +40,7 @@ if [ -d ./nginx-start ]; then fi fi -if [ -d ./nginx-perl ]; then +if [ -n "${NGINX_PERL_MODULE_PATH}" ] && [ -d ./nginx-perl ]; then echo "---> Copying nginx perl module files..." if [ "$(ls -A ./nginx-perl/*.pm)" ]; then cp -av ./nginx-perl/*.pm "${NGINX_PERL_MODULE_PATH}" diff --git a/1.20/test b/1.20/test new file mode 120000 index 00000000..419df4f9 --- /dev/null +++ b/1.20/test @@ -0,0 +1 @@ +../test \ No newline at end of file diff --git a/1.20/test/__init__.py b/1.20/test/__init__.py deleted file mode 120000 index d0f4746a..00000000 --- a/1.20/test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../test/__init__.py \ No newline at end of file diff --git a/1.20/test/conftest.py b/1.20/test/conftest.py deleted file mode 120000 index 3f2d7840..00000000 --- a/1.20/test/conftest.py +++ /dev/null @@ -1 +0,0 @@ -../../test/conftest.py \ No newline at end of file diff --git a/1.20/test/constants.py b/1.20/test/constants.py deleted file mode 120000 index 360f725b..00000000 --- a/1.20/test/constants.py +++ /dev/null @@ -1 +0,0 @@ -../../test/constants.py \ No newline at end of file diff --git a/1.20/test/examples b/1.20/test/examples deleted file mode 120000 index da7b1965..00000000 --- a/1.20/test/examples +++ /dev/null @@ -1 +0,0 @@ -../../examples/ \ No newline at end of file diff --git a/1.20/test/imagestreams b/1.20/test/imagestreams deleted file mode 120000 index 0dcbe9e0..00000000 --- a/1.20/test/imagestreams +++ /dev/null @@ -1 +0,0 @@ -../../imagestreams/ \ No newline at end of file diff --git a/1.20/test/perl-test-app/index.html b/1.20/test/perl-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.20/test/perl-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.20/test/perl-test-app/nginx-perl/Version.pm b/1.20/test/perl-test-app/nginx-perl/Version.pm deleted file mode 100644 index 7e047895..00000000 --- a/1.20/test/perl-test-app/nginx-perl/Version.pm +++ /dev/null @@ -1,17 +0,0 @@ -package Version; - -use nginx; - -sub installed { - return "$^V"; -} - -sub handler { - my $r = shift; - $r->send_http_header("text/html"); - $r->print("Perl location handler is working"); - return OK; -} - -1; -__END__ diff --git a/1.20/test/perl-test-app/nginx.conf b/1.20/test/perl-test-app/nginx.conf deleted file mode 100644 index c96bc69f..00000000 --- a/1.20/test/perl-test-app/nginx.conf +++ /dev/null @@ -1,99 +0,0 @@ -# For more information on configuration, see: -# * Official English Documentation: http://nginx.org/en/docs/ -# * Official Russian Documentation: http://nginx.org/ru/docs/ - - -worker_processes auto; -error_log /var/log/nginx/error.log; -pid /run/nginx.pid; - -# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. -include /usr/share/nginx/modules/*.conf; - -events { - worker_connections 1024; -} - -http { - perl_modules /opt/app-root/etc/perl; - perl_require Version.pm; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - perl_set $perl_version Version::installed; - add_header X-Perl-Version $perl_version; - - # Load modular configuration files from the /etc/nginx/conf.d directory. - # See http://nginx.org/en/docs/ngx_core_module.html#include - # for more information. - include /opt/app-root/etc/nginx.d/*.conf; - - server { - listen 8080 default_server; - listen [::]:8080 default_server; - server_name _; - root /opt/app-root/src; - - # Load configuration files for the default server block. - include /opt/app-root/etc/nginx.default.d/*.conf; - - location / { - } - - location /perl { - perl Version::handler; - } - - error_page 404 /404.html; - location = /40x.html { - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - } - } - -# Settings for a TLS enabled server. -# -# server { -# listen 443 ssl http2 default_server; -# listen [::]:443 ssl http2 default_server; -# server_name _; -# root /opt/app-root/src; -# -# ssl_certificate "/etc/pki/nginx/server.crt"; -# ssl_certificate_key "/etc/pki/nginx/private/server.key"; -# ssl_session_cache shared:SSL:1m; -# ssl_session_timeout 10m; -# ssl_ciphers PROFILE=SYSTEM; -# ssl_prefer_server_ciphers on; -# -# # Load configuration files for the default server block. -# include /opt/app-root/etc/nginx.default.d/*.conf; -# -# location / { -# } -# -# error_page 404 /404.html; -# location = /40x.html { -# } -# -# error_page 500 502 503 504 /50x.html; -# location = /50x.html { -# } -# } - -} - diff --git a/1.20/test/run b/1.20/test/run deleted file mode 120000 index 44977d63..00000000 --- a/1.20/test/run +++ /dev/null @@ -1 +0,0 @@ -../../test/run \ No newline at end of file diff --git a/1.20/test/run-openshift-pytest b/1.20/test/run-openshift-pytest deleted file mode 120000 index 5063ae30..00000000 --- a/1.20/test/run-openshift-pytest +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-pytest \ No newline at end of file diff --git a/1.20/test/run-openshift-remote-cluster b/1.20/test/run-openshift-remote-cluster deleted file mode 120000 index 1bffcba8..00000000 --- a/1.20/test/run-openshift-remote-cluster +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-remote-cluster \ No newline at end of file diff --git a/1.20/test/run-pytest b/1.20/test/run-pytest deleted file mode 120000 index efe32b48..00000000 --- a/1.20/test/run-pytest +++ /dev/null @@ -1 +0,0 @@ -../../test/run-pytest \ No newline at end of file diff --git a/1.20/test/start-hook-test-app/index.html b/1.20/test/start-hook-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.20/test/start-hook-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.20/test/start-hook-test-app/index2.html b/1.20/test/start-hook-test-app/index2.html deleted file mode 100644 index e73a98c6..00000000 --- a/1.20/test/start-hook-test-app/index2.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX2 is working

- - diff --git a/1.20/test/start-hook-test-app/nginx-cfg/default.conf b/1.20/test/start-hook-test-app/nginx-cfg/default.conf deleted file mode 100644 index e947c98b..00000000 --- a/1.20/test/start-hook-test-app/nginx-cfg/default.conf +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen 8080; - server_name localhost2; - root /opt/app-root/src; - index ${INDEX_FILE}; - resolver ${DNS_SERVER}; - -} \ No newline at end of file diff --git a/1.20/test/start-hook-test-app/nginx-start/init.sh b/1.20/test/start-hook-test-app/nginx-start/init.sh deleted file mode 100644 index 132164e2..00000000 --- a/1.20/test/start-hook-test-app/nginx-start/init.sh +++ /dev/null @@ -1,19 +0,0 @@ -setup_dns_env_var() { - if [ -z "$DNS_SERVER" ]; then - export DNS_SERVER=`cat /etc/resolv.conf | grep "nameserver " | cut -d " " -f 2 | tr '\n' ' '` - echo "Using system dns server ${DNS_SERVER}" - else - echo "Using user defined dns server: ${DNS_SERVER}" - fi -} - -inject_env_vars() { - ## Replace only specified environment variables in specified file. - envsubst '${DNS_SERVER},${INDEX_FILE}' < ${NGINX_CONFIGURATION_PATH}/$1 > output.conf - cp output.conf ${NGINX_CONFIGURATION_PATH}/$1 - echo "This is $1: " && cat ${NGINX_CONFIGURATION_PATH}/$1 -} - -export INDEX_FILE=index2.html -setup_dns_env_var -inject_env_vars "default.conf" diff --git a/1.20/test/test-app b/1.20/test/test-app deleted file mode 120000 index 900defd5..00000000 --- a/1.20/test/test-app +++ /dev/null @@ -1 +0,0 @@ -../../examples/1.20/test-app/ \ No newline at end of file diff --git a/1.20/test/test-lib-nginx.sh b/1.20/test/test-lib-nginx.sh deleted file mode 120000 index 300738f7..00000000 --- a/1.20/test/test-lib-nginx.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-nginx.sh \ No newline at end of file diff --git a/1.20/test/test-lib-openshift.sh b/1.20/test/test-lib-openshift.sh deleted file mode 120000 index 4f9f2996..00000000 --- a/1.20/test/test-lib-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib-openshift.sh \ No newline at end of file diff --git a/1.20/test/test-lib-remote-openshift.sh b/1.20/test/test-lib-remote-openshift.sh deleted file mode 120000 index 92ad2f4d..00000000 --- a/1.20/test/test-lib-remote-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib-remote-openshift.sh \ No newline at end of file diff --git a/1.20/test/test-lib.sh b/1.20/test/test-lib.sh deleted file mode 120000 index 1ac99b93..00000000 --- a/1.20/test/test-lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib.sh \ No newline at end of file diff --git a/1.20/test/test-openshift.yaml b/1.20/test/test-openshift.yaml deleted file mode 120000 index 8613fbba..00000000 --- a/1.20/test/test-openshift.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/test-openshift.yaml \ No newline at end of file diff --git a/1.20/test/test_container_application.py b/1.20/test/test_container_application.py deleted file mode 120000 index 25c1c1ec..00000000 --- a/1.20/test/test_container_application.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_application.py \ No newline at end of file diff --git a/1.20/test/test_container_basics.py b/1.20/test/test_container_basics.py deleted file mode 120000 index b85dc139..00000000 --- a/1.20/test/test_container_basics.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_basics.py \ No newline at end of file diff --git a/1.20/test/test_container_example_apps.py b/1.20/test/test_container_example_apps.py deleted file mode 120000 index 79a89de1..00000000 --- a/1.20/test/test_container_example_apps.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_example_apps.py \ No newline at end of file diff --git a/1.20/test/test_container_sizes.py b/1.20/test/test_container_sizes.py deleted file mode 120000 index 0ccb0a71..00000000 --- a/1.20/test/test_container_sizes.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_sizes.py \ No newline at end of file diff --git a/1.20/test/test_ocp_imagestream_s2i.py b/1.20/test/test_ocp_imagestream_s2i.py deleted file mode 120000 index 89eb6791..00000000 --- a/1.20/test/test_ocp_imagestream_s2i.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestream_s2i.py \ No newline at end of file diff --git a/1.20/test/test_ocp_imagestreams.py b/1.20/test/test_ocp_imagestreams.py deleted file mode 120000 index ee905e77..00000000 --- a/1.20/test/test_ocp_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestreams.py \ No newline at end of file diff --git a/1.20/test/test_ocp_local_example.py b/1.20/test/test_ocp_local_example.py deleted file mode 120000 index f2f3e849..00000000 --- a/1.20/test/test_ocp_local_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_local_example.py \ No newline at end of file diff --git a/1.20/test/test_ocp_remote_example.py b/1.20/test/test_ocp_remote_example.py deleted file mode 120000 index 7a912c02..00000000 --- a/1.20/test/test_ocp_remote_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_remote_example.py \ No newline at end of file diff --git a/1.20/test/test_ocp_shared_helm_imagestreams.py b/1.20/test/test_ocp_shared_helm_imagestreams.py deleted file mode 120000 index 76d5701d..00000000 --- a/1.20/test/test_ocp_shared_helm_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_imagestreams.py \ No newline at end of file diff --git a/1.20/test/test_ocp_shared_helm_template.py b/1.20/test/test_ocp_shared_helm_template.py deleted file mode 120000 index 9cf469bf..00000000 --- a/1.20/test/test_ocp_shared_helm_template.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_template.py \ No newline at end of file diff --git a/1.20/test/test_ocp_template_example_app.py b/1.20/test/test_ocp_template_example_app.py deleted file mode 120000 index 49e607f8..00000000 --- a/1.20/test/test_ocp_template_example_app.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_template_example_app.py \ No newline at end of file diff --git a/1.22-micro/.exclude-fedora b/1.22-micro/.exclude-fedora deleted file mode 100644 index e69de29b..00000000 diff --git a/1.22-micro/Dockerfile.c9s b/1.22-micro/Dockerfile.c9s index 20b6cd4c..aceb94de 100644 --- a/1.22-micro/Dockerfile.c9s +++ b/1.22-micro/Dockerfile.c9s @@ -1,17 +1,4 @@ -FROM quay.io/centos/centos:stream9 AS build - -RUN mkdir -p /mnt/rootfs -# this is an alternative build of some packages with even smaller footprint on RPM level -# ADD https://copr.fedorainfracloud.org/coprs/hhorak/nginx-micro/repo/centos-stream-9/hhorak-nginx-micro-centos-stream-9.repo /etc/yum.repos.d/hhorak-nginx-micro-centos-stream-9.repo -# INSTALL_PKGS="$MICRO_PKGS nginx-core findutils hostname nss_wrapper-libs envsubst " && \ -RUN MICRO_PKGS="coreutils-single glibc-minimal-langpack" && \ - INSTALL_PKGS="$MICRO_PKGS nginx-core findutils hostname nss_wrapper-libs gettext " && \ - dnf --installroot /mnt/rootfs --releasever 9 --setopt install_weak_deps=false --nodocs module enable nginx:1.22 -y && \ - dnf install --installroot /mnt/rootfs $INSTALL_PKGS --releasever 9 --setopt install_weak_deps=false --nodocs -y && \ - dnf -y --installroot /mnt/rootfs clean all && \ - rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* - -FROM scratch +FROM quay.io/sclorg/s2i-core-c9s:c9s EXPOSE 8080 EXPOSE 8443 @@ -21,19 +8,12 @@ ENV NAME=nginx \ NGINX_SHORT_VER=122 \ VERSION=0 -ENV SUMMARY="Platform for running a micro nginx $NGINX_VERSION or building nginx-based application" \ +ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool. \ -This is a micro nginx container that does not include tools for installing RPMs, \ -therefore options for extending this image are limited." \ -# The following variables are usually available from parent s2i images \ - STI_SCRIPTS_PATH=/usr/libexec/s2i \ - APP_ROOT=/opt/app-root \ - HOME=/opt/app-root/src \ - PLATFORM="el9" +Nginx server image can be extended using source-to-image tool." LABEL summary="${SUMMARY}" \ description="${DESCRIPTION}" \ @@ -41,36 +21,35 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}-micro-c9s" \ + io.openshift.tags="builder,nginx,nginx122" \ + com.redhat.component="nginx-122-container" \ + name="sclorg/nginx-122-c9s" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c9s:latest " - -COPY --from=build /mnt/rootfs/ / + usage="s2i build sclorg/nginx-122-c9s:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx + NGINX_LOG_PATH=/var/log/nginx \ + NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl + +RUN yum -y module enable nginx:1.22 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ + yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ + yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22-micro/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22-micro/root/ / - -COPY 1.22-micro/core-scripts/usr /usr - -WORKDIR ${HOME} - -# Fail early if there is a version we do not expect -RUN nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" +COPY 1.22/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -89,22 +68,21 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ mkdir -p ${NGINX_LOG_PATH} && \ + mkdir -p ${NGINX_PERL_MODULE_PATH} && \ chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT} && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT} && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run + chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + rpm-file-permissions USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22-micro/Dockerfile.fedora b/1.22-micro/Dockerfile.fedora index a6863af0..753e302d 100644 --- a/1.22-micro/Dockerfile.fedora +++ b/1.22-micro/Dockerfile.fedora @@ -1,16 +1,5 @@ -FROM registry.fedoraproject.org/fedora:37 AS build +FROM quay.io/fedora/s2i-core:37 -RUN mkdir -p /mnt/rootfs -# this is an alternative build of some packages with even smaller footprint on RPM level -# ADD https://copr.fedorainfracloud.org/coprs/hhorak/nginx-micro/repo/fedora-34/hhorak-nginx-micro-fedora-34.repo /etc/yum.repos.d/hhorak-nginx-micro-fedora-34.repo -# INSTALL_PKGS="$MICRO_PKGS nginx-core findutils hostname nss_wrapper-libs envsubst " && \ -RUN MICRO_PKGS="coreutils-single glibc-minimal-langpack" && \ - INSTALL_PKGS="$MICRO_PKGS nginx-core findutils hostname nss_wrapper-libs gettext " && \ - dnf install --installroot /mnt/rootfs $INSTALL_PKGS --releasever 36 --setopt install_weak_deps=false --nodocs -y && \ - dnf -y --installroot /mnt/rootfs clean all && \ - rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* - -FROM scratch EXPOSE 8080 EXPOSE 8443 @@ -18,21 +7,15 @@ EXPOSE 8443 ENV NAME=nginx \ NGINX_VERSION=1.22 \ NGINX_SHORT_VER=122 \ - VERSION=0 + VERSION=0 \ + ARCH=x86_64 -ENV SUMMARY="Platform for running a micro nginx $NGINX_VERSION or building nginx-based application" \ +ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool. \ -This is a micro nginx container that does not include tools for installing RPMs, \ -therefore options for extending this image are limited." \ -# The following variables are usually available from parent s2i images \ - STI_SCRIPTS_PATH=/usr/libexec/s2i \ - APP_ROOT=/opt/app-root \ - HOME=/opt/app-root/src \ - PLATFORM="fedora" +Nginx server image can be extended using source-to-image tool." LABEL summary="${SUMMARY}" \ description="${DESCRIPTION}" \ @@ -40,35 +23,34 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}-micro" \ + io.openshift.tags="builder,nginx,nginx122" \ + com.redhat.component="nginx-122-container" \ + name="fedora/nginx-122" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ usage="s2i build ${FGC}/nginx " -COPY --from=build /mnt/rootfs/ / - ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx + NGINX_LOG_PATH=/var/log/nginx \ + NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl + +RUN dnf install -y gettext hostname && \ + INSTALL_PKGS="nss_wrapper-libs nginx nginx-mod-stream nginx-mod-http-perl" && \ + dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ + dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION-micro/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION-micro/root/ / - -COPY $NGINX_VERSION-micro/core-scripts/usr /usr - -WORKDIR ${HOME} - -# Fail early if there is a version we do not expect -RUN nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" +COPY 1.22/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -87,22 +69,21 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ mkdir -p ${NGINX_LOG_PATH} && \ + mkdir -p ${NGINX_PERL_MODULE_PATH} && \ chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT} && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT} && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run + chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + rpm-file-permissions USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22-micro/Dockerfile.rhel8 b/1.22-micro/Dockerfile.rhel8 index 02d99d6f..e7fe4b75 100644 --- a/1.22-micro/Dockerfile.rhel8 +++ b/1.22-micro/Dockerfile.rhel8 @@ -1,17 +1,4 @@ -FROM ubi8/ubi AS build - -RUN mkdir -p /mnt/rootfs -# with some planned changes in nginx, we can use nginx-core, envsubst and nss_wrapper-libs wihtout pulling in unnecessary dependencies -# testing packages in the following repo, but using packages from the distro meanwhile -# ADD https://copr.fedorainfracloud.org/coprs/hhorak/nginx-micro/repo/epel-8/hhorak-nginx-micro-epel-8.repo /etc/yum.repos.d/hhorak-nginx-micro-epel-8.repo -RUN MICRO_PKGS="coreutils-single glibc-minimal-langpack" && \ - INSTALL_PKGS="$MICRO_PKGS @nginx:1.22/common findutils hostname nss_wrapper-libs gettext " && \ - dnf --installroot /mnt/rootfs --releasever 8 --setopt install_weak_deps=false --nodocs module enable nginx:1.22 -y && \ - dnf --installroot /mnt/rootfs --releasever 8 --setopt install_weak_deps=false --nodocs install $INSTALL_PKGS -y && \ - dnf -y --installroot /mnt/rootfs clean all && \ - rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* - -FROM scratch +FROM ubi8/s2i-core:1 EXPOSE 8080 EXPOSE 8443 @@ -21,19 +8,12 @@ ENV NAME=nginx \ NGINX_SHORT_VER=122 \ VERSION=0 -ENV SUMMARY="Platform for running a micro nginx $NGINX_VERSION or building nginx-based application" \ +ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool. \ -This is a micro nginx container that does not include tools for installing RPMs, \ -therefore options for extending this image are limited." \ -# The following variables are usually available from parent s2i images \ - STI_SCRIPTS_PATH=/usr/libexec/s2i \ - APP_ROOT=/opt/app-root \ - HOME=/opt/app-root/src \ - PLATFORM="el8" +Nginx server image can be extended using source-to-image tool." LABEL summary="${SUMMARY}" \ description="${DESCRIPTION}" \ @@ -41,37 +21,35 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi8/${NAME}-${NGINX_SHORT_VER}-micro" \ + io.openshift.tags="builder,nginx,nginx122" \ + com.redhat.component="nginx-122-container" \ + name="ubi8/nginx-122" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}-micro:latest " - -COPY --from=build /mnt/rootfs/ / -COPY --from=build /etc/yum.repos.d/ubi.repo /etc/ + usage="s2i build ubi8/nginx-122:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx + NGINX_LOG_PATH=/var/log/nginx \ + NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl + +RUN yum -y module enable nginx:1.22 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ + yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ + yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22-micro/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22-micro/root/ / - -COPY 1.22-micro/core-scripts/usr /usr - -WORKDIR ${HOME} - -# Fail early if there is a version we do not expect -RUN nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" +COPY 1.22/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -90,22 +68,21 @@ RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ mkdir -p ${NGINX_LOG_PATH} && \ + mkdir -p ${NGINX_PERL_MODULE_PATH} && \ chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT} && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT} && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run + chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + rpm-file-permissions USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22-micro/README.md b/1.22-micro/README.md index 0b3befa2..62891ac6 100644 --- a/1.22-micro/README.md +++ b/1.22-micro/README.md @@ -1,7 +1,8 @@ -Nginx 1.22 micro server and a reverse proxy server container image -==================================================================== -This container image includes Nginx 1.22 server and a reverse server for OpenShift and general usage with a micro footprint (small image). +Nginx 1.22 server and a reverse proxy server container image +============================================================ +This container image includes Nginx 1.22 server and a reverse server for OpenShift and general usage. Users can choose between RHEL, CentOS Stream and Fedora based images. +The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). The resulting image can be run using [podman](https://github.com/containers/libpod). @@ -21,7 +22,7 @@ Nginx server image can be extended using Openshift's `Source` build feature. Usage in OpenShift ------------------ -In this example, we assume that you are using the `ubi8/nginx-122` image, available through the `nginx:1.22` imagestream tag in Openshift. +In this example, we assume that you are using the `ubi9/nginx-122` image, available through the `nginx:1.22` imagestream tag in Openshift. To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.22/test-app) application in Openshift: ``` @@ -64,6 +65,9 @@ To support the Source-to-Image framework, important scripts are included in the **`./nginx-start/*.sh`** Contains shell scripts that are sourced right before nginx is launched +**`./nginx-perl/*.pm`** + Contains perl modules to be use by `perl_modules` and `perl_require` directives + **`./`** Should contain nginx application source code @@ -79,7 +83,7 @@ To use the Nginx image in a Dockerfile, follow these steps: #### 1. Pull a base builder image to build on -podman pull ubi8/nginx-122 +podman pull ubi9/nginx-122 #### 2. Pull an application code @@ -103,7 +107,7 @@ For all these three parts, you can either set up all manually and use the `nginx ##### 3.1. To use your own setup, create a Dockerfile with this content: ``` -FROM registry.access.redhat.com/ubi8/nginx-122 +FROM registry.access.redhat.com/ubi9/nginx-122 # Add application sources ADD test-app/nginx.conf "${NGINX_CONF_PATH}" @@ -118,7 +122,7 @@ CMD nginx -g "daemon off;" ##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: ``` -FROM registry.access.redhat.com/ubi8/nginx-122 +FROM registry.access.redhat.com/ubi9/nginx-122 # Add application sources to a directory where the assemble script expects them # and set permissions so that the container runs without root access @@ -161,7 +165,7 @@ If you want to run the image directly and mount the static pages available in th as a container volume, execute the following command: ``` -$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi8/nginx-122 nginx -g "daemon off;" +$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-122 nginx -g "daemon off;" ``` This creates a container named `nginx` running the Nginx server, serving data from @@ -195,6 +199,7 @@ See also Dockerfile and other sources for this container image are available on https://github.com/sclorg/nginx-container. In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s` and the Fedora Dockerfile is called `Dockerfile.fedora`. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. diff --git a/1.22-micro/core-scripts b/1.22-micro/core-scripts deleted file mode 120000 index c28fe81b..00000000 --- a/1.22-micro/core-scripts +++ /dev/null @@ -1 +0,0 @@ -../common/shared-scripts/core/ \ No newline at end of file diff --git a/1.22-micro/root b/1.22-micro/root deleted file mode 120000 index 0fd29717..00000000 --- a/1.22-micro/root +++ /dev/null @@ -1 +0,0 @@ -../1.22/root/ \ No newline at end of file diff --git a/1.22-micro/root/opt/app-root/etc/generate_container_user b/1.22-micro/root/opt/app-root/etc/generate_container_user new file mode 100755 index 00000000..229b986a --- /dev/null +++ b/1.22-micro/root/opt/app-root/etc/generate_container_user @@ -0,0 +1,9 @@ +# Set current user in nss_wrapper +PASSWD_DIR="/opt/app-root/etc" + +export USER_ID=$(id -u) +export GROUP_ID=$(id -g) +envsubst < ${PASSWD_DIR}/passwd.template > ${PASSWD_DIR}/passwd +export LD_PRELOAD=libnss_wrapper.so +export NSS_WRAPPER_PASSWD=${PASSWD_DIR}/passwd +export NSS_WRAPPER_GROUP=/etc/group diff --git a/1.22-micro/root/opt/app-root/etc/passwd.template b/1.22-micro/root/opt/app-root/etc/passwd.template new file mode 100644 index 00000000..7ad0b787 --- /dev/null +++ b/1.22-micro/root/opt/app-root/etc/passwd.template @@ -0,0 +1,15 @@ +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/sbin/nologin +daemon:x:2:2:daemon:/sbin:/sbin/nologin +adm:x:3:4:adm:/var/adm:/sbin/nologin +lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin +sync:x:5:0:sync:/sbin:/bin/sync +shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown +halt:x:7:0:halt:/sbin:/sbin/halt +mail:x:8:12:mail:/var/spool/mail:/sbin/nologin +operator:x:11:0:operator:/root:/sbin/nologin +games:x:12:100:games:/usr/games:/sbin/nologin +ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin +nobody:x:99:99:Nobody:/:/sbin/nologin +default:x:${USER_ID}:${GROUP_ID}:Default Application User:${HOME}:/sbin/nologin +apache:x:48:48:Apache:/usr/share/httpd:/sbin/nologin diff --git a/1.22-micro/root/opt/app-root/nginxconf-rhscl.sed b/1.22-micro/root/opt/app-root/nginxconf-rhscl.sed new file mode 100644 index 00000000..ed31f84c --- /dev/null +++ b/1.22-micro/root/opt/app-root/nginxconf-rhscl.sed @@ -0,0 +1,10 @@ +/listen/s%80%8080 default_server% +s/^user *nginx;// +s%/etc/nginx/conf.d/%/opt/app-root/etc/nginx.d/% +s%/etc/nginx/default.d/%/opt/app-root/etc/nginx.default.d/% +s%/usr/share/nginx/html%/opt/app-root/src% + +# See: https://github.com/sclorg/nginx-container/pull/69 +/error_page/d +/40x.html/,+1d +/50x.html/,+1d diff --git a/1.22-micro/root/opt/app-root/nginxconf.sed b/1.22-micro/root/opt/app-root/nginxconf.sed new file mode 100644 index 00000000..ed31f84c --- /dev/null +++ b/1.22-micro/root/opt/app-root/nginxconf.sed @@ -0,0 +1,10 @@ +/listen/s%80%8080 default_server% +s/^user *nginx;// +s%/etc/nginx/conf.d/%/opt/app-root/etc/nginx.d/% +s%/etc/nginx/default.d/%/opt/app-root/etc/nginx.default.d/% +s%/usr/share/nginx/html%/opt/app-root/src% + +# See: https://github.com/sclorg/nginx-container/pull/69 +/error_page/d +/40x.html/,+1d +/50x.html/,+1d diff --git a/1.22-micro/root/usr/share/container-scripts/nginx/common.sh b/1.22-micro/root/usr/share/container-scripts/nginx/common.sh new file mode 100644 index 00000000..319219cd --- /dev/null +++ b/1.22-micro/root/usr/share/container-scripts/nginx/common.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +# get_matched_files finds file for image extending +function get_matched_files() { + local custom_dir default_dir + custom_dir="$1" + default_dir="$2" + files_matched="$3" + find "$default_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" + [ -d "$custom_dir" ] && find "$custom_dir" -maxdepth 1 -type f -name "$files_matched" -printf "%f\n" +} + +# process_extending_files process extending files in $1 and $2 directories +# - source all *.sh files +# (if there are files with same name source only file from $1) +function process_extending_files() { + local custom_dir default_dir + custom_dir=$1 + default_dir=$2 + while read filename ; do + if [ $filename ]; then + echo "=> sourcing $filename ..." + # Custom file is prefered + if [ -f $custom_dir/$filename ]; then + source $custom_dir/$filename + elif [ -f $default_dir/$filename ]; then + source $default_dir/$filename + fi + fi + done <<<"$(get_matched_files "$custom_dir" "$default_dir" '*.sh' | sort -u)" +} \ No newline at end of file diff --git a/1.22-micro/s2i b/1.22-micro/s2i deleted file mode 120000 index f1990500..00000000 --- a/1.22-micro/s2i +++ /dev/null @@ -1 +0,0 @@ -../1.22/s2i/ \ No newline at end of file diff --git a/1.22-micro/s2i/bin/assemble b/1.22-micro/s2i/bin/assemble new file mode 100755 index 00000000..0efe737d --- /dev/null +++ b/1.22-micro/s2i/bin/assemble @@ -0,0 +1,50 @@ +#!/bin/bash + +set -e + +echo "---> Installing application source" +cp -Rf /tmp/src/. ./ + +# Fix source directory permissions +fix-permissions ./ + +if [ -f ./nginx.conf ]; then + echo "---> Copying nginx.conf configuration file..." + cp -v ./nginx.conf "${NGINX_CONF_PATH}" + rm -f ./nginx.conf +fi + +if [ -d ./nginx-cfg ]; then + echo "---> Copying nginx configuration files..." + if [ "$(ls -A ./nginx-cfg/*.conf)" ]; then + cp -av ./nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" + rm -rf ./nginx-cfg + fi + chmod -Rf g+rw ${NGINX_CONFIGURATION_PATH} +fi + +if [ -d ./nginx-default-cfg ]; then + echo "---> Copying nginx default server configuration files..." + if [ "$(ls -A ./nginx-default-cfg/*.conf)" ]; then + cp -av ./nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" + rm -rf ./nginx-default-cfg + fi + chmod -Rf g+rw ${NGINX_DEFAULT_CONF_PATH} +fi + +if [ -d ./nginx-start ]; then + echo "---> Copying nginx start-hook scripts..." + if [ "$(ls -A ./nginx-start/* 2>/dev/null)" ]; then + cp -av ./nginx-start/* "${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start/" + rm -rf ./nginx-start + fi +fi + +if [ -n "${NGINX_PERL_MODULE_PATH}" ] && [ -d ./nginx-perl ]; then + echo "---> Copying nginx perl module files..." + if [ "$(ls -A ./nginx-perl/*.pm)" ]; then + cp -av ./nginx-perl/*.pm "${NGINX_PERL_MODULE_PATH}" + rm -rf ./nginx-perl + fi + chmod -Rf g+rw ${NGINX_PERL_MODULE_PATH} +fi diff --git a/1.22-micro/s2i/bin/run b/1.22-micro/s2i/bin/run new file mode 100755 index 00000000..fd24fa40 --- /dev/null +++ b/1.22-micro/s2i/bin/run @@ -0,0 +1,16 @@ +#!/bin/bash + +source /opt/app-root/etc/generate_container_user + +set -e + +source ${NGINX_CONTAINER_SCRIPTS_PATH}/common.sh + +process_extending_files ${NGINX_APP_ROOT}/src/nginx-start ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start + +if [ ! -v NGINX_LOG_TO_VOLUME -a -v NGINX_LOG_PATH ]; then + /bin/ln -sf /dev/stdout ${NGINX_LOG_PATH}/access.log + /bin/ln -sf /dev/stderr ${NGINX_LOG_PATH}/error.log +fi + +exec nginx -g "daemon off;" diff --git a/1.22-micro/s2i/bin/usage b/1.22-micro/s2i/bin/usage new file mode 100755 index 00000000..2abe6c1d --- /dev/null +++ b/1.22-micro/s2i/bin/usage @@ -0,0 +1,19 @@ +#!/bin/sh + +DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` + +cat <&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.22/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -86,9 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.fedora b/1.22/Dockerfile.fedora index c582e9e8..753e302d 100644 --- a/1.22/Dockerfile.fedora +++ b/1.22/Dockerfile.fedora @@ -1,9 +1,5 @@ FROM quay.io/fedora/s2i-core:37 -# nginx 1.22 image. -# -# Volumes: -# * /var/log/nginx/ - Storage for logs EXPOSE 8080 EXPOSE 8443 @@ -27,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx122" \ + com.redhat.component="nginx-122-container" \ + name="fedora/nginx-122" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -51,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.22/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -90,9 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.rhel8 b/1.22/Dockerfile.rhel8 index e77395a4..e7fe4b75 100644 --- a/1.22/Dockerfile.rhel8 +++ b/1.22/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx122" \ + com.redhat.component="nginx-122-container" \ + name="ubi8/nginx-122" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi8/nginx-122:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,8 +38,8 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN yum -y module enable nginx:1.22 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ @@ -85,9 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.rhel9 b/1.22/Dockerfile.rhel9 index f948970d..95d86d91 100644 --- a/1.22/Dockerfile.rhel9 +++ b/1.22/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx122" \ + com.redhat.component="nginx-122-container" \ + name="ubi9/nginx-122" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi9/nginx-122:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ +RUN yum -y module enable nginx:1.22 && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:$NGINX_VERSION && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.22/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,9 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["/usr/share/nginx/html"] -# VOLUME ["/var/log/nginx/"] - CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/README.md b/1.22/README.md index 676b3340..62891ac6 100644 --- a/1.22/README.md +++ b/1.22/README.md @@ -3,6 +3,7 @@ Nginx 1.22 server and a reverse proxy server container image This container image includes Nginx 1.22 server and a reverse server for OpenShift and general usage. Users can choose between RHEL, CentOS Stream and Fedora based images. The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). The resulting image can be run using [podman](https://github.com/containers/libpod). @@ -198,6 +199,7 @@ See also Dockerfile and other sources for this container image are available on https://github.com/sclorg/nginx-container. In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for CentOS Stream 8 is called `Dockerfile.c8s`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s` and the Fedora Dockerfile is called `Dockerfile.fedora`. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. diff --git a/1.22/root/opt/app-root/etc/generate_container_user b/1.22/root/opt/app-root/etc/generate_container_user old mode 100644 new mode 100755 diff --git a/1.22/test b/1.22/test new file mode 120000 index 00000000..419df4f9 --- /dev/null +++ b/1.22/test @@ -0,0 +1 @@ +../test \ No newline at end of file diff --git a/1.22/test/__init__.py b/1.22/test/__init__.py deleted file mode 120000 index d0f4746a..00000000 --- a/1.22/test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../test/__init__.py \ No newline at end of file diff --git a/1.22/test/conftest.py b/1.22/test/conftest.py deleted file mode 120000 index 3f2d7840..00000000 --- a/1.22/test/conftest.py +++ /dev/null @@ -1 +0,0 @@ -../../test/conftest.py \ No newline at end of file diff --git a/1.22/test/examples b/1.22/test/examples deleted file mode 120000 index da7b1965..00000000 --- a/1.22/test/examples +++ /dev/null @@ -1 +0,0 @@ -../../examples/ \ No newline at end of file diff --git a/1.22/test/imagestreams b/1.22/test/imagestreams deleted file mode 120000 index 7a0aee9c..00000000 --- a/1.22/test/imagestreams +++ /dev/null @@ -1 +0,0 @@ -../../imagestreams \ No newline at end of file diff --git a/1.22/test/perl-test-app/index.html b/1.22/test/perl-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.22/test/perl-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.22/test/perl-test-app/nginx-perl/Version.pm b/1.22/test/perl-test-app/nginx-perl/Version.pm deleted file mode 100644 index 7e047895..00000000 --- a/1.22/test/perl-test-app/nginx-perl/Version.pm +++ /dev/null @@ -1,17 +0,0 @@ -package Version; - -use nginx; - -sub installed { - return "$^V"; -} - -sub handler { - my $r = shift; - $r->send_http_header("text/html"); - $r->print("Perl location handler is working"); - return OK; -} - -1; -__END__ diff --git a/1.22/test/perl-test-app/nginx.conf b/1.22/test/perl-test-app/nginx.conf deleted file mode 100644 index c96bc69f..00000000 --- a/1.22/test/perl-test-app/nginx.conf +++ /dev/null @@ -1,99 +0,0 @@ -# For more information on configuration, see: -# * Official English Documentation: http://nginx.org/en/docs/ -# * Official Russian Documentation: http://nginx.org/ru/docs/ - - -worker_processes auto; -error_log /var/log/nginx/error.log; -pid /run/nginx.pid; - -# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. -include /usr/share/nginx/modules/*.conf; - -events { - worker_connections 1024; -} - -http { - perl_modules /opt/app-root/etc/perl; - perl_require Version.pm; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - perl_set $perl_version Version::installed; - add_header X-Perl-Version $perl_version; - - # Load modular configuration files from the /etc/nginx/conf.d directory. - # See http://nginx.org/en/docs/ngx_core_module.html#include - # for more information. - include /opt/app-root/etc/nginx.d/*.conf; - - server { - listen 8080 default_server; - listen [::]:8080 default_server; - server_name _; - root /opt/app-root/src; - - # Load configuration files for the default server block. - include /opt/app-root/etc/nginx.default.d/*.conf; - - location / { - } - - location /perl { - perl Version::handler; - } - - error_page 404 /404.html; - location = /40x.html { - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - } - } - -# Settings for a TLS enabled server. -# -# server { -# listen 443 ssl http2 default_server; -# listen [::]:443 ssl http2 default_server; -# server_name _; -# root /opt/app-root/src; -# -# ssl_certificate "/etc/pki/nginx/server.crt"; -# ssl_certificate_key "/etc/pki/nginx/private/server.key"; -# ssl_session_cache shared:SSL:1m; -# ssl_session_timeout 10m; -# ssl_ciphers PROFILE=SYSTEM; -# ssl_prefer_server_ciphers on; -# -# # Load configuration files for the default server block. -# include /opt/app-root/etc/nginx.default.d/*.conf; -# -# location / { -# } -# -# error_page 404 /404.html; -# location = /40x.html { -# } -# -# error_page 500 502 503 504 /50x.html; -# location = /50x.html { -# } -# } - -} - diff --git a/1.22/test/run b/1.22/test/run deleted file mode 120000 index 44977d63..00000000 --- a/1.22/test/run +++ /dev/null @@ -1 +0,0 @@ -../../test/run \ No newline at end of file diff --git a/1.22/test/run-openshift-pytest b/1.22/test/run-openshift-pytest deleted file mode 120000 index 5063ae30..00000000 --- a/1.22/test/run-openshift-pytest +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-pytest \ No newline at end of file diff --git a/1.22/test/run-openshift-remote-cluster b/1.22/test/run-openshift-remote-cluster deleted file mode 120000 index 1bffcba8..00000000 --- a/1.22/test/run-openshift-remote-cluster +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-remote-cluster \ No newline at end of file diff --git a/1.22/test/run-pytest b/1.22/test/run-pytest deleted file mode 120000 index efe32b48..00000000 --- a/1.22/test/run-pytest +++ /dev/null @@ -1 +0,0 @@ -../../test/run-pytest \ No newline at end of file diff --git a/1.22/test/start-hook-test-app/index.html b/1.22/test/start-hook-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.22/test/start-hook-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.22/test/start-hook-test-app/index2.html b/1.22/test/start-hook-test-app/index2.html deleted file mode 100644 index e73a98c6..00000000 --- a/1.22/test/start-hook-test-app/index2.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX2 is working

- - diff --git a/1.22/test/start-hook-test-app/nginx-cfg/default.conf b/1.22/test/start-hook-test-app/nginx-cfg/default.conf deleted file mode 100644 index e947c98b..00000000 --- a/1.22/test/start-hook-test-app/nginx-cfg/default.conf +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen 8080; - server_name localhost2; - root /opt/app-root/src; - index ${INDEX_FILE}; - resolver ${DNS_SERVER}; - -} \ No newline at end of file diff --git a/1.22/test/start-hook-test-app/nginx-start/init.sh b/1.22/test/start-hook-test-app/nginx-start/init.sh deleted file mode 100644 index 132164e2..00000000 --- a/1.22/test/start-hook-test-app/nginx-start/init.sh +++ /dev/null @@ -1,19 +0,0 @@ -setup_dns_env_var() { - if [ -z "$DNS_SERVER" ]; then - export DNS_SERVER=`cat /etc/resolv.conf | grep "nameserver " | cut -d " " -f 2 | tr '\n' ' '` - echo "Using system dns server ${DNS_SERVER}" - else - echo "Using user defined dns server: ${DNS_SERVER}" - fi -} - -inject_env_vars() { - ## Replace only specified environment variables in specified file. - envsubst '${DNS_SERVER},${INDEX_FILE}' < ${NGINX_CONFIGURATION_PATH}/$1 > output.conf - cp output.conf ${NGINX_CONFIGURATION_PATH}/$1 - echo "This is $1: " && cat ${NGINX_CONFIGURATION_PATH}/$1 -} - -export INDEX_FILE=index2.html -setup_dns_env_var -inject_env_vars "default.conf" diff --git a/1.22/test/test-app b/1.22/test/test-app deleted file mode 120000 index 7730437a..00000000 --- a/1.22/test/test-app +++ /dev/null @@ -1 +0,0 @@ -../../examples/1.22/test-app \ No newline at end of file diff --git a/1.22/test/test-lib-nginx.sh b/1.22/test/test-lib-nginx.sh deleted file mode 120000 index 300738f7..00000000 --- a/1.22/test/test-lib-nginx.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-nginx.sh \ No newline at end of file diff --git a/1.22/test/test-lib-openshift.sh b/1.22/test/test-lib-openshift.sh deleted file mode 120000 index 4f9f2996..00000000 --- a/1.22/test/test-lib-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib-openshift.sh \ No newline at end of file diff --git a/1.22/test/test-lib-remote-openshift.sh b/1.22/test/test-lib-remote-openshift.sh deleted file mode 120000 index 92ad2f4d..00000000 --- a/1.22/test/test-lib-remote-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib-remote-openshift.sh \ No newline at end of file diff --git a/1.22/test/test-lib.sh b/1.22/test/test-lib.sh deleted file mode 120000 index 1ac99b93..00000000 --- a/1.22/test/test-lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib.sh \ No newline at end of file diff --git a/1.22/test/test-openshift.yaml b/1.22/test/test-openshift.yaml deleted file mode 120000 index 8613fbba..00000000 --- a/1.22/test/test-openshift.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/test-openshift.yaml \ No newline at end of file diff --git a/1.22/test/test_container_application.py b/1.22/test/test_container_application.py deleted file mode 120000 index 25c1c1ec..00000000 --- a/1.22/test/test_container_application.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_application.py \ No newline at end of file diff --git a/1.22/test/test_container_basics.py b/1.22/test/test_container_basics.py deleted file mode 120000 index b85dc139..00000000 --- a/1.22/test/test_container_basics.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_basics.py \ No newline at end of file diff --git a/1.22/test/test_container_example_apps.py b/1.22/test/test_container_example_apps.py deleted file mode 120000 index 79a89de1..00000000 --- a/1.22/test/test_container_example_apps.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_example_apps.py \ No newline at end of file diff --git a/1.22/test/test_container_sizes.py b/1.22/test/test_container_sizes.py deleted file mode 120000 index 0ccb0a71..00000000 --- a/1.22/test/test_container_sizes.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_sizes.py \ No newline at end of file diff --git a/1.22/test/test_ocp_imagestream_s2i.py b/1.22/test/test_ocp_imagestream_s2i.py deleted file mode 120000 index 89eb6791..00000000 --- a/1.22/test/test_ocp_imagestream_s2i.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestream_s2i.py \ No newline at end of file diff --git a/1.22/test/test_ocp_imagestreams.py b/1.22/test/test_ocp_imagestreams.py deleted file mode 120000 index ee905e77..00000000 --- a/1.22/test/test_ocp_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestreams.py \ No newline at end of file diff --git a/1.22/test/test_ocp_local_example.py b/1.22/test/test_ocp_local_example.py deleted file mode 120000 index f2f3e849..00000000 --- a/1.22/test/test_ocp_local_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_local_example.py \ No newline at end of file diff --git a/1.22/test/test_ocp_remote_example.py b/1.22/test/test_ocp_remote_example.py deleted file mode 120000 index 7a912c02..00000000 --- a/1.22/test/test_ocp_remote_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_remote_example.py \ No newline at end of file diff --git a/1.22/test/test_ocp_shared_helm_imagestreams.py b/1.22/test/test_ocp_shared_helm_imagestreams.py deleted file mode 120000 index 76d5701d..00000000 --- a/1.22/test/test_ocp_shared_helm_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_imagestreams.py \ No newline at end of file diff --git a/1.22/test/test_ocp_shared_helm_template.py b/1.22/test/test_ocp_shared_helm_template.py deleted file mode 120000 index 9cf469bf..00000000 --- a/1.22/test/test_ocp_shared_helm_template.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_template.py \ No newline at end of file diff --git a/1.22/test/test_ocp_template_example_app.py b/1.22/test/test_ocp_template_example_app.py deleted file mode 120000 index 49e607f8..00000000 --- a/1.22/test/test_ocp_template_example_app.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_template_example_app.py \ No newline at end of file diff --git a/1.24/.exclude-c8s b/1.24/.exclude-c8s deleted file mode 100644 index e69de29b..00000000 diff --git a/1.24/.exclude-fedora b/1.24/.exclude-fedora deleted file mode 100644 index e69de29b..00000000 diff --git a/1.24/Dockerfile.c8s b/1.24/Dockerfile.c8s index d69ccd72..555e2fa3 100644 --- a/1.24/Dockerfile.c8s +++ b/1.24/Dockerfile.c8s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}-c8s" \ + io.openshift.tags="builder,nginx,nginx124" \ + com.redhat.component="nginx-124-container" \ + name="sclorg/nginx-124-c8s" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c8s:latest " + usage="s2i build sclorg/nginx-124-c8s:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,18 +38,18 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN yum -y module enable nginx:1.24 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.24/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.24/Dockerfile.c9s b/1.24/Dockerfile.c9s index 6add3832..d85ae0a0 100644 --- a/1.24/Dockerfile.c9s +++ b/1.24/Dockerfile.c9s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}-c9s" \ + io.openshift.tags="builder,nginx,nginx124" \ + com.redhat.component="nginx-124-container" \ + name="sclorg/nginx-124-c9s" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c9s:latest " + usage="s2i build sclorg/nginx-124-c9s:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,19 +38,18 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -# Modules does not exist -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN yum -y module enable nginx:1.24 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.24/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.24/Dockerfile.fedora b/1.24/Dockerfile.fedora index 4a34d65b..5f3147a6 100644 --- a/1.24/Dockerfile.fedora +++ b/1.24/Dockerfile.fedora @@ -1,9 +1,5 @@ FROM quay.io/fedora/s2i-core:38 -# nginx 1.24 image. -# -# Volumes: -# * /var/log/nginx/ - Storage for logs EXPOSE 8080 EXPOSE 8443 @@ -27,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx124" \ + com.redhat.component="nginx-124-container" \ + name="fedora/nginx-124" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -51,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.24/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.24/Dockerfile.rhel8 b/1.24/Dockerfile.rhel8 index e62d8794..2a80febf 100644 --- a/1.24/Dockerfile.rhel8 +++ b/1.24/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx124" \ + com.redhat.component="nginx-124-container" \ + name="ubi8/nginx-124" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi8/nginx-124:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,8 +38,8 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN yum -y module enable nginx:1.24 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ diff --git a/1.24/Dockerfile.rhel9 b/1.24/Dockerfile.rhel9 index 3ee212d1..99d906cf 100644 --- a/1.24/Dockerfile.rhel9 +++ b/1.24/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx124" \ + com.redhat.component="nginx-124-container" \ + name="ubi9/nginx-124" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi9/nginx-124:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ +RUN yum -y module enable nginx:1.24 && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:$NGINX_VERSION && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.24/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.24/README.md b/1.24/README.md index dafc56ce..0d8cedca 100644 --- a/1.24/README.md +++ b/1.24/README.md @@ -199,5 +199,7 @@ See also Dockerfile and other sources for this container image are available on https://github.com/sclorg/nginx-container. In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, for RHEL9 it's `Dockerfile.rhel9`, Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. diff --git a/1.24/root/opt/app-root/etc/generate_container_user b/1.24/root/opt/app-root/etc/generate_container_user old mode 100644 new mode 100755 diff --git a/1.24/test b/1.24/test new file mode 120000 index 00000000..419df4f9 --- /dev/null +++ b/1.24/test @@ -0,0 +1 @@ +../test \ No newline at end of file diff --git a/1.24/test/__init__.py b/1.24/test/__init__.py deleted file mode 120000 index d0f4746a..00000000 --- a/1.24/test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../test/__init__.py \ No newline at end of file diff --git a/1.24/test/conftest.py b/1.24/test/conftest.py deleted file mode 120000 index 3f2d7840..00000000 --- a/1.24/test/conftest.py +++ /dev/null @@ -1 +0,0 @@ -../../test/conftest.py \ No newline at end of file diff --git a/1.24/test/constants.py b/1.24/test/constants.py deleted file mode 120000 index 360f725b..00000000 --- a/1.24/test/constants.py +++ /dev/null @@ -1 +0,0 @@ -../../test/constants.py \ No newline at end of file diff --git a/1.24/test/examples b/1.24/test/examples deleted file mode 120000 index d15735c1..00000000 --- a/1.24/test/examples +++ /dev/null @@ -1 +0,0 @@ -../../examples \ No newline at end of file diff --git a/1.24/test/imagestreams b/1.24/test/imagestreams deleted file mode 120000 index 7a0aee9c..00000000 --- a/1.24/test/imagestreams +++ /dev/null @@ -1 +0,0 @@ -../../imagestreams \ No newline at end of file diff --git a/1.24/test/perl-test-app/index.html b/1.24/test/perl-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.24/test/perl-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.24/test/perl-test-app/nginx-perl/Version.pm b/1.24/test/perl-test-app/nginx-perl/Version.pm deleted file mode 100644 index 7e047895..00000000 --- a/1.24/test/perl-test-app/nginx-perl/Version.pm +++ /dev/null @@ -1,17 +0,0 @@ -package Version; - -use nginx; - -sub installed { - return "$^V"; -} - -sub handler { - my $r = shift; - $r->send_http_header("text/html"); - $r->print("Perl location handler is working"); - return OK; -} - -1; -__END__ diff --git a/1.24/test/perl-test-app/nginx.conf b/1.24/test/perl-test-app/nginx.conf deleted file mode 100644 index c96bc69f..00000000 --- a/1.24/test/perl-test-app/nginx.conf +++ /dev/null @@ -1,99 +0,0 @@ -# For more information on configuration, see: -# * Official English Documentation: http://nginx.org/en/docs/ -# * Official Russian Documentation: http://nginx.org/ru/docs/ - - -worker_processes auto; -error_log /var/log/nginx/error.log; -pid /run/nginx.pid; - -# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. -include /usr/share/nginx/modules/*.conf; - -events { - worker_connections 1024; -} - -http { - perl_modules /opt/app-root/etc/perl; - perl_require Version.pm; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - perl_set $perl_version Version::installed; - add_header X-Perl-Version $perl_version; - - # Load modular configuration files from the /etc/nginx/conf.d directory. - # See http://nginx.org/en/docs/ngx_core_module.html#include - # for more information. - include /opt/app-root/etc/nginx.d/*.conf; - - server { - listen 8080 default_server; - listen [::]:8080 default_server; - server_name _; - root /opt/app-root/src; - - # Load configuration files for the default server block. - include /opt/app-root/etc/nginx.default.d/*.conf; - - location / { - } - - location /perl { - perl Version::handler; - } - - error_page 404 /404.html; - location = /40x.html { - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - } - } - -# Settings for a TLS enabled server. -# -# server { -# listen 443 ssl http2 default_server; -# listen [::]:443 ssl http2 default_server; -# server_name _; -# root /opt/app-root/src; -# -# ssl_certificate "/etc/pki/nginx/server.crt"; -# ssl_certificate_key "/etc/pki/nginx/private/server.key"; -# ssl_session_cache shared:SSL:1m; -# ssl_session_timeout 10m; -# ssl_ciphers PROFILE=SYSTEM; -# ssl_prefer_server_ciphers on; -# -# # Load configuration files for the default server block. -# include /opt/app-root/etc/nginx.default.d/*.conf; -# -# location / { -# } -# -# error_page 404 /404.html; -# location = /40x.html { -# } -# -# error_page 500 502 503 504 /50x.html; -# location = /50x.html { -# } -# } - -} - diff --git a/1.24/test/run b/1.24/test/run deleted file mode 120000 index 44977d63..00000000 --- a/1.24/test/run +++ /dev/null @@ -1 +0,0 @@ -../../test/run \ No newline at end of file diff --git a/1.24/test/run-openshift-pytest b/1.24/test/run-openshift-pytest deleted file mode 120000 index 5063ae30..00000000 --- a/1.24/test/run-openshift-pytest +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-pytest \ No newline at end of file diff --git a/1.24/test/run-openshift-remote-cluster b/1.24/test/run-openshift-remote-cluster deleted file mode 120000 index 1bffcba8..00000000 --- a/1.24/test/run-openshift-remote-cluster +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-remote-cluster \ No newline at end of file diff --git a/1.24/test/run-pytest b/1.24/test/run-pytest deleted file mode 120000 index efe32b48..00000000 --- a/1.24/test/run-pytest +++ /dev/null @@ -1 +0,0 @@ -../../test/run-pytest \ No newline at end of file diff --git a/1.24/test/start-hook-test-app/index.html b/1.24/test/start-hook-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.24/test/start-hook-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.24/test/start-hook-test-app/index2.html b/1.24/test/start-hook-test-app/index2.html deleted file mode 100644 index e73a98c6..00000000 --- a/1.24/test/start-hook-test-app/index2.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX2 is working

- - diff --git a/1.24/test/start-hook-test-app/nginx-cfg/default.conf b/1.24/test/start-hook-test-app/nginx-cfg/default.conf deleted file mode 100644 index e947c98b..00000000 --- a/1.24/test/start-hook-test-app/nginx-cfg/default.conf +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen 8080; - server_name localhost2; - root /opt/app-root/src; - index ${INDEX_FILE}; - resolver ${DNS_SERVER}; - -} \ No newline at end of file diff --git a/1.24/test/start-hook-test-app/nginx-start/init.sh b/1.24/test/start-hook-test-app/nginx-start/init.sh deleted file mode 100644 index 132164e2..00000000 --- a/1.24/test/start-hook-test-app/nginx-start/init.sh +++ /dev/null @@ -1,19 +0,0 @@ -setup_dns_env_var() { - if [ -z "$DNS_SERVER" ]; then - export DNS_SERVER=`cat /etc/resolv.conf | grep "nameserver " | cut -d " " -f 2 | tr '\n' ' '` - echo "Using system dns server ${DNS_SERVER}" - else - echo "Using user defined dns server: ${DNS_SERVER}" - fi -} - -inject_env_vars() { - ## Replace only specified environment variables in specified file. - envsubst '${DNS_SERVER},${INDEX_FILE}' < ${NGINX_CONFIGURATION_PATH}/$1 > output.conf - cp output.conf ${NGINX_CONFIGURATION_PATH}/$1 - echo "This is $1: " && cat ${NGINX_CONFIGURATION_PATH}/$1 -} - -export INDEX_FILE=index2.html -setup_dns_env_var -inject_env_vars "default.conf" diff --git a/1.24/test/test-app b/1.24/test/test-app deleted file mode 120000 index a2283633..00000000 --- a/1.24/test/test-app +++ /dev/null @@ -1 +0,0 @@ -../../examples/1.24/test-app \ No newline at end of file diff --git a/1.24/test/test-lib.sh b/1.24/test/test-lib.sh deleted file mode 120000 index 1ac99b93..00000000 --- a/1.24/test/test-lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib.sh \ No newline at end of file diff --git a/1.24/test/test_container_application.py b/1.24/test/test_container_application.py deleted file mode 120000 index 25c1c1ec..00000000 --- a/1.24/test/test_container_application.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_application.py \ No newline at end of file diff --git a/1.24/test/test_container_basics.py b/1.24/test/test_container_basics.py deleted file mode 120000 index b85dc139..00000000 --- a/1.24/test/test_container_basics.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_basics.py \ No newline at end of file diff --git a/1.24/test/test_container_example_apps.py b/1.24/test/test_container_example_apps.py deleted file mode 120000 index 79a89de1..00000000 --- a/1.24/test/test_container_example_apps.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_example_apps.py \ No newline at end of file diff --git a/1.24/test/test_container_sizes.py b/1.24/test/test_container_sizes.py deleted file mode 120000 index 0ccb0a71..00000000 --- a/1.24/test/test_container_sizes.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_sizes.py \ No newline at end of file diff --git a/1.24/test/test_ocp_imagestream_s2i.py b/1.24/test/test_ocp_imagestream_s2i.py deleted file mode 120000 index 89eb6791..00000000 --- a/1.24/test/test_ocp_imagestream_s2i.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestream_s2i.py \ No newline at end of file diff --git a/1.24/test/test_ocp_imagestreams.py b/1.24/test/test_ocp_imagestreams.py deleted file mode 120000 index ee905e77..00000000 --- a/1.24/test/test_ocp_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestreams.py \ No newline at end of file diff --git a/1.24/test/test_ocp_local_example.py b/1.24/test/test_ocp_local_example.py deleted file mode 120000 index f2f3e849..00000000 --- a/1.24/test/test_ocp_local_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_local_example.py \ No newline at end of file diff --git a/1.24/test/test_ocp_remote_example.py b/1.24/test/test_ocp_remote_example.py deleted file mode 120000 index 7a912c02..00000000 --- a/1.24/test/test_ocp_remote_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_remote_example.py \ No newline at end of file diff --git a/1.24/test/test_ocp_shared_helm_imagestreams.py b/1.24/test/test_ocp_shared_helm_imagestreams.py deleted file mode 120000 index 76d5701d..00000000 --- a/1.24/test/test_ocp_shared_helm_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_imagestreams.py \ No newline at end of file diff --git a/1.24/test/test_ocp_shared_helm_template.py b/1.24/test/test_ocp_shared_helm_template.py deleted file mode 120000 index 9cf469bf..00000000 --- a/1.24/test/test_ocp_shared_helm_template.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_template.py \ No newline at end of file diff --git a/1.24/test/test_ocp_template_example_app.py b/1.24/test/test_ocp_template_example_app.py deleted file mode 120000 index 49e607f8..00000000 --- a/1.24/test/test_ocp_template_example_app.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_template_example_app.py \ No newline at end of file diff --git a/1.26/.exclude-rhel8 b/1.26/.exclude-rhel8 deleted file mode 100644 index e69de29b..00000000 diff --git a/1.26/Dockerfile.c10s b/1.26/Dockerfile.c10s index 6be76038..d58300f9 100644 --- a/1.26/Dockerfile.c10s +++ b/1.26/Dockerfile.c10s @@ -21,14 +21,13 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}-c10s" \ - version="1" \ + io.openshift.tags="builder,nginx,nginx126" \ + com.redhat.component="nginx-126-container" \ + name="sclorg/nginx-126-c10s" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c10s:latest " + usage="s2i build sclorg/nginx-126-c10s:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,18 +37,18 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -# Modules does not exist -RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ dnf -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.26/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.26/Dockerfile.c9s b/1.26/Dockerfile.c9s index d6c9e8e5..b089fe28 100644 --- a/1.26/Dockerfile.c9s +++ b/1.26/Dockerfile.c9s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}-c9s" \ + io.openshift.tags="builder,nginx,nginx126" \ + com.redhat.component="nginx-126-container" \ + name="sclorg/nginx-126-c9s" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c9s:latest " + usage="s2i build sclorg/nginx-126-c9s:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,19 +38,18 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -# Modules does not exist -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-all-modules" && \ +RUN yum -y module enable nginx:1.26 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.26/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.26/Dockerfile.fedora b/1.26/Dockerfile.fedora index cacfe28a..1a10def9 100644 --- a/1.26/Dockerfile.fedora +++ b/1.26/Dockerfile.fedora @@ -23,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx126" \ + com.redhat.component="nginx-126-container" \ + name="fedora/nginx-126" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -47,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.26/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.26/Dockerfile.rhel10 b/1.26/Dockerfile.rhel10 index c50685b1..a7f379ae 100644 --- a/1.26/Dockerfile.rhel10 +++ b/1.26/Dockerfile.rhel10 @@ -21,13 +21,13 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi10/nginx-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx126" \ + com.redhat.component="nginx-126-container" \ + name="ubi10/nginx-126" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi10/nginx-${NGINX_SHORT_VER} " + usage="s2i build ubi10/nginx-126:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -37,18 +37,18 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -# Modules does not exist -RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ dnf -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.26/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.26/Dockerfile.rhel8 b/1.26/Dockerfile.rhel8 index c7de9429..f094bc12 100644 --- a/1.26/Dockerfile.rhel8 +++ b/1.26/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx126" \ + com.redhat.component="nginx-126-container" \ + name="ubi8/nginx-126" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi8/nginx-126:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,18 +38,18 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN yum -y module enable nginx:1.26 && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.24/root/ / +COPY 1.26/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.26/Dockerfile.rhel9 b/1.26/Dockerfile.rhel9 index dc075fb4..c162055a 100644 --- a/1.26/Dockerfile.rhel9 +++ b/1.26/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ + io.openshift.tags="builder,nginx,nginx126" \ + com.redhat.component="nginx-126-container" \ + name="ubi9/nginx-126" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " + usage="s2i build ubi9/nginx-126:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:$NGINX_VERSION && \ +RUN yum -y module enable nginx:1.26 && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:$NGINX_VERSION && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH +COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION/root/ / +COPY 1.26/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model diff --git a/1.26/root/opt/app-root/etc/generate_container_user b/1.26/root/opt/app-root/etc/generate_container_user old mode 100644 new mode 100755 diff --git a/1.26/test b/1.26/test new file mode 120000 index 00000000..419df4f9 --- /dev/null +++ b/1.26/test @@ -0,0 +1 @@ +../test \ No newline at end of file diff --git a/1.26/test/__init__.py b/1.26/test/__init__.py deleted file mode 120000 index d0f4746a..00000000 --- a/1.26/test/__init__.py +++ /dev/null @@ -1 +0,0 @@ -../../test/__init__.py \ No newline at end of file diff --git a/1.26/test/conftest.py b/1.26/test/conftest.py deleted file mode 120000 index 3f2d7840..00000000 --- a/1.26/test/conftest.py +++ /dev/null @@ -1 +0,0 @@ -../../test/conftest.py \ No newline at end of file diff --git a/1.26/test/examples b/1.26/test/examples deleted file mode 120000 index da7b1965..00000000 --- a/1.26/test/examples +++ /dev/null @@ -1 +0,0 @@ -../../examples/ \ No newline at end of file diff --git a/1.26/test/imagestreams b/1.26/test/imagestreams deleted file mode 120000 index 0dcbe9e0..00000000 --- a/1.26/test/imagestreams +++ /dev/null @@ -1 +0,0 @@ -../../imagestreams/ \ No newline at end of file diff --git a/1.26/test/perl-test-app/index.html b/1.26/test/perl-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.26/test/perl-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.26/test/perl-test-app/nginx-perl/Version.pm b/1.26/test/perl-test-app/nginx-perl/Version.pm deleted file mode 100644 index 7e047895..00000000 --- a/1.26/test/perl-test-app/nginx-perl/Version.pm +++ /dev/null @@ -1,17 +0,0 @@ -package Version; - -use nginx; - -sub installed { - return "$^V"; -} - -sub handler { - my $r = shift; - $r->send_http_header("text/html"); - $r->print("Perl location handler is working"); - return OK; -} - -1; -__END__ diff --git a/1.26/test/perl-test-app/nginx.conf b/1.26/test/perl-test-app/nginx.conf deleted file mode 100644 index c96bc69f..00000000 --- a/1.26/test/perl-test-app/nginx.conf +++ /dev/null @@ -1,99 +0,0 @@ -# For more information on configuration, see: -# * Official English Documentation: http://nginx.org/en/docs/ -# * Official Russian Documentation: http://nginx.org/ru/docs/ - - -worker_processes auto; -error_log /var/log/nginx/error.log; -pid /run/nginx.pid; - -# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. -include /usr/share/nginx/modules/*.conf; - -events { - worker_connections 1024; -} - -http { - perl_modules /opt/app-root/etc/perl; - perl_require Version.pm; - - log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"'; - - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - perl_set $perl_version Version::installed; - add_header X-Perl-Version $perl_version; - - # Load modular configuration files from the /etc/nginx/conf.d directory. - # See http://nginx.org/en/docs/ngx_core_module.html#include - # for more information. - include /opt/app-root/etc/nginx.d/*.conf; - - server { - listen 8080 default_server; - listen [::]:8080 default_server; - server_name _; - root /opt/app-root/src; - - # Load configuration files for the default server block. - include /opt/app-root/etc/nginx.default.d/*.conf; - - location / { - } - - location /perl { - perl Version::handler; - } - - error_page 404 /404.html; - location = /40x.html { - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - } - } - -# Settings for a TLS enabled server. -# -# server { -# listen 443 ssl http2 default_server; -# listen [::]:443 ssl http2 default_server; -# server_name _; -# root /opt/app-root/src; -# -# ssl_certificate "/etc/pki/nginx/server.crt"; -# ssl_certificate_key "/etc/pki/nginx/private/server.key"; -# ssl_session_cache shared:SSL:1m; -# ssl_session_timeout 10m; -# ssl_ciphers PROFILE=SYSTEM; -# ssl_prefer_server_ciphers on; -# -# # Load configuration files for the default server block. -# include /opt/app-root/etc/nginx.default.d/*.conf; -# -# location / { -# } -# -# error_page 404 /404.html; -# location = /40x.html { -# } -# -# error_page 500 502 503 504 /50x.html; -# location = /50x.html { -# } -# } - -} - diff --git a/1.26/test/run b/1.26/test/run deleted file mode 120000 index 44977d63..00000000 --- a/1.26/test/run +++ /dev/null @@ -1 +0,0 @@ -../../test/run \ No newline at end of file diff --git a/1.26/test/run-openshift-remote-cluster b/1.26/test/run-openshift-remote-cluster deleted file mode 120000 index 1bffcba8..00000000 --- a/1.26/test/run-openshift-remote-cluster +++ /dev/null @@ -1 +0,0 @@ -../../test/run-openshift-remote-cluster \ No newline at end of file diff --git a/1.26/test/run-pytest b/1.26/test/run-pytest deleted file mode 120000 index efe32b48..00000000 --- a/1.26/test/run-pytest +++ /dev/null @@ -1 +0,0 @@ -../../test/run-pytest \ No newline at end of file diff --git a/1.26/test/start-hook-test-app/index.html b/1.26/test/start-hook-test-app/index.html deleted file mode 100644 index d1476274..00000000 --- a/1.26/test/start-hook-test-app/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX is working

- - diff --git a/1.26/test/start-hook-test-app/index2.html b/1.26/test/start-hook-test-app/index2.html deleted file mode 100644 index e73a98c6..00000000 --- a/1.26/test/start-hook-test-app/index2.html +++ /dev/null @@ -1,8 +0,0 @@ - - - Test NGINX passed - - -

NGINX2 is working

- - diff --git a/1.26/test/start-hook-test-app/nginx-cfg/default.conf b/1.26/test/start-hook-test-app/nginx-cfg/default.conf deleted file mode 100644 index e947c98b..00000000 --- a/1.26/test/start-hook-test-app/nginx-cfg/default.conf +++ /dev/null @@ -1,8 +0,0 @@ -server { - listen 8080; - server_name localhost2; - root /opt/app-root/src; - index ${INDEX_FILE}; - resolver ${DNS_SERVER}; - -} \ No newline at end of file diff --git a/1.26/test/start-hook-test-app/nginx-start/init.sh b/1.26/test/start-hook-test-app/nginx-start/init.sh deleted file mode 100644 index 132164e2..00000000 --- a/1.26/test/start-hook-test-app/nginx-start/init.sh +++ /dev/null @@ -1,19 +0,0 @@ -setup_dns_env_var() { - if [ -z "$DNS_SERVER" ]; then - export DNS_SERVER=`cat /etc/resolv.conf | grep "nameserver " | cut -d " " -f 2 | tr '\n' ' '` - echo "Using system dns server ${DNS_SERVER}" - else - echo "Using user defined dns server: ${DNS_SERVER}" - fi -} - -inject_env_vars() { - ## Replace only specified environment variables in specified file. - envsubst '${DNS_SERVER},${INDEX_FILE}' < ${NGINX_CONFIGURATION_PATH}/$1 > output.conf - cp output.conf ${NGINX_CONFIGURATION_PATH}/$1 - echo "This is $1: " && cat ${NGINX_CONFIGURATION_PATH}/$1 -} - -export INDEX_FILE=index2.html -setup_dns_env_var -inject_env_vars "default.conf" diff --git a/1.26/test/test-app b/1.26/test/test-app deleted file mode 120000 index 58eeaa22..00000000 --- a/1.26/test/test-app +++ /dev/null @@ -1 +0,0 @@ -../../examples/1.26/test-app \ No newline at end of file diff --git a/1.26/test/test-lib-nginx.sh b/1.26/test/test-lib-nginx.sh deleted file mode 120000 index 300738f7..00000000 --- a/1.26/test/test-lib-nginx.sh +++ /dev/null @@ -1 +0,0 @@ -../../test/test-lib-nginx.sh \ No newline at end of file diff --git a/1.26/test/test-lib-openshift.sh b/1.26/test/test-lib-openshift.sh deleted file mode 120000 index 4f9f2996..00000000 --- a/1.26/test/test-lib-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib-openshift.sh \ No newline at end of file diff --git a/1.26/test/test-lib-remote-openshift.sh b/1.26/test/test-lib-remote-openshift.sh deleted file mode 120000 index 92ad2f4d..00000000 --- a/1.26/test/test-lib-remote-openshift.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib-remote-openshift.sh \ No newline at end of file diff --git a/1.26/test/test-lib.sh b/1.26/test/test-lib.sh deleted file mode 120000 index 1ac99b93..00000000 --- a/1.26/test/test-lib.sh +++ /dev/null @@ -1 +0,0 @@ -../../common/test-lib.sh \ No newline at end of file diff --git a/1.26/test/test-openshift.yaml b/1.26/test/test-openshift.yaml deleted file mode 120000 index 8613fbba..00000000 --- a/1.26/test/test-openshift.yaml +++ /dev/null @@ -1 +0,0 @@ -../../common/test-openshift.yaml \ No newline at end of file diff --git a/1.26/test/test_container_application.py b/1.26/test/test_container_application.py deleted file mode 120000 index 25c1c1ec..00000000 --- a/1.26/test/test_container_application.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_application.py \ No newline at end of file diff --git a/1.26/test/test_container_basics.py b/1.26/test/test_container_basics.py deleted file mode 120000 index b85dc139..00000000 --- a/1.26/test/test_container_basics.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_basics.py \ No newline at end of file diff --git a/1.26/test/test_container_example_apps.py b/1.26/test/test_container_example_apps.py deleted file mode 120000 index 79a89de1..00000000 --- a/1.26/test/test_container_example_apps.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_example_apps.py \ No newline at end of file diff --git a/1.26/test/test_container_sizes.py b/1.26/test/test_container_sizes.py deleted file mode 120000 index 0ccb0a71..00000000 --- a/1.26/test/test_container_sizes.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_container_sizes.py \ No newline at end of file diff --git a/1.26/test/test_ocp_imagestream_s2i.py b/1.26/test/test_ocp_imagestream_s2i.py deleted file mode 120000 index 89eb6791..00000000 --- a/1.26/test/test_ocp_imagestream_s2i.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestream_s2i.py \ No newline at end of file diff --git a/1.26/test/test_ocp_imagestreams.py b/1.26/test/test_ocp_imagestreams.py deleted file mode 120000 index ee905e77..00000000 --- a/1.26/test/test_ocp_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_imagestreams.py \ No newline at end of file diff --git a/1.26/test/test_ocp_local_example.py b/1.26/test/test_ocp_local_example.py deleted file mode 120000 index f2f3e849..00000000 --- a/1.26/test/test_ocp_local_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_local_example.py \ No newline at end of file diff --git a/1.26/test/test_ocp_remote_example.py b/1.26/test/test_ocp_remote_example.py deleted file mode 120000 index 7a912c02..00000000 --- a/1.26/test/test_ocp_remote_example.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_remote_example.py \ No newline at end of file diff --git a/1.26/test/test_ocp_shared_helm_imagestreams.py b/1.26/test/test_ocp_shared_helm_imagestreams.py deleted file mode 120000 index 76d5701d..00000000 --- a/1.26/test/test_ocp_shared_helm_imagestreams.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_imagestreams.py \ No newline at end of file diff --git a/1.26/test/test_ocp_shared_helm_template.py b/1.26/test/test_ocp_shared_helm_template.py deleted file mode 120000 index 9cf469bf..00000000 --- a/1.26/test/test_ocp_shared_helm_template.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_shared_helm_template.py \ No newline at end of file diff --git a/1.26/test/test_ocp_template_example_app.py b/1.26/test/test_ocp_template_example_app.py deleted file mode 120000 index 49e607f8..00000000 --- a/1.26/test/test_ocp_template_example_app.py +++ /dev/null @@ -1 +0,0 @@ -../../test/test_ocp_template_example_app.py \ No newline at end of file From ba2da2dd92cfe88d5ecadc576f75e5139efeed98 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Mon, 18 May 2026 17:04:44 +0200 Subject: [PATCH 03/13] Update README with contributing guidelines for dist-gen --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index c4e37e71..2fa83f48 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,24 @@ on all provided versions of Nginx, which must be specified in `VERSIONS` variab This variable must be set to a list with possible versions (subdirectories).** +## Contributing Guidelines + +This repository utilizes [distgen](https://github.com/devexp-db/distgen/) for generating image source files. If you are interested in updating a Dockerfile, please modify the relevant sections in the `specs/multispec.yml` file and/or the `Dockerfile.template` (or other distgen files), and then execute `make generate`. + +Before you begin, ensure that you have `distgen` installed by running `dg --version`. If `distgen` is not installed on your system, follow the installation guide available at [distgen's GitHub repository](https://github.com/devexp-db/distgen/). +Additionally, for testing purposes, install `go-md2man` from this repository [go-md2man](https://github.com/cpuguy83/go-md2man) or via `dnf install go-md2man`. + +To contribute, please follow these steps: + +1. Fork the repository +2. Run `git submodule update --init` to download the `common` submodule containing the `common/common.mk` makefile. +3. Implement a new feature or bug fix in the templates (found in the `src` directory) or update values in the `specs/multispec.yml` file. + - Note: If no changes are made to these directories, file regeneration is not necessary. +4. Regenerate all files by executing `make generate`. +5. Consider running CI tests, as described in the Test section below. +6. Commit the files and generated files in two separated commits with a conventional commit message for each. +7. Open a pull request for review! + Usage ----- From f0660b5e716f555e441d190789e748d7864f8676 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Mon, 18 May 2026 21:21:30 +0200 Subject: [PATCH 04/13] Remove CentOS Stream 8 support (EOL) --- 1.24/Dockerfile.c8s | 88 --------------------------------------------- manifest.yml | 3 -- specs/multispec.yml | 16 --------- 3 files changed, 107 deletions(-) delete mode 100644 1.24/Dockerfile.c8s diff --git a/1.24/Dockerfile.c8s b/1.24/Dockerfile.c8s deleted file mode 100644 index 555e2fa3..00000000 --- a/1.24/Dockerfile.c8s +++ /dev/null @@ -1,88 +0,0 @@ -FROM quay.io/sclorg/s2i-core-c8s:c8s - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.24 \ - NGINX_SHORT_VER=124 \ - VERSION=0 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx124" \ - com.redhat.component="nginx-124-container" \ - name="sclorg/nginx-124-c8s" \ - version="1" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/nginx-124-c8s:latest " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN yum -y module enable nginx:1.24 && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY 1.24/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/manifest.yml b/manifest.yml index cd165716..7911c0c4 100644 --- a/manifest.yml +++ b/manifest.yml @@ -21,9 +21,6 @@ DISTGEN_MULTI_RULES: - src: src/Dockerfile dest: Dockerfile.rhel10 - - src: src/Dockerfile - dest: Dockerfile.c8s - - src: src/Dockerfile dest: Dockerfile.c9s diff --git a/specs/multispec.yml b/specs/multispec.yml index 22a67806..727ef403 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -85,21 +85,6 @@ specs: environment_setup: "" license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" - c8s: - distros: - - centos-stream-8-x86_64 - s2i_base: quay.io/sclorg/s2i-core-c8s:c8s - org: "sclorg" - prod: "c8s" - openshift_tags: "builder,nginx,nginx{{ spec.short }}" - redhat_component: "nginx-{{ spec.short }}-container" - img_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" - pkgs: "nginx nginx-all-modules" - pkg_manager: "yum" - environment_setup: >-4 - yum -y module enable nginx:{{ spec.version }} && \ - license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" - c9s: distros: - centos-stream-9-x86_64 @@ -192,7 +177,6 @@ matrix: - fedora-38-x86_64 - rhel-8-x86_64 - rhel-9-x86_64 - - centos-stream-8-x86_64 - centos-stream-9-x86_64 - version: "1.26" From 3e9c492a8dfe1c37cd469b80003940eedbf37152 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Mon, 18 May 2026 21:23:03 +0200 Subject: [PATCH 05/13] regenerate version table --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2fa83f48..57aee56f 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ Table start --> ||CentOS Stream 9|CentOS Stream 10|Fedora|RHEL 8|RHEL 9|RHEL 10| |:--|:--:|:--:|:--:|:--:|:--:|:--:| -|1.20|||||
`registry.redhat.io/rhel9/nginx-120`
|| -|1.22||||
`registry.redhat.io/rhel8/nginx-122`
|
`registry.redhat.io/rhel9/nginx-122`
|| -|1.22-micro|
`quay.io/sclorg/nginx-122-micro-c9s`
|||
`registry.redhat.io/rhel8/nginx-122-micro`
||| -|1.24|
`quay.io/sclorg/nginx-124-c9s`
|||
`registry.redhat.io/rhel8/nginx-124`
|
`registry.redhat.io/rhel9/nginx-124`
|| -|1.26|
`quay.io/sclorg/nginx-126-c9s`
|
`quay.io/sclorg/nginx-126-c10s`
|
`quay.io/fedora/nginx-126`
||
`registry.redhat.io/rhel9/nginx-126`
|
`registry.redhat.io/rhel10/nginx-126`
| +|1.20|
`quay.io/sclorg/nginx-120-c9s`
||
`quay.io/fedora/nginx-120`
|
`registry.redhat.io/rhel8/nginx-120`
|
`registry.redhat.io/rhel9/nginx-120`
|| +|1.22|
`quay.io/sclorg/nginx-122-c9s`
||
`quay.io/fedora/nginx-122`
|
`registry.redhat.io/rhel8/nginx-122`
|
`registry.redhat.io/rhel9/nginx-122`
|| +|1.22-micro|
`quay.io/sclorg/nginx-122-micro-c9s`
||
`quay.io/fedora/nginx-122-micro`
|
`registry.redhat.io/rhel8/nginx-122-micro`
||| +|1.24|
`quay.io/sclorg/nginx-124-c9s`
||
`quay.io/fedora/nginx-124`
|
`registry.redhat.io/rhel8/nginx-124`
|
`registry.redhat.io/rhel9/nginx-124`
|| +|1.26|
`quay.io/sclorg/nginx-126-c9s`
|
`quay.io/sclorg/nginx-126-c10s`
|
`quay.io/fedora/nginx-126`
|
`registry.redhat.io/rhel8/nginx-126`
|
`registry.redhat.io/rhel9/nginx-126`
|
`registry.redhat.io/rhel10/nginx-126`
| From 28b87ba99c723025fb1ec7ffdaad973dd4a1971d Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Mon, 18 May 2026 21:45:49 +0200 Subject: [PATCH 06/13] Fix empty RUN command in Dockerfile template Use Jinja2 conditional to handle empty environment_setup properly. When environment_setup is empty (Fedora, C10S, RHEL10), generate 'RUN INSTALL_PKGS=...' instead of 'RUN \n INSTALL_PKGS=...' which caused build failures. --- 1.20/root/README.md | 205 ++++++++++++++++++++++++++++++++++++++ 1.22-micro/root/README.md | 205 ++++++++++++++++++++++++++++++++++++++ 1.22/root/README.md | 205 ++++++++++++++++++++++++++++++++++++++ 1.24/root/README.md | 205 ++++++++++++++++++++++++++++++++++++++ 1.26/Dockerfile.c10s | 3 +- 1.26/Dockerfile.rhel10 | 3 +- 1.26/root/README.md | 205 ++++++++++++++++++++++++++++++++++++++ src/Dockerfile | 4 + 8 files changed, 1031 insertions(+), 4 deletions(-) create mode 100644 1.20/root/README.md create mode 100644 1.22-micro/root/README.md create mode 100644 1.22/root/README.md create mode 100644 1.24/root/README.md create mode 100644 1.26/root/README.md diff --git a/1.20/root/README.md b/1.20/root/README.md new file mode 100644 index 00000000..a0839469 --- /dev/null +++ b/1.20/root/README.md @@ -0,0 +1,205 @@ +Nginx 1.20 server and a reverse proxy server container image +============================================================ +This container image includes Nginx 1.20 server and a reverse server for OpenShift and general usage. +Users can choose between RHEL, CentOS Stream and Fedora based images. +The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), +and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). +The resulting image can be run using [podman](https://github.com/containers/libpod). + +Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. + + +Description +----------- + +Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP +protocols, with a strong focus on high concurrency, performance and low memory usage. The container +image provides a containerized packaging of the nginx 1.20 daemon. The image can be used +as a base image for other applications based on nginx 1.20 web server. +Nginx server image can be extended using Openshift's `Source` build feature. + + +Usage in OpenShift +------------------ +In this example, we assume that you are using the `ubi9/nginx-120` image, available through the `nginx:1.20` imagestream tag in Openshift. +To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.20/test-app) application in Openshift: + +``` +oc new-app nginx:1.20~https://github.com/sclorg/nginx-container.git --context-dir=1.20/test/test-app/ +``` + +To access the application: +``` +$ oc get pods +$ oc exec -- curl 127.0.0.1:8080 +``` + + +Source-to-Image framework and scripts +------------------------------------- +This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) +(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework +which makes it easy to write images that take application source code as +an input, use a builder image like this Nginx container image, and produce +a new image that runs the assembled application as an output. + +In case of Nginx container image, the application source code is typically +either static HTML pages or configuration files. + +To support the Source-to-Image framework, important scripts are included in the builder image: + +* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). + +* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: + +**`./nginx.conf`**-- + The main nginx configuration file + +**`./nginx-cfg/*.conf`** + Should contain all nginx configuration we want to include into image + +**`./nginx-default-cfg/*.conf`** + Contains any nginx config snippets to include in the default server block + +**`./nginx-start/*.sh`** + Contains shell scripts that are sourced right before nginx is launched + +**`./nginx-perl/*.pm`** + Contains perl modules to be use by `perl_modules` and `perl_require` directives + +**`./`** + Should contain nginx application source code + + +Build an application using a Dockerfile +--------------------------------------- +Compared to the Source-to-Image strategy, using a Dockerfile is a more +flexible way to build an Nginx container image with an application. +Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or +when you build the image outside of the OpenShift environment. + +To use the Nginx image in a Dockerfile, follow these steps: + +#### 1. Pull a base builder image to build on + +podman pull ubi9/nginx-120 + +#### 2. Pull an application code + +An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. + +``` +git clone https://github.com/sclorg/nginx-container.git nginx-container +cd nginx-container/examples/1.20/ +``` + +#### 3. Prepare an application inside a container + +This step usually consists of at least these parts: + +* putting the application source into the container +* moving configuration files to the correct place (if available in the application source code) +* setting the default command in the resulting image + +For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. + +##### 3.1. To use your own setup, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-120 + +# Add application sources +ADD test-app/nginx.conf "${NGINX_CONF_PATH}" +ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" +ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" +ADD test-app/*.html . + +# Run script uses standard ways to run the application +CMD nginx -g "daemon off;" +``` + +##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-120 + +# Add application sources to a directory where the assemble script expects them +# and set permissions so that the container runs without root access +# With older docker that does not support --chown option for ADD statement, +# use these statements instead: +# USER 0 +# ADD app-src /tmp/src +# RUN chown -R 1001:0 /tmp/src +# USER 1001 +ADD --chown=1001:0 app-src /tmp/src + +# Let the assemble script to install the dependencies +RUN /usr/libexec/s2i/assemble + +# Run script uses standard ways to run the application +CMD /usr/libexec/s2i/run +``` + +#### 4. Build a new image from a Dockerfile prepared in the previous step +``` +podman build -t nginx-app . +``` + +#### 5. Run the resulting image with the final application +``` +podman run -d nginx-app +``` + + +Direct usage with a mounted directory +------------------------------------- +An example of the data on the host for the following example: +``` +$ ls -lZ /wwwdata/html +-rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html +-rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html +``` + +If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host +as a container volume, execute the following command: + +``` +$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-120 nginx -g "daemon off;" +``` + +This creates a container named `nginx` running the Nginx server, serving data from +the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. +You can pull the data from the nginx container using this command: + +``` +$ curl -Lk 127.0.0.1:8080 +``` + +You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. + + +Environment variables and volumes +--------------------------------- +The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: + + +**`NGINX_LOG_TO_VOLUME`** + When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. + + +Troubleshooting +--------------- +By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: + + podman logs + +See also +-------- +Dockerfile and other sources for this container image are available on +https://github.com/sclorg/nginx-container. +In that repository you also can find another versions of Python environment Dockerfiles. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. + diff --git a/1.22-micro/root/README.md b/1.22-micro/root/README.md new file mode 100644 index 00000000..62891ac6 --- /dev/null +++ b/1.22-micro/root/README.md @@ -0,0 +1,205 @@ +Nginx 1.22 server and a reverse proxy server container image +============================================================ +This container image includes Nginx 1.22 server and a reverse server for OpenShift and general usage. +Users can choose between RHEL, CentOS Stream and Fedora based images. +The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), +and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). +The resulting image can be run using [podman](https://github.com/containers/libpod). + +Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. + + +Description +----------- + +Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP +protocols, with a strong focus on high concurrency, performance and low memory usage. The container +image provides a containerized packaging of the nginx 1.22 daemon. The image can be used +as a base image for other applications based on nginx 1.22 web server. +Nginx server image can be extended using Openshift's `Source` build feature. + + +Usage in OpenShift +------------------ +In this example, we assume that you are using the `ubi9/nginx-122` image, available through the `nginx:1.22` imagestream tag in Openshift. +To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.22/test-app) application in Openshift: + +``` +oc new-app nginx:1.22~https://github.com/sclorg/nginx-container.git --context-dir=1.22/test/test-app/ +``` + +To access the application: +``` +$ oc get pods +$ oc exec -- curl 127.0.0.1:8080 +``` + + +Source-to-Image framework and scripts +------------------------------------- +This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) +(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework +which makes it easy to write images that take application source code as +an input, use a builder image like this Nginx container image, and produce +a new image that runs the assembled application as an output. + +In case of Nginx container image, the application source code is typically +either static HTML pages or configuration files. + +To support the Source-to-Image framework, important scripts are included in the builder image: + +* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). + +* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: + +**`./nginx.conf`**-- + The main nginx configuration file + +**`./nginx-cfg/*.conf`** + Should contain all nginx configuration we want to include into image + +**`./nginx-default-cfg/*.conf`** + Contains any nginx config snippets to include in the default server block + +**`./nginx-start/*.sh`** + Contains shell scripts that are sourced right before nginx is launched + +**`./nginx-perl/*.pm`** + Contains perl modules to be use by `perl_modules` and `perl_require` directives + +**`./`** + Should contain nginx application source code + + +Build an application using a Dockerfile +--------------------------------------- +Compared to the Source-to-Image strategy, using a Dockerfile is a more +flexible way to build an Nginx container image with an application. +Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or +when you build the image outside of the OpenShift environment. + +To use the Nginx image in a Dockerfile, follow these steps: + +#### 1. Pull a base builder image to build on + +podman pull ubi9/nginx-122 + +#### 2. Pull an application code + +An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. + +``` +git clone https://github.com/sclorg/nginx-container.git nginx-container +cd nginx-container/examples/1.22/ +``` + +#### 3. Prepare an application inside a container + +This step usually consists of at least these parts: + +* putting the application source into the container +* moving configuration files to the correct place (if available in the application source code) +* setting the default command in the resulting image + +For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. + +##### 3.1. To use your own setup, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-122 + +# Add application sources +ADD test-app/nginx.conf "${NGINX_CONF_PATH}" +ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" +ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" +ADD test-app/*.html . + +# Run script uses standard ways to run the application +CMD nginx -g "daemon off;" +``` + +##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-122 + +# Add application sources to a directory where the assemble script expects them +# and set permissions so that the container runs without root access +# With older docker that does not support --chown option for ADD statement, +# use these statements instead: +# USER 0 +# ADD app-src /tmp/src +# RUN chown -R 1001:0 /tmp/src +# USER 1001 +ADD --chown=1001:0 app-src /tmp/src + +# Let the assemble script to install the dependencies +RUN /usr/libexec/s2i/assemble + +# Run script uses standard ways to run the application +CMD /usr/libexec/s2i/run +``` + +#### 4. Build a new image from a Dockerfile prepared in the previous step +``` +podman build -t nginx-app . +``` + +#### 5. Run the resulting image with the final application +``` +podman run -d nginx-app +``` + + +Direct usage with a mounted directory +------------------------------------- +An example of the data on the host for the following example: +``` +$ ls -lZ /wwwdata/html +-rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html +-rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html +``` + +If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host +as a container volume, execute the following command: + +``` +$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-122 nginx -g "daemon off;" +``` + +This creates a container named `nginx` running the Nginx server, serving data from +the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. +You can pull the data from the nginx container using this command: + +``` +$ curl -Lk 127.0.0.1:8080 +``` + +You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. + + +Environment variables and volumes +--------------------------------- +The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: + + +**`NGINX_LOG_TO_VOLUME`** + When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. + + +Troubleshooting +--------------- +By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: + + podman logs + +See also +-------- +Dockerfile and other sources for this container image are available on +https://github.com/sclorg/nginx-container. +In that repository you also can find another versions of Python environment Dockerfiles. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. + diff --git a/1.22/root/README.md b/1.22/root/README.md new file mode 100644 index 00000000..62891ac6 --- /dev/null +++ b/1.22/root/README.md @@ -0,0 +1,205 @@ +Nginx 1.22 server and a reverse proxy server container image +============================================================ +This container image includes Nginx 1.22 server and a reverse server for OpenShift and general usage. +Users can choose between RHEL, CentOS Stream and Fedora based images. +The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), +and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). +The resulting image can be run using [podman](https://github.com/containers/libpod). + +Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. + + +Description +----------- + +Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP +protocols, with a strong focus on high concurrency, performance and low memory usage. The container +image provides a containerized packaging of the nginx 1.22 daemon. The image can be used +as a base image for other applications based on nginx 1.22 web server. +Nginx server image can be extended using Openshift's `Source` build feature. + + +Usage in OpenShift +------------------ +In this example, we assume that you are using the `ubi9/nginx-122` image, available through the `nginx:1.22` imagestream tag in Openshift. +To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.22/test-app) application in Openshift: + +``` +oc new-app nginx:1.22~https://github.com/sclorg/nginx-container.git --context-dir=1.22/test/test-app/ +``` + +To access the application: +``` +$ oc get pods +$ oc exec -- curl 127.0.0.1:8080 +``` + + +Source-to-Image framework and scripts +------------------------------------- +This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) +(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework +which makes it easy to write images that take application source code as +an input, use a builder image like this Nginx container image, and produce +a new image that runs the assembled application as an output. + +In case of Nginx container image, the application source code is typically +either static HTML pages or configuration files. + +To support the Source-to-Image framework, important scripts are included in the builder image: + +* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). + +* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: + +**`./nginx.conf`**-- + The main nginx configuration file + +**`./nginx-cfg/*.conf`** + Should contain all nginx configuration we want to include into image + +**`./nginx-default-cfg/*.conf`** + Contains any nginx config snippets to include in the default server block + +**`./nginx-start/*.sh`** + Contains shell scripts that are sourced right before nginx is launched + +**`./nginx-perl/*.pm`** + Contains perl modules to be use by `perl_modules` and `perl_require` directives + +**`./`** + Should contain nginx application source code + + +Build an application using a Dockerfile +--------------------------------------- +Compared to the Source-to-Image strategy, using a Dockerfile is a more +flexible way to build an Nginx container image with an application. +Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or +when you build the image outside of the OpenShift environment. + +To use the Nginx image in a Dockerfile, follow these steps: + +#### 1. Pull a base builder image to build on + +podman pull ubi9/nginx-122 + +#### 2. Pull an application code + +An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. + +``` +git clone https://github.com/sclorg/nginx-container.git nginx-container +cd nginx-container/examples/1.22/ +``` + +#### 3. Prepare an application inside a container + +This step usually consists of at least these parts: + +* putting the application source into the container +* moving configuration files to the correct place (if available in the application source code) +* setting the default command in the resulting image + +For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. + +##### 3.1. To use your own setup, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-122 + +# Add application sources +ADD test-app/nginx.conf "${NGINX_CONF_PATH}" +ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" +ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" +ADD test-app/*.html . + +# Run script uses standard ways to run the application +CMD nginx -g "daemon off;" +``` + +##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-122 + +# Add application sources to a directory where the assemble script expects them +# and set permissions so that the container runs without root access +# With older docker that does not support --chown option for ADD statement, +# use these statements instead: +# USER 0 +# ADD app-src /tmp/src +# RUN chown -R 1001:0 /tmp/src +# USER 1001 +ADD --chown=1001:0 app-src /tmp/src + +# Let the assemble script to install the dependencies +RUN /usr/libexec/s2i/assemble + +# Run script uses standard ways to run the application +CMD /usr/libexec/s2i/run +``` + +#### 4. Build a new image from a Dockerfile prepared in the previous step +``` +podman build -t nginx-app . +``` + +#### 5. Run the resulting image with the final application +``` +podman run -d nginx-app +``` + + +Direct usage with a mounted directory +------------------------------------- +An example of the data on the host for the following example: +``` +$ ls -lZ /wwwdata/html +-rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html +-rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html +``` + +If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host +as a container volume, execute the following command: + +``` +$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-122 nginx -g "daemon off;" +``` + +This creates a container named `nginx` running the Nginx server, serving data from +the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. +You can pull the data from the nginx container using this command: + +``` +$ curl -Lk 127.0.0.1:8080 +``` + +You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. + + +Environment variables and volumes +--------------------------------- +The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: + + +**`NGINX_LOG_TO_VOLUME`** + When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. + + +Troubleshooting +--------------- +By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: + + podman logs + +See also +-------- +Dockerfile and other sources for this container image are available on +https://github.com/sclorg/nginx-container. +In that repository you also can find another versions of Python environment Dockerfiles. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. + diff --git a/1.24/root/README.md b/1.24/root/README.md new file mode 100644 index 00000000..0d8cedca --- /dev/null +++ b/1.24/root/README.md @@ -0,0 +1,205 @@ +Nginx 1.24 server and a reverse proxy server container image +============================================================ +This container image includes Nginx 1.24 server and a reverse server for OpenShift and general usage. +Users can choose between RHEL, CentOS Stream and Fedora based images. +The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), +and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). +The resulting image can be run using [podman](https://github.com/containers/libpod). + +Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. + + +Description +----------- + +Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP +protocols, with a strong focus on high concurrency, performance and low memory usage. The container +image provides a containerized packaging of the nginx 1.24 daemon. The image can be used +as a base image for other applications based on nginx 1.24 web server. +Nginx server image can be extended using Openshift's `Source` build feature. + + +Usage in OpenShift +------------------ +In this example, we assume that you are using the `ubi9/nginx-124` image, available through the `nginx:1.24` imagestream tag in Openshift. +To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.24/test-app) application in Openshift: + +``` +oc new-app nginx:1.24~https://github.com/sclorg/nginx-container.git --context-dir=1.24/test/test-app/ +``` + +To access the application: +``` +$ oc get pods +$ oc exec -- curl 127.0.0.1:8080 +``` + + +Source-to-Image framework and scripts +------------------------------------- +This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) +(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework +which makes it easy to write images that take application source code as +an input, use a builder image like this Nginx container image, and produce +a new image that runs the assembled application as an output. + +In case of Nginx container image, the application source code is typically +either static HTML pages or configuration files. + +To support the Source-to-Image framework, important scripts are included in the builder image: + +* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). + +* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: + +**`./nginx.conf`**-- + The main nginx configuration file + +**`./nginx-cfg/*.conf`** + Should contain all nginx configuration we want to include into image + +**`./nginx-default-cfg/*.conf`** + Contains any nginx config snippets to include in the default server block + +**`./nginx-start/*.sh`** + Contains shell scripts that are sourced right before nginx is launched + +**`./nginx-perl/*.pm`** + Contains perl modules to be use by `perl_modules` and `perl_require` directives + +**`./`** + Should contain nginx application source code + + +Build an application using a Dockerfile +--------------------------------------- +Compared to the Source-to-Image strategy, using a Dockerfile is a more +flexible way to build an Nginx container image with an application. +Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or +when you build the image outside of the OpenShift environment. + +To use the Nginx image in a Dockerfile, follow these steps: + +#### 1. Pull a base builder image to build on + +podman pull ubi9/nginx-124 + +#### 2. Pull an application code + +An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. + +``` +git clone https://github.com/sclorg/nginx-container.git nginx-container +cd nginx-container/examples/1.24/ +``` + +#### 3. Prepare an application inside a container + +This step usually consists of at least these parts: + +* putting the application source into the container +* moving configuration files to the correct place (if available in the application source code) +* setting the default command in the resulting image + +For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. + +##### 3.1. To use your own setup, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-124 + +# Add application sources +ADD test-app/nginx.conf "${NGINX_CONF_PATH}" +ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" +ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" +ADD test-app/*.html . + +# Run script uses standard ways to run the application +CMD nginx -g "daemon off;" +``` + +##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-124 + +# Add application sources to a directory where the assemble script expects them +# and set permissions so that the container runs without root access +# With older docker that does not support --chown option for ADD statement, +# use these statements instead: +# USER 0 +# ADD app-src /tmp/src +# RUN chown -R 1001:0 /tmp/src +# USER 1001 +ADD --chown=1001:0 app-src /tmp/src + +# Let the assemble script to install the dependencies +RUN /usr/libexec/s2i/assemble + +# Run script uses standard ways to run the application +CMD /usr/libexec/s2i/run +``` + +#### 4. Build a new image from a Dockerfile prepared in the previous step +``` +podman build -t nginx-app . +``` + +#### 5. Run the resulting image with the final application +``` +podman run -d nginx-app +``` + + +Direct usage with a mounted directory +------------------------------------- +An example of the data on the host for the following example: +``` +$ ls -lZ /wwwdata/html +-rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html +-rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html +``` + +If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host +as a container volume, execute the following command: + +``` +$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-124 nginx -g "daemon off;" +``` + +This creates a container named `nginx` running the Nginx server, serving data from +the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. +You can pull the data from the nginx container using this command: + +``` +$ curl -Lk 127.0.0.1:8080 +``` + +You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. + + +Environment variables and volumes +--------------------------------- +The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: + + +**`NGINX_LOG_TO_VOLUME`** + When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. + + +Troubleshooting +--------------- +By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: + + podman logs + +See also +-------- +Dockerfile and other sources for this container image are available on +https://github.com/sclorg/nginx-container. +In that repository you also can find another versions of Python environment Dockerfiles. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. + diff --git a/1.26/Dockerfile.c10s b/1.26/Dockerfile.c10s index d58300f9..128223e5 100644 --- a/1.26/Dockerfile.c10s +++ b/1.26/Dockerfile.c10s @@ -37,8 +37,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ diff --git a/1.26/Dockerfile.rhel10 b/1.26/Dockerfile.rhel10 index a7f379ae..de36b982 100644 --- a/1.26/Dockerfile.rhel10 +++ b/1.26/Dockerfile.rhel10 @@ -37,8 +37,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ +RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ diff --git a/1.26/root/README.md b/1.26/root/README.md new file mode 100644 index 00000000..50be323e --- /dev/null +++ b/1.26/root/README.md @@ -0,0 +1,205 @@ +Nginx 1.26 server and a reverse proxy server container image +============================================================ +This container image includes Nginx 1.26 server and a reverse server for OpenShift and general usage. +Users can choose between RHEL, CentOS Stream and Fedora based images. +The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), +the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), +and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). +The resulting image can be run using [podman](https://github.com/containers/libpod). + +Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. + + +Description +----------- + +Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP +protocols, with a strong focus on high concurrency, performance and low memory usage. The container +image provides a containerized packaging of the nginx 1.26 daemon. The image can be used +as a base image for other applications based on nginx 1.26 web server. +Nginx server image can be extended using Openshift's `Source` build feature. + + +Usage in OpenShift +------------------ +In this example, we assume that you are using the `ubi9/nginx-126` image, available through the `nginx:1.26` imagestream tag in Openshift. +To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.26/test-app) application in Openshift: + +``` +oc new-app nginx:1.26~https://github.com/sclorg/nginx-container.git --context-dir=1.26/test/test-app/ +``` + +To access the application: +``` +$ oc get pods +$ oc exec -- curl 127.0.0.1:8080 +``` + + +Source-to-Image framework and scripts +------------------------------------- +This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) +(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework +which makes it easy to write images that take application source code as +an input, use a builder image like this Nginx container image, and produce +a new image that runs the assembled application as an output. + +In case of Nginx container image, the application source code is typically +either static HTML pages or configuration files. + +To support the Source-to-Image framework, important scripts are included in the builder image: + +* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). + +* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: + +**`./nginx.conf`**-- + The main nginx configuration file + +**`./nginx-cfg/*.conf`** + Should contain all nginx configuration we want to include into image + +**`./nginx-default-cfg/*.conf`** + Contains any nginx config snippets to include in the default server block + +**`./nginx-start/*.sh`** + Contains shell scripts that are sourced right before nginx is launched + +**`./nginx-perl/*.pm`** + Contains perl modules to be use by `perl_modules` and `perl_require` directives + +**`./`** + Should contain nginx application source code + + +Build an application using a Dockerfile +--------------------------------------- +Compared to the Source-to-Image strategy, using a Dockerfile is a more +flexible way to build an Nginx container image with an application. +Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or +when you build the image outside of the OpenShift environment. + +To use the Nginx image in a Dockerfile, follow these steps: + +#### 1. Pull a base builder image to build on + +podman pull ubi9/nginx-126 + +#### 2. Pull an application code + +An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. + +``` +git clone https://github.com/sclorg/nginx-container.git nginx-container +cd nginx-container/examples/1.26/ +``` + +#### 3. Prepare an application inside a container + +This step usually consists of at least these parts: + +* putting the application source into the container +* moving configuration files to the correct place (if available in the application source code) +* setting the default command in the resulting image + +For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. + +##### 3.1. To use your own setup, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-126 + +# Add application sources +ADD test-app/nginx.conf "${NGINX_CONF_PATH}" +ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" +ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" +ADD test-app/*.html . + +# Run script uses standard ways to run the application +CMD nginx -g "daemon off;" +``` + +##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: + +``` +FROM registry.access.redhat.com/ubi9/nginx-126 + +# Add application sources to a directory where the assemble script expects them +# and set permissions so that the container runs without root access +# With older docker that does not support --chown option for ADD statement, +# use these statements instead: +# USER 0 +# ADD app-src /tmp/src +# RUN chown -R 1001:0 /tmp/src +# USER 1001 +ADD --chown=1001:0 app-src /tmp/src + +# Let the assemble script to install the dependencies +RUN /usr/libexec/s2i/assemble + +# Run script uses standard ways to run the application +CMD /usr/libexec/s2i/run +``` + +#### 4. Build a new image from a Dockerfile prepared in the previous step +``` +podman build -t nginx-app . +``` + +#### 5. Run the resulting image with the final application +``` +podman run -d nginx-app +``` + + +Direct usage with a mounted directory +------------------------------------- +An example of the data on the host for the following example: +``` +$ ls -lZ /wwwdata/html +-rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html +-rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html +``` + +If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host +as a container volume, execute the following command: + +``` +$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-126 nginx -g "daemon off;" +``` + +This creates a container named `nginx` running the Nginx server, serving data from +the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. +You can pull the data from the nginx container using this command: + +``` +$ curl -Lk 127.0.0.1:8080 +``` + +You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. + + +Environment variables and volumes +--------------------------------- +The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: + + +**`NGINX_LOG_TO_VOLUME`** + When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. + + +Troubleshooting +--------------- +By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: + + podman logs + +See also +-------- +Dockerfile and other sources for this container image are available on +https://github.com/sclorg/nginx-container. +In that repository you also can find another versions of Python environment Dockerfiles. +for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, +Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, +Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. + diff --git a/src/Dockerfile b/src/Dockerfile index 8edc9003..24c7cccb 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -42,8 +42,12 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl +{% if spec.environment_setup %} RUN {{ spec.environment_setup }} INSTALL_PKGS="nss_wrapper-libs gettext hostname {{ spec.pkgs }}" && \ +{% else %} +RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname {{ spec.pkgs }}" && \ +{% endif %} {{ spec.pkg_manager }} install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ From 2adbe563e4317fec29cc0ac1fa5736c1daa9eb93 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Mon, 18 May 2026 21:52:50 +0200 Subject: [PATCH 07/13] Use JSON array format for CMD to suppress Docker warning Changed from 'CMD $STI_SCRIPTS_PATH/usage' to 'CMD ["/usr/libexec/s2i/usage"]' to follow Docker best practices and prevent build warnings from breaking image ID extraction in build scripts. --- 1.20/Dockerfile.c9s | 2 +- 1.20/Dockerfile.fedora | 2 +- 1.20/Dockerfile.rhel8 | 2 +- 1.20/Dockerfile.rhel9 | 2 +- 1.20/root/README.md | 205 ----------------------------------- 1.22-micro/Dockerfile.c9s | 2 +- 1.22-micro/Dockerfile.fedora | 2 +- 1.22-micro/Dockerfile.rhel8 | 2 +- 1.22-micro/root/README.md | 205 ----------------------------------- 1.22/Dockerfile.c9s | 2 +- 1.22/Dockerfile.fedora | 2 +- 1.22/Dockerfile.rhel8 | 2 +- 1.22/Dockerfile.rhel9 | 2 +- 1.22/root/README.md | 205 ----------------------------------- 1.24/Dockerfile.c9s | 2 +- 1.24/Dockerfile.fedora | 2 +- 1.24/Dockerfile.rhel8 | 2 +- 1.24/Dockerfile.rhel9 | 2 +- 1.24/root/README.md | 205 ----------------------------------- 1.26/Dockerfile.c10s | 2 +- 1.26/Dockerfile.c9s | 2 +- 1.26/Dockerfile.fedora | 2 +- 1.26/Dockerfile.rhel10 | 2 +- 1.26/Dockerfile.rhel8 | 2 +- 1.26/Dockerfile.rhel9 | 2 +- 1.26/root/README.md | 205 ----------------------------------- src/Dockerfile | 2 +- src/Dockerfile.fedora | 2 +- 28 files changed, 23 insertions(+), 1048 deletions(-) delete mode 100644 1.20/root/README.md delete mode 100644 1.22-micro/root/README.md delete mode 100644 1.22/root/README.md delete mode 100644 1.24/root/README.md delete mode 100644 1.26/root/README.md diff --git a/1.20/Dockerfile.c9s b/1.20/Dockerfile.c9s index 7ecf681a..5b9e6389 100644 --- a/1.20/Dockerfile.c9s +++ b/1.20/Dockerfile.c9s @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.20/Dockerfile.fedora b/1.20/Dockerfile.fedora index 1c8a28da..1c7d0aab 100644 --- a/1.20/Dockerfile.fedora +++ b/1.20/Dockerfile.fedora @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.20/Dockerfile.rhel8 b/1.20/Dockerfile.rhel8 index e9cbdbf2..be2c0ab3 100644 --- a/1.20/Dockerfile.rhel8 +++ b/1.20/Dockerfile.rhel8 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.20/Dockerfile.rhel9 b/1.20/Dockerfile.rhel9 index 26d74d66..38278fbd 100644 --- a/1.20/Dockerfile.rhel9 +++ b/1.20/Dockerfile.rhel9 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.20/root/README.md b/1.20/root/README.md deleted file mode 100644 index a0839469..00000000 --- a/1.20/root/README.md +++ /dev/null @@ -1,205 +0,0 @@ -Nginx 1.20 server and a reverse proxy server container image -============================================================ -This container image includes Nginx 1.20 server and a reverse server for OpenShift and general usage. -Users can choose between RHEL, CentOS Stream and Fedora based images. -The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), -the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), -and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). -The resulting image can be run using [podman](https://github.com/containers/libpod). - -Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. - - -Description ------------ - -Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP -protocols, with a strong focus on high concurrency, performance and low memory usage. The container -image provides a containerized packaging of the nginx 1.20 daemon. The image can be used -as a base image for other applications based on nginx 1.20 web server. -Nginx server image can be extended using Openshift's `Source` build feature. - - -Usage in OpenShift ------------------- -In this example, we assume that you are using the `ubi9/nginx-120` image, available through the `nginx:1.20` imagestream tag in Openshift. -To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.20/test-app) application in Openshift: - -``` -oc new-app nginx:1.20~https://github.com/sclorg/nginx-container.git --context-dir=1.20/test/test-app/ -``` - -To access the application: -``` -$ oc get pods -$ oc exec -- curl 127.0.0.1:8080 -``` - - -Source-to-Image framework and scripts -------------------------------------- -This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) -(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework -which makes it easy to write images that take application source code as -an input, use a builder image like this Nginx container image, and produce -a new image that runs the assembled application as an output. - -In case of Nginx container image, the application source code is typically -either static HTML pages or configuration files. - -To support the Source-to-Image framework, important scripts are included in the builder image: - -* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). - -* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: - -**`./nginx.conf`**-- - The main nginx configuration file - -**`./nginx-cfg/*.conf`** - Should contain all nginx configuration we want to include into image - -**`./nginx-default-cfg/*.conf`** - Contains any nginx config snippets to include in the default server block - -**`./nginx-start/*.sh`** - Contains shell scripts that are sourced right before nginx is launched - -**`./nginx-perl/*.pm`** - Contains perl modules to be use by `perl_modules` and `perl_require` directives - -**`./`** - Should contain nginx application source code - - -Build an application using a Dockerfile ---------------------------------------- -Compared to the Source-to-Image strategy, using a Dockerfile is a more -flexible way to build an Nginx container image with an application. -Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or -when you build the image outside of the OpenShift environment. - -To use the Nginx image in a Dockerfile, follow these steps: - -#### 1. Pull a base builder image to build on - -podman pull ubi9/nginx-120 - -#### 2. Pull an application code - -An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. - -``` -git clone https://github.com/sclorg/nginx-container.git nginx-container -cd nginx-container/examples/1.20/ -``` - -#### 3. Prepare an application inside a container - -This step usually consists of at least these parts: - -* putting the application source into the container -* moving configuration files to the correct place (if available in the application source code) -* setting the default command in the resulting image - -For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. - -##### 3.1. To use your own setup, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-120 - -# Add application sources -ADD test-app/nginx.conf "${NGINX_CONF_PATH}" -ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" -ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" -ADD test-app/*.html . - -# Run script uses standard ways to run the application -CMD nginx -g "daemon off;" -``` - -##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-120 - -# Add application sources to a directory where the assemble script expects them -# and set permissions so that the container runs without root access -# With older docker that does not support --chown option for ADD statement, -# use these statements instead: -# USER 0 -# ADD app-src /tmp/src -# RUN chown -R 1001:0 /tmp/src -# USER 1001 -ADD --chown=1001:0 app-src /tmp/src - -# Let the assemble script to install the dependencies -RUN /usr/libexec/s2i/assemble - -# Run script uses standard ways to run the application -CMD /usr/libexec/s2i/run -``` - -#### 4. Build a new image from a Dockerfile prepared in the previous step -``` -podman build -t nginx-app . -``` - -#### 5. Run the resulting image with the final application -``` -podman run -d nginx-app -``` - - -Direct usage with a mounted directory -------------------------------------- -An example of the data on the host for the following example: -``` -$ ls -lZ /wwwdata/html --rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html --rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html -``` - -If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host -as a container volume, execute the following command: - -``` -$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-120 nginx -g "daemon off;" -``` - -This creates a container named `nginx` running the Nginx server, serving data from -the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. -You can pull the data from the nginx container using this command: - -``` -$ curl -Lk 127.0.0.1:8080 -``` - -You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. - - -Environment variables and volumes ---------------------------------- -The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: - - -**`NGINX_LOG_TO_VOLUME`** - When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. - - -Troubleshooting ---------------- -By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: - - podman logs - -See also --------- -Dockerfile and other sources for this container image are available on -https://github.com/sclorg/nginx-container. -In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, -Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. - diff --git a/1.22-micro/Dockerfile.c9s b/1.22-micro/Dockerfile.c9s index aceb94de..9022d693 100644 --- a/1.22-micro/Dockerfile.c9s +++ b/1.22-micro/Dockerfile.c9s @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.22-micro/Dockerfile.fedora b/1.22-micro/Dockerfile.fedora index 753e302d..22c5e853 100644 --- a/1.22-micro/Dockerfile.fedora +++ b/1.22-micro/Dockerfile.fedora @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.22-micro/Dockerfile.rhel8 b/1.22-micro/Dockerfile.rhel8 index e7fe4b75..266eef7b 100644 --- a/1.22-micro/Dockerfile.rhel8 +++ b/1.22-micro/Dockerfile.rhel8 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.22-micro/root/README.md b/1.22-micro/root/README.md deleted file mode 100644 index 62891ac6..00000000 --- a/1.22-micro/root/README.md +++ /dev/null @@ -1,205 +0,0 @@ -Nginx 1.22 server and a reverse proxy server container image -============================================================ -This container image includes Nginx 1.22 server and a reverse server for OpenShift and general usage. -Users can choose between RHEL, CentOS Stream and Fedora based images. -The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), -the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), -and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). -The resulting image can be run using [podman](https://github.com/containers/libpod). - -Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. - - -Description ------------ - -Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP -protocols, with a strong focus on high concurrency, performance and low memory usage. The container -image provides a containerized packaging of the nginx 1.22 daemon. The image can be used -as a base image for other applications based on nginx 1.22 web server. -Nginx server image can be extended using Openshift's `Source` build feature. - - -Usage in OpenShift ------------------- -In this example, we assume that you are using the `ubi9/nginx-122` image, available through the `nginx:1.22` imagestream tag in Openshift. -To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.22/test-app) application in Openshift: - -``` -oc new-app nginx:1.22~https://github.com/sclorg/nginx-container.git --context-dir=1.22/test/test-app/ -``` - -To access the application: -``` -$ oc get pods -$ oc exec -- curl 127.0.0.1:8080 -``` - - -Source-to-Image framework and scripts -------------------------------------- -This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) -(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework -which makes it easy to write images that take application source code as -an input, use a builder image like this Nginx container image, and produce -a new image that runs the assembled application as an output. - -In case of Nginx container image, the application source code is typically -either static HTML pages or configuration files. - -To support the Source-to-Image framework, important scripts are included in the builder image: - -* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). - -* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: - -**`./nginx.conf`**-- - The main nginx configuration file - -**`./nginx-cfg/*.conf`** - Should contain all nginx configuration we want to include into image - -**`./nginx-default-cfg/*.conf`** - Contains any nginx config snippets to include in the default server block - -**`./nginx-start/*.sh`** - Contains shell scripts that are sourced right before nginx is launched - -**`./nginx-perl/*.pm`** - Contains perl modules to be use by `perl_modules` and `perl_require` directives - -**`./`** - Should contain nginx application source code - - -Build an application using a Dockerfile ---------------------------------------- -Compared to the Source-to-Image strategy, using a Dockerfile is a more -flexible way to build an Nginx container image with an application. -Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or -when you build the image outside of the OpenShift environment. - -To use the Nginx image in a Dockerfile, follow these steps: - -#### 1. Pull a base builder image to build on - -podman pull ubi9/nginx-122 - -#### 2. Pull an application code - -An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. - -``` -git clone https://github.com/sclorg/nginx-container.git nginx-container -cd nginx-container/examples/1.22/ -``` - -#### 3. Prepare an application inside a container - -This step usually consists of at least these parts: - -* putting the application source into the container -* moving configuration files to the correct place (if available in the application source code) -* setting the default command in the resulting image - -For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. - -##### 3.1. To use your own setup, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-122 - -# Add application sources -ADD test-app/nginx.conf "${NGINX_CONF_PATH}" -ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" -ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" -ADD test-app/*.html . - -# Run script uses standard ways to run the application -CMD nginx -g "daemon off;" -``` - -##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-122 - -# Add application sources to a directory where the assemble script expects them -# and set permissions so that the container runs without root access -# With older docker that does not support --chown option for ADD statement, -# use these statements instead: -# USER 0 -# ADD app-src /tmp/src -# RUN chown -R 1001:0 /tmp/src -# USER 1001 -ADD --chown=1001:0 app-src /tmp/src - -# Let the assemble script to install the dependencies -RUN /usr/libexec/s2i/assemble - -# Run script uses standard ways to run the application -CMD /usr/libexec/s2i/run -``` - -#### 4. Build a new image from a Dockerfile prepared in the previous step -``` -podman build -t nginx-app . -``` - -#### 5. Run the resulting image with the final application -``` -podman run -d nginx-app -``` - - -Direct usage with a mounted directory -------------------------------------- -An example of the data on the host for the following example: -``` -$ ls -lZ /wwwdata/html --rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html --rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html -``` - -If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host -as a container volume, execute the following command: - -``` -$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-122 nginx -g "daemon off;" -``` - -This creates a container named `nginx` running the Nginx server, serving data from -the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. -You can pull the data from the nginx container using this command: - -``` -$ curl -Lk 127.0.0.1:8080 -``` - -You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. - - -Environment variables and volumes ---------------------------------- -The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: - - -**`NGINX_LOG_TO_VOLUME`** - When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. - - -Troubleshooting ---------------- -By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: - - podman logs - -See also --------- -Dockerfile and other sources for this container image are available on -https://github.com/sclorg/nginx-container. -In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, -Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. - diff --git a/1.22/Dockerfile.c9s b/1.22/Dockerfile.c9s index aceb94de..9022d693 100644 --- a/1.22/Dockerfile.c9s +++ b/1.22/Dockerfile.c9s @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.22/Dockerfile.fedora b/1.22/Dockerfile.fedora index 753e302d..22c5e853 100644 --- a/1.22/Dockerfile.fedora +++ b/1.22/Dockerfile.fedora @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.22/Dockerfile.rhel8 b/1.22/Dockerfile.rhel8 index e7fe4b75..266eef7b 100644 --- a/1.22/Dockerfile.rhel8 +++ b/1.22/Dockerfile.rhel8 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.22/Dockerfile.rhel9 b/1.22/Dockerfile.rhel9 index 95d86d91..1003f98e 100644 --- a/1.22/Dockerfile.rhel9 +++ b/1.22/Dockerfile.rhel9 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.22/root/README.md b/1.22/root/README.md deleted file mode 100644 index 62891ac6..00000000 --- a/1.22/root/README.md +++ /dev/null @@ -1,205 +0,0 @@ -Nginx 1.22 server and a reverse proxy server container image -============================================================ -This container image includes Nginx 1.22 server and a reverse server for OpenShift and general usage. -Users can choose between RHEL, CentOS Stream and Fedora based images. -The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), -the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), -and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). -The resulting image can be run using [podman](https://github.com/containers/libpod). - -Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. - - -Description ------------ - -Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP -protocols, with a strong focus on high concurrency, performance and low memory usage. The container -image provides a containerized packaging of the nginx 1.22 daemon. The image can be used -as a base image for other applications based on nginx 1.22 web server. -Nginx server image can be extended using Openshift's `Source` build feature. - - -Usage in OpenShift ------------------- -In this example, we assume that you are using the `ubi9/nginx-122` image, available through the `nginx:1.22` imagestream tag in Openshift. -To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.22/test-app) application in Openshift: - -``` -oc new-app nginx:1.22~https://github.com/sclorg/nginx-container.git --context-dir=1.22/test/test-app/ -``` - -To access the application: -``` -$ oc get pods -$ oc exec -- curl 127.0.0.1:8080 -``` - - -Source-to-Image framework and scripts -------------------------------------- -This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) -(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework -which makes it easy to write images that take application source code as -an input, use a builder image like this Nginx container image, and produce -a new image that runs the assembled application as an output. - -In case of Nginx container image, the application source code is typically -either static HTML pages or configuration files. - -To support the Source-to-Image framework, important scripts are included in the builder image: - -* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). - -* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: - -**`./nginx.conf`**-- - The main nginx configuration file - -**`./nginx-cfg/*.conf`** - Should contain all nginx configuration we want to include into image - -**`./nginx-default-cfg/*.conf`** - Contains any nginx config snippets to include in the default server block - -**`./nginx-start/*.sh`** - Contains shell scripts that are sourced right before nginx is launched - -**`./nginx-perl/*.pm`** - Contains perl modules to be use by `perl_modules` and `perl_require` directives - -**`./`** - Should contain nginx application source code - - -Build an application using a Dockerfile ---------------------------------------- -Compared to the Source-to-Image strategy, using a Dockerfile is a more -flexible way to build an Nginx container image with an application. -Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or -when you build the image outside of the OpenShift environment. - -To use the Nginx image in a Dockerfile, follow these steps: - -#### 1. Pull a base builder image to build on - -podman pull ubi9/nginx-122 - -#### 2. Pull an application code - -An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. - -``` -git clone https://github.com/sclorg/nginx-container.git nginx-container -cd nginx-container/examples/1.22/ -``` - -#### 3. Prepare an application inside a container - -This step usually consists of at least these parts: - -* putting the application source into the container -* moving configuration files to the correct place (if available in the application source code) -* setting the default command in the resulting image - -For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. - -##### 3.1. To use your own setup, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-122 - -# Add application sources -ADD test-app/nginx.conf "${NGINX_CONF_PATH}" -ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" -ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" -ADD test-app/*.html . - -# Run script uses standard ways to run the application -CMD nginx -g "daemon off;" -``` - -##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-122 - -# Add application sources to a directory where the assemble script expects them -# and set permissions so that the container runs without root access -# With older docker that does not support --chown option for ADD statement, -# use these statements instead: -# USER 0 -# ADD app-src /tmp/src -# RUN chown -R 1001:0 /tmp/src -# USER 1001 -ADD --chown=1001:0 app-src /tmp/src - -# Let the assemble script to install the dependencies -RUN /usr/libexec/s2i/assemble - -# Run script uses standard ways to run the application -CMD /usr/libexec/s2i/run -``` - -#### 4. Build a new image from a Dockerfile prepared in the previous step -``` -podman build -t nginx-app . -``` - -#### 5. Run the resulting image with the final application -``` -podman run -d nginx-app -``` - - -Direct usage with a mounted directory -------------------------------------- -An example of the data on the host for the following example: -``` -$ ls -lZ /wwwdata/html --rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html --rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html -``` - -If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host -as a container volume, execute the following command: - -``` -$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-122 nginx -g "daemon off;" -``` - -This creates a container named `nginx` running the Nginx server, serving data from -the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. -You can pull the data from the nginx container using this command: - -``` -$ curl -Lk 127.0.0.1:8080 -``` - -You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. - - -Environment variables and volumes ---------------------------------- -The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: - - -**`NGINX_LOG_TO_VOLUME`** - When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. - - -Troubleshooting ---------------- -By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: - - podman logs - -See also --------- -Dockerfile and other sources for this container image are available on -https://github.com/sclorg/nginx-container. -In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, -Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. - diff --git a/1.24/Dockerfile.c9s b/1.24/Dockerfile.c9s index d85ae0a0..21bc1dc8 100644 --- a/1.24/Dockerfile.c9s +++ b/1.24/Dockerfile.c9s @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.24/Dockerfile.fedora b/1.24/Dockerfile.fedora index 5f3147a6..cb25ef30 100644 --- a/1.24/Dockerfile.fedora +++ b/1.24/Dockerfile.fedora @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.24/Dockerfile.rhel8 b/1.24/Dockerfile.rhel8 index 2a80febf..b704eeaf 100644 --- a/1.24/Dockerfile.rhel8 +++ b/1.24/Dockerfile.rhel8 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.24/Dockerfile.rhel9 b/1.24/Dockerfile.rhel9 index 99d906cf..3fbaa83c 100644 --- a/1.24/Dockerfile.rhel9 +++ b/1.24/Dockerfile.rhel9 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.24/root/README.md b/1.24/root/README.md deleted file mode 100644 index 0d8cedca..00000000 --- a/1.24/root/README.md +++ /dev/null @@ -1,205 +0,0 @@ -Nginx 1.24 server and a reverse proxy server container image -============================================================ -This container image includes Nginx 1.24 server and a reverse server for OpenShift and general usage. -Users can choose between RHEL, CentOS Stream and Fedora based images. -The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), -the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), -and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). -The resulting image can be run using [podman](https://github.com/containers/libpod). - -Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. - - -Description ------------ - -Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP -protocols, with a strong focus on high concurrency, performance and low memory usage. The container -image provides a containerized packaging of the nginx 1.24 daemon. The image can be used -as a base image for other applications based on nginx 1.24 web server. -Nginx server image can be extended using Openshift's `Source` build feature. - - -Usage in OpenShift ------------------- -In this example, we assume that you are using the `ubi9/nginx-124` image, available through the `nginx:1.24` imagestream tag in Openshift. -To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.24/test-app) application in Openshift: - -``` -oc new-app nginx:1.24~https://github.com/sclorg/nginx-container.git --context-dir=1.24/test/test-app/ -``` - -To access the application: -``` -$ oc get pods -$ oc exec -- curl 127.0.0.1:8080 -``` - - -Source-to-Image framework and scripts -------------------------------------- -This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) -(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework -which makes it easy to write images that take application source code as -an input, use a builder image like this Nginx container image, and produce -a new image that runs the assembled application as an output. - -In case of Nginx container image, the application source code is typically -either static HTML pages or configuration files. - -To support the Source-to-Image framework, important scripts are included in the builder image: - -* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). - -* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: - -**`./nginx.conf`**-- - The main nginx configuration file - -**`./nginx-cfg/*.conf`** - Should contain all nginx configuration we want to include into image - -**`./nginx-default-cfg/*.conf`** - Contains any nginx config snippets to include in the default server block - -**`./nginx-start/*.sh`** - Contains shell scripts that are sourced right before nginx is launched - -**`./nginx-perl/*.pm`** - Contains perl modules to be use by `perl_modules` and `perl_require` directives - -**`./`** - Should contain nginx application source code - - -Build an application using a Dockerfile ---------------------------------------- -Compared to the Source-to-Image strategy, using a Dockerfile is a more -flexible way to build an Nginx container image with an application. -Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or -when you build the image outside of the OpenShift environment. - -To use the Nginx image in a Dockerfile, follow these steps: - -#### 1. Pull a base builder image to build on - -podman pull ubi9/nginx-124 - -#### 2. Pull an application code - -An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. - -``` -git clone https://github.com/sclorg/nginx-container.git nginx-container -cd nginx-container/examples/1.24/ -``` - -#### 3. Prepare an application inside a container - -This step usually consists of at least these parts: - -* putting the application source into the container -* moving configuration files to the correct place (if available in the application source code) -* setting the default command in the resulting image - -For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. - -##### 3.1. To use your own setup, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-124 - -# Add application sources -ADD test-app/nginx.conf "${NGINX_CONF_PATH}" -ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" -ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" -ADD test-app/*.html . - -# Run script uses standard ways to run the application -CMD nginx -g "daemon off;" -``` - -##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-124 - -# Add application sources to a directory where the assemble script expects them -# and set permissions so that the container runs without root access -# With older docker that does not support --chown option for ADD statement, -# use these statements instead: -# USER 0 -# ADD app-src /tmp/src -# RUN chown -R 1001:0 /tmp/src -# USER 1001 -ADD --chown=1001:0 app-src /tmp/src - -# Let the assemble script to install the dependencies -RUN /usr/libexec/s2i/assemble - -# Run script uses standard ways to run the application -CMD /usr/libexec/s2i/run -``` - -#### 4. Build a new image from a Dockerfile prepared in the previous step -``` -podman build -t nginx-app . -``` - -#### 5. Run the resulting image with the final application -``` -podman run -d nginx-app -``` - - -Direct usage with a mounted directory -------------------------------------- -An example of the data on the host for the following example: -``` -$ ls -lZ /wwwdata/html --rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html --rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html -``` - -If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host -as a container volume, execute the following command: - -``` -$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-124 nginx -g "daemon off;" -``` - -This creates a container named `nginx` running the Nginx server, serving data from -the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. -You can pull the data from the nginx container using this command: - -``` -$ curl -Lk 127.0.0.1:8080 -``` - -You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. - - -Environment variables and volumes ---------------------------------- -The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: - - -**`NGINX_LOG_TO_VOLUME`** - When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. - - -Troubleshooting ---------------- -By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: - - podman logs - -See also --------- -Dockerfile and other sources for this container image are available on -https://github.com/sclorg/nginx-container. -In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, -Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. - diff --git a/1.26/Dockerfile.c10s b/1.26/Dockerfile.c10s index 128223e5..e260662c 100644 --- a/1.26/Dockerfile.c10s +++ b/1.26/Dockerfile.c10s @@ -83,4 +83,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.26/Dockerfile.c9s b/1.26/Dockerfile.c9s index b089fe28..6b91bd93 100644 --- a/1.26/Dockerfile.c9s +++ b/1.26/Dockerfile.c9s @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.26/Dockerfile.fedora b/1.26/Dockerfile.fedora index 1a10def9..109684dd 100644 --- a/1.26/Dockerfile.fedora +++ b/1.26/Dockerfile.fedora @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.26/Dockerfile.rhel10 b/1.26/Dockerfile.rhel10 index de36b982..cce371ec 100644 --- a/1.26/Dockerfile.rhel10 +++ b/1.26/Dockerfile.rhel10 @@ -83,4 +83,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.26/Dockerfile.rhel8 b/1.26/Dockerfile.rhel8 index f094bc12..28cc1392 100644 --- a/1.26/Dockerfile.rhel8 +++ b/1.26/Dockerfile.rhel8 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.26/Dockerfile.rhel9 b/1.26/Dockerfile.rhel9 index c162055a..ee8c9799 100644 --- a/1.26/Dockerfile.rhel9 +++ b/1.26/Dockerfile.rhel9 @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/1.26/root/README.md b/1.26/root/README.md deleted file mode 100644 index 50be323e..00000000 --- a/1.26/root/README.md +++ /dev/null @@ -1,205 +0,0 @@ -Nginx 1.26 server and a reverse proxy server container image -============================================================ -This container image includes Nginx 1.26 server and a reverse server for OpenShift and general usage. -Users can choose between RHEL, CentOS Stream and Fedora based images. -The RHEL images are available in the [Red Hat Container Catalog](https://access.redhat.com/containers/), -the CentOS Stream images are available in the [Quay.io](https://quay.io/organization/sclorg), -and the Fedora images are available in the [Quay.io](https://quay.io/organization/fedora). -The resulting image can be run using [podman](https://github.com/containers/libpod). - -Note: while the examples in this README are calling `podman`, you can replace any such calls by `docker` with the same arguments. - - -Description ------------ - -Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP -protocols, with a strong focus on high concurrency, performance and low memory usage. The container -image provides a containerized packaging of the nginx 1.26 daemon. The image can be used -as a base image for other applications based on nginx 1.26 web server. -Nginx server image can be extended using Openshift's `Source` build feature. - - -Usage in OpenShift ------------------- -In this example, we assume that you are using the `ubi9/nginx-126` image, available through the `nginx:1.26` imagestream tag in Openshift. -To build a simple [test-app](https://github.com/sclorg/nginx-container/tree/master/examples/1.26/test-app) application in Openshift: - -``` -oc new-app nginx:1.26~https://github.com/sclorg/nginx-container.git --context-dir=1.26/test/test-app/ -``` - -To access the application: -``` -$ oc get pods -$ oc exec -- curl 127.0.0.1:8080 -``` - - -Source-to-Image framework and scripts -------------------------------------- -This image supports the [Source-to-Image](https://docs.openshift.com/container-platform/4.14/openshift_images/create-images.html#images-create-s2i_create-images) -(S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework -which makes it easy to write images that take application source code as -an input, use a builder image like this Nginx container image, and produce -a new image that runs the assembled application as an output. - -In case of Nginx container image, the application source code is typically -either static HTML pages or configuration files. - -To support the Source-to-Image framework, important scripts are included in the builder image: - -* The `/usr/libexec/s2i/run` script is set as the default command in the resulting container image (the new image with the application artifacts). - -* The `/usr/libexec/s2i/assemble` script inside the image is run to produce a new image with the application artifacts. The script takes sources of a given application (HTML pages), Nginx configuration files, and places them into appropriate directories inside the image. The structure of nginx-app can look like this: - -**`./nginx.conf`**-- - The main nginx configuration file - -**`./nginx-cfg/*.conf`** - Should contain all nginx configuration we want to include into image - -**`./nginx-default-cfg/*.conf`** - Contains any nginx config snippets to include in the default server block - -**`./nginx-start/*.sh`** - Contains shell scripts that are sourced right before nginx is launched - -**`./nginx-perl/*.pm`** - Contains perl modules to be use by `perl_modules` and `perl_require` directives - -**`./`** - Should contain nginx application source code - - -Build an application using a Dockerfile ---------------------------------------- -Compared to the Source-to-Image strategy, using a Dockerfile is a more -flexible way to build an Nginx container image with an application. -Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or -when you build the image outside of the OpenShift environment. - -To use the Nginx image in a Dockerfile, follow these steps: - -#### 1. Pull a base builder image to build on - -podman pull ubi9/nginx-126 - -#### 2. Pull an application code - -An example application available at https://github.com/sclorg/nginx-container.git is used here. To adjust the example application, clone the repository. - -``` -git clone https://github.com/sclorg/nginx-container.git nginx-container -cd nginx-container/examples/1.26/ -``` - -#### 3. Prepare an application inside a container - -This step usually consists of at least these parts: - -* putting the application source into the container -* moving configuration files to the correct place (if available in the application source code) -* setting the default command in the resulting image - -For all these three parts, you can either set up all manually and use the `nginx` command explicitly in the Dockerfile ([3.1.](#31-to-use-own-setup-create-a-dockerfile-with-this-content)), or you can use the Source-to-Image scripts inside the image ([3.2.](#32-to-use-the-source-to-image-scripts-and-build-an-image-using-a-dockerfile-create-a-dockerfile-with-this-content); see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Nginx applications. - -##### 3.1. To use your own setup, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-126 - -# Add application sources -ADD test-app/nginx.conf "${NGINX_CONF_PATH}" -ADD test-app/nginx-default-cfg/*.conf "${NGINX_DEFAULT_CONF_PATH}" -ADD test-app/nginx-cfg/*.conf "${NGINX_CONFIGURATION_PATH}" -ADD test-app/*.html . - -# Run script uses standard ways to run the application -CMD nginx -g "daemon off;" -``` - -##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: - -``` -FROM registry.access.redhat.com/ubi9/nginx-126 - -# Add application sources to a directory where the assemble script expects them -# and set permissions so that the container runs without root access -# With older docker that does not support --chown option for ADD statement, -# use these statements instead: -# USER 0 -# ADD app-src /tmp/src -# RUN chown -R 1001:0 /tmp/src -# USER 1001 -ADD --chown=1001:0 app-src /tmp/src - -# Let the assemble script to install the dependencies -RUN /usr/libexec/s2i/assemble - -# Run script uses standard ways to run the application -CMD /usr/libexec/s2i/run -``` - -#### 4. Build a new image from a Dockerfile prepared in the previous step -``` -podman build -t nginx-app . -``` - -#### 5. Run the resulting image with the final application -``` -podman run -d nginx-app -``` - - -Direct usage with a mounted directory -------------------------------------- -An example of the data on the host for the following example: -``` -$ ls -lZ /wwwdata/html --rw-r--r--. 1 1001 1001 54321 Jan 01 12:34 index.html --rw-r--r--. 1 1001 1001 5678 Jan 01 12:34 page.html -``` - -If you want to run the image directly and mount the static pages available in the `/wwwdata/` directory on the host -as a container volume, execute the following command: - -``` -$ podman run -d --name nginx -p 8080:8080 -v /wwwdata:/opt/app-root/src:Z ubi9/nginx-126 nginx -g "daemon off;" -``` - -This creates a container named `nginx` running the Nginx server, serving data from -the `/wwwdata/` directory. Port 8080 is exposed and mapped to the host. -You can pull the data from the nginx container using this command: - -``` -$ curl -Lk 127.0.0.1:8080 -``` - -You can replace `/wwwdata/` with location of your web root. Please note that this has to be an **absolute** path, due to podman requirements. - - -Environment variables and volumes ---------------------------------- -The nginx container image supports the following configuration variable, which can be set by using the `-e` option with the podman run command: - - -**`NGINX_LOG_TO_VOLUME`** - When `NGINX_LOG_TO_VOLUME` is set, nginx logs into `/var/log/nginx/`. - - -Troubleshooting ---------------- -By default, nginx access logs are written to standard output and error logs are written to standard error, so both are available in the container log. The log can be examined by running: - - podman logs - -See also --------- -Dockerfile and other sources for this container image are available on -https://github.com/sclorg/nginx-container. -In that repository you also can find another versions of Python environment Dockerfiles. -for RHEL8 it's `Dockerfile.rhel8`, Dockerfile for RHEL10 is called `Dockerfile.rhel10`, -Dockerfile for CentOS Stream 9 is called `Dockerfile.c9s`, -Dockerfile for CentOS Stream 10 is called `Dockerfile.c10s`, and the Fedora Dockerfile is called `Dockerfile.fedora`. - diff --git a/src/Dockerfile b/src/Dockerfile index 24c7cccb..23ce1a76 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -93,4 +93,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] diff --git a/src/Dockerfile.fedora b/src/Dockerfile.fedora index 8a34b923..e7e19c4e 100644 --- a/src/Dockerfile.fedora +++ b/src/Dockerfile.fedora @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD $STI_SCRIPTS_PATH/usage +CMD ["/usr/libexec/s2i/usage"] From 3a6fead4ea6215649f42adaf86ca1de4f4a32732 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Mon, 25 May 2026 13:14:38 +0200 Subject: [PATCH 08/13] Fix distgen templates to preserve original Dockerfile format --- 1.20/Dockerfile.c9s | 16 +-- 1.20/Dockerfile.fedora | 12 +-- 1.20/Dockerfile.rhel8 | 16 +-- 1.20/Dockerfile.rhel9 | 16 +-- 1.22-micro/Dockerfile.c9s | 16 +-- 1.22-micro/Dockerfile.fedora | 12 +-- 1.22-micro/Dockerfile.rhel8 | 16 +-- 1.22/Dockerfile.c9s | 16 +-- 1.22/Dockerfile.fedora | 12 +-- 1.22/Dockerfile.rhel8 | 16 +-- 1.22/Dockerfile.rhel9 | 16 +-- 1.24/Dockerfile.c9s | 16 +-- 1.24/Dockerfile.fedora | 12 +-- 1.24/Dockerfile.rhel8 | 16 +-- 1.24/Dockerfile.rhel9 | 16 +-- 1.26/Dockerfile.c10s | 14 +-- 1.26/Dockerfile.c9s | 16 +-- 1.26/Dockerfile.fedora | 12 +-- 1.26/Dockerfile.rhel10 | 14 +-- 1.26/Dockerfile.rhel8 | 16 +-- 1.26/Dockerfile.rhel9 | 16 +-- specs/multispec.yml | 42 ++++---- src/Dockerfile | 14 +-- src/Dockerfile.fedora | 12 +-- test/perl-test-app/index.html | 8 ++ test/perl-test-app/nginx-perl/Version.pm | 17 ++++ test/perl-test-app/nginx.conf | 99 +++++++++++++++++++ test/start-hook-test-app/index.html | 8 ++ test/start-hook-test-app/index2.html | 8 ++ .../nginx-cfg/default.conf | 8 ++ test/start-hook-test-app/nginx-start/init.sh | 19 ++++ test/test-app | 1 + 32 files changed, 358 insertions(+), 190 deletions(-) create mode 100644 test/perl-test-app/index.html create mode 100644 test/perl-test-app/nginx-perl/Version.pm create mode 100644 test/perl-test-app/nginx.conf create mode 100644 test/start-hook-test-app/index.html create mode 100644 test/start-hook-test-app/index2.html create mode 100644 test/start-hook-test-app/nginx-cfg/default.conf create mode 100755 test/start-hook-test-app/nginx-start/init.sh create mode 120000 test/test-app diff --git a/1.20/Dockerfile.c9s b/1.20/Dockerfile.c9s index 5b9e6389..2747b1d0 100644 --- a/1.20/Dockerfile.c9s +++ b/1.20/Dockerfile.c9s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx120" \ - com.redhat.component="nginx-120-container" \ - name="sclorg/nginx-120-c9s" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/nginx-120-c9s:latest " + usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.20 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.20 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.20/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.20/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/Dockerfile.fedora b/1.20/Dockerfile.fedora index 1c7d0aab..5ff20497 100644 --- a/1.20/Dockerfile.fedora +++ b/1.20/Dockerfile.fedora @@ -23,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx120" \ - com.redhat.component="nginx-120-container" \ - name="fedora/nginx-120" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="fedora/${NAME}-${NGINX_SHORT_VER}" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -47,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.20/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.20/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/Dockerfile.rhel8 b/1.20/Dockerfile.rhel8 index be2c0ab3..daa5b737 100644 --- a/1.20/Dockerfile.rhel8 +++ b/1.20/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx120" \ - com.redhat.component="nginx-120-container" \ - name="ubi8/nginx-120" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/nginx-120:latest " + usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.20 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.20 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.20/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.20/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/Dockerfile.rhel9 b/1.20/Dockerfile.rhel9 index 38278fbd..69b32099 100644 --- a/1.20/Dockerfile.rhel9 +++ b/1.20/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx120" \ - com.redhat.component="nginx-120-container" \ - name="ubi9/nginx-120" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/nginx-120:latest " + usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.20 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.20 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.20/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.20/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22-micro/Dockerfile.c9s b/1.22-micro/Dockerfile.c9s index 9022d693..199dfdc0 100644 --- a/1.22-micro/Dockerfile.c9s +++ b/1.22-micro/Dockerfile.c9s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx122" \ - com.redhat.component="nginx-122-container" \ - name="sclorg/nginx-122-c9s" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/nginx-122-c9s:latest " + usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.22 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.22 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22-micro/Dockerfile.fedora b/1.22-micro/Dockerfile.fedora index 22c5e853..c90355f9 100644 --- a/1.22-micro/Dockerfile.fedora +++ b/1.22-micro/Dockerfile.fedora @@ -23,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx122" \ - com.redhat.component="nginx-122-container" \ - name="fedora/nginx-122" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="fedora/${NAME}-${NGINX_SHORT_VER}" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -47,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22-micro/Dockerfile.rhel8 b/1.22-micro/Dockerfile.rhel8 index 266eef7b..f18304b6 100644 --- a/1.22-micro/Dockerfile.rhel8 +++ b/1.22-micro/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx122" \ - com.redhat.component="nginx-122-container" \ - name="ubi8/nginx-122" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/nginx-122:latest " + usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.22 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.22 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.c9s b/1.22/Dockerfile.c9s index 9022d693..199dfdc0 100644 --- a/1.22/Dockerfile.c9s +++ b/1.22/Dockerfile.c9s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx122" \ - com.redhat.component="nginx-122-container" \ - name="sclorg/nginx-122-c9s" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/nginx-122-c9s:latest " + usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.22 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.22 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.fedora b/1.22/Dockerfile.fedora index 22c5e853..c90355f9 100644 --- a/1.22/Dockerfile.fedora +++ b/1.22/Dockerfile.fedora @@ -23,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx122" \ - com.redhat.component="nginx-122-container" \ - name="fedora/nginx-122" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="fedora/${NAME}-${NGINX_SHORT_VER}" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -47,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.rhel8 b/1.22/Dockerfile.rhel8 index 266eef7b..f18304b6 100644 --- a/1.22/Dockerfile.rhel8 +++ b/1.22/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx122" \ - com.redhat.component="nginx-122-container" \ - name="ubi8/nginx-122" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/nginx-122:latest " + usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.22 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.22 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.rhel9 b/1.22/Dockerfile.rhel9 index 1003f98e..d88564b7 100644 --- a/1.22/Dockerfile.rhel9 +++ b/1.22/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx122" \ - com.redhat.component="nginx-122-container" \ - name="ubi9/nginx-122" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/nginx-122:latest " + usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.22 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.22 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.22/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.22/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.24/Dockerfile.c9s b/1.24/Dockerfile.c9s index 21bc1dc8..5d7ae752 100644 --- a/1.24/Dockerfile.c9s +++ b/1.24/Dockerfile.c9s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx124" \ - com.redhat.component="nginx-124-container" \ - name="sclorg/nginx-124-c9s" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/nginx-124-c9s:latest " + usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.24 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.24 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.24/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.24/Dockerfile.fedora b/1.24/Dockerfile.fedora index cb25ef30..e732ac73 100644 --- a/1.24/Dockerfile.fedora +++ b/1.24/Dockerfile.fedora @@ -23,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx124" \ - com.redhat.component="nginx-124-container" \ - name="fedora/nginx-124" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="fedora/${NAME}-${NGINX_SHORT_VER}" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -47,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.24/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.24/Dockerfile.rhel8 b/1.24/Dockerfile.rhel8 index b704eeaf..6e1fa88c 100644 --- a/1.24/Dockerfile.rhel8 +++ b/1.24/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx124" \ - com.redhat.component="nginx-124-container" \ - name="ubi8/nginx-124" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/nginx-124:latest " + usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.24 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.24 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.24/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.24/Dockerfile.rhel9 b/1.24/Dockerfile.rhel9 index 3fbaa83c..3ee212d1 100644 --- a/1.24/Dockerfile.rhel9 +++ b/1.24/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx124" \ - com.redhat.component="nginx-124-container" \ - name="ubi9/nginx-124" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/nginx-124:latest " + usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.24 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.24 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.24/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.24/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.26/Dockerfile.c10s b/1.26/Dockerfile.c10s index e260662c..d68d7d03 100644 --- a/1.26/Dockerfile.c10s +++ b/1.26/Dockerfile.c10s @@ -21,13 +21,13 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx126" \ - com.redhat.component="nginx-126-container" \ - name="sclorg/nginx-126-c10s" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/nginx-126-c10s:latest " + usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -44,10 +44,10 @@ RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx dnf -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.26/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -83,4 +83,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.26/Dockerfile.c9s b/1.26/Dockerfile.c9s index 6b91bd93..6c5c7ace 100644 --- a/1.26/Dockerfile.c9s +++ b/1.26/Dockerfile.c9s @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx126" \ - com.redhat.component="nginx-126-container" \ - name="sclorg/nginx-126-c9s" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/nginx-126-c9s:latest " + usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.26 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.26 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.26/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.26/Dockerfile.fedora b/1.26/Dockerfile.fedora index 109684dd..0bdbc2bb 100644 --- a/1.26/Dockerfile.fedora +++ b/1.26/Dockerfile.fedora @@ -23,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx126" \ - com.redhat.component="nginx-126-container" \ - name="fedora/nginx-126" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="fedora/${NAME}-${NGINX_SHORT_VER}" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -47,10 +47,10 @@ RUN dnf install -y gettext hostname && \ dnf clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.26/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.26/Dockerfile.rhel10 b/1.26/Dockerfile.rhel10 index cce371ec..a92d2c0c 100644 --- a/1.26/Dockerfile.rhel10 +++ b/1.26/Dockerfile.rhel10 @@ -21,13 +21,13 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx126" \ - com.redhat.component="nginx-126-container" \ - name="ubi10/nginx-126" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi10/${NAME}-${NGINX_SHORT_VER}" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi10/nginx-126:latest " + usage="s2i build ubi10/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -44,10 +44,10 @@ RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx dnf -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.26/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -83,4 +83,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.26/Dockerfile.rhel8 b/1.26/Dockerfile.rhel8 index 28cc1392..01faad62 100644 --- a/1.26/Dockerfile.rhel8 +++ b/1.26/Dockerfile.rhel8 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx126" \ - com.redhat.component="nginx-126-container" \ - name="ubi8/nginx-126" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/nginx-126:latest " + usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.26 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.26 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.26/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/1.26/Dockerfile.rhel9 b/1.26/Dockerfile.rhel9 index ee8c9799..dc075fb4 100644 --- a/1.26/Dockerfile.rhel9 +++ b/1.26/Dockerfile.rhel9 @@ -21,14 +21,14 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,nginx,nginx126" \ - com.redhat.component="nginx-126-container" \ - name="ubi9/nginx-126" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ version="1" \ com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/nginx-126:latest " + usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -38,7 +38,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl -RUN yum -y module enable nginx:1.26 && \ +RUN yum -y module enable nginx:$NGINX_VERSION && \ INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ @@ -46,10 +46,10 @@ RUN yum -y module enable nginx:1.26 && \ yum -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY 1.26/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY 1.26/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -85,4 +85,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/specs/multispec.yml b/specs/multispec.yml index 727ef403..46d8ad9d 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -8,9 +8,9 @@ specs: s2i_base: quay.io/fedora/s2i-core:37 org: "fedora" prod: "fedora" - openshift_tags: "builder,nginx,nginx{{ spec.short }}" - redhat_component: "nginx-{{ spec.short }}-container" - img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" + redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" + img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" pkg_manager: "dnf" environment_setup: "" @@ -21,9 +21,9 @@ specs: s2i_base: quay.io/fedora/s2i-core:38 org: "fedora" prod: "fedora" - openshift_tags: "builder,nginx,nginx{{ spec.short }}" - redhat_component: "nginx-{{ spec.short }}-container" - img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" + redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" + img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" pkg_manager: "dnf" environment_setup: "" @@ -34,9 +34,9 @@ specs: s2i_base: quay.io/fedora/s2i-core:40 org: "fedora" prod: "fedora" - openshift_tags: "builder,nginx,nginx{{ spec.short }}" - redhat_component: "nginx-{{ spec.short }}-container" - img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" + redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" + img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" pkg_manager: "dnf" environment_setup: "" @@ -47,13 +47,13 @@ specs: s2i_base: ubi8/s2i-core:1 org: "ubi8" prod: "rhel8" - openshift_tags: "builder,nginx,nginx{{ spec.short }}" - redhat_component: "nginx-{{ spec.short }}-container" - img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" + redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" + img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" pkgs: "nginx nginx-all-modules" pkg_manager: "yum" environment_setup: >-4 - yum -y module enable nginx:{{ spec.version }} && \ + yum -y module enable nginx:$NGINX_VERSION && \ license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" rhel9: @@ -62,13 +62,13 @@ specs: s2i_base: ubi9/s2i-core:1 org: "ubi9" prod: "rhel9" - openshift_tags: "builder,nginx,nginx{{ spec.short }}" - redhat_component: "nginx-{{ spec.short }}-container" - img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" + redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" + img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" pkgs: "nginx nginx-all-modules" pkg_manager: "yum" environment_setup: >-4 - yum -y module enable nginx:{{ spec.version }} && \ + yum -y module enable nginx:$NGINX_VERSION && \ license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" rhel10: @@ -77,9 +77,9 @@ specs: s2i_base: ubi10/s2i-core org: "ubi10" prod: "rhel10" - openshift_tags: "builder,nginx,nginx{{ spec.short }}" - redhat_component: "nginx-{{ spec.short }}-container" - img_name: "{{ spec.org }}/nginx-{{ spec.short }}" + openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" + redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" + img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" pkg_manager: "dnf" environment_setup: "" @@ -97,7 +97,7 @@ specs: pkgs: "nginx nginx-all-modules" pkg_manager: "yum" environment_setup: >-4 - yum -y module enable nginx:{{ spec.version }} && \ + yum -y module enable nginx:$NGINX_VERSION && \ license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" c10s: diff --git a/src/Dockerfile b/src/Dockerfile index 23ce1a76..444496b8 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -21,9 +21,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="{{ spec.openshift_tags }}" \ - com.redhat.component="{{ spec.redhat_component }}" \ - name="{{ spec.img_name }}" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" \ {% if spec.prod in ["rhel8", "rhel9", "c8s", "c9s"] %} version="1" \ {% endif %} @@ -32,7 +32,7 @@ LABEL summary="${SUMMARY}" \ {% endif %} maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build {{ spec.img_name }}:latest " + usage="s2i build {{ spec.org }}/${NAME}-${NGINX_SHORT_VER}:latest " ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -54,10 +54,10 @@ RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname {{ spec.pkgs }}" && \ {{ spec.pkg_manager }} -y clean all --enablerepo='*' # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY {{ spec.version }}/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY {{ spec.version }}/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -93,4 +93,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/src/Dockerfile.fedora b/src/Dockerfile.fedora index e7e19c4e..ba3b6427 100644 --- a/src/Dockerfile.fedora +++ b/src/Dockerfile.fedora @@ -23,9 +23,9 @@ LABEL summary="${SUMMARY}" \ io.k8s.display-name="Nginx ${NGINX_VERSION}" \ io.openshift.expose-services="8080:http" \ io.openshift.expose-services="8443:https" \ - io.openshift.tags="{{ spec.openshift_tags }}" \ - com.redhat.component="{{ spec.redhat_component }}" \ - name="{{ spec.img_name }}" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ help="For more information visit https://github.com/sclorg/${NAME}-container" \ @@ -47,10 +47,10 @@ RUN {{ spec.pkg_manager }} install -y gettext hostname && \ {{ spec.pkg_manager }} clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY {{ spec.version }}/s2i/bin/ $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY {{ spec.version }}/root/ / +COPY $NGINX_VERSION/root/ / # Changing ownership and user rights to support following use-cases: # 1) running container on OpenShift, whose default security model @@ -86,4 +86,4 @@ USER 1001 STOPSIGNAL SIGQUIT -CMD ["/usr/libexec/s2i/usage"] +CMD $STI_SCRIPTS_PATH/usage diff --git a/test/perl-test-app/index.html b/test/perl-test-app/index.html new file mode 100644 index 00000000..d1476274 --- /dev/null +++ b/test/perl-test-app/index.html @@ -0,0 +1,8 @@ + + + Test NGINX passed + + +

NGINX is working

+ + diff --git a/test/perl-test-app/nginx-perl/Version.pm b/test/perl-test-app/nginx-perl/Version.pm new file mode 100644 index 00000000..7e047895 --- /dev/null +++ b/test/perl-test-app/nginx-perl/Version.pm @@ -0,0 +1,17 @@ +package Version; + +use nginx; + +sub installed { + return "$^V"; +} + +sub handler { + my $r = shift; + $r->send_http_header("text/html"); + $r->print("Perl location handler is working"); + return OK; +} + +1; +__END__ diff --git a/test/perl-test-app/nginx.conf b/test/perl-test-app/nginx.conf new file mode 100644 index 00000000..c96bc69f --- /dev/null +++ b/test/perl-test-app/nginx.conf @@ -0,0 +1,99 @@ +# For more information on configuration, see: +# * Official English Documentation: http://nginx.org/en/docs/ +# * Official Russian Documentation: http://nginx.org/ru/docs/ + + +worker_processes auto; +error_log /var/log/nginx/error.log; +pid /run/nginx.pid; + +# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. +include /usr/share/nginx/modules/*.conf; + +events { + worker_connections 1024; +} + +http { + perl_modules /opt/app-root/etc/perl; + perl_require Version.pm; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + perl_set $perl_version Version::installed; + add_header X-Perl-Version $perl_version; + + # Load modular configuration files from the /etc/nginx/conf.d directory. + # See http://nginx.org/en/docs/ngx_core_module.html#include + # for more information. + include /opt/app-root/etc/nginx.d/*.conf; + + server { + listen 8080 default_server; + listen [::]:8080 default_server; + server_name _; + root /opt/app-root/src; + + # Load configuration files for the default server block. + include /opt/app-root/etc/nginx.default.d/*.conf; + + location / { + } + + location /perl { + perl Version::handler; + } + + error_page 404 /404.html; + location = /40x.html { + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + } + } + +# Settings for a TLS enabled server. +# +# server { +# listen 443 ssl http2 default_server; +# listen [::]:443 ssl http2 default_server; +# server_name _; +# root /opt/app-root/src; +# +# ssl_certificate "/etc/pki/nginx/server.crt"; +# ssl_certificate_key "/etc/pki/nginx/private/server.key"; +# ssl_session_cache shared:SSL:1m; +# ssl_session_timeout 10m; +# ssl_ciphers PROFILE=SYSTEM; +# ssl_prefer_server_ciphers on; +# +# # Load configuration files for the default server block. +# include /opt/app-root/etc/nginx.default.d/*.conf; +# +# location / { +# } +# +# error_page 404 /404.html; +# location = /40x.html { +# } +# +# error_page 500 502 503 504 /50x.html; +# location = /50x.html { +# } +# } + +} + diff --git a/test/start-hook-test-app/index.html b/test/start-hook-test-app/index.html new file mode 100644 index 00000000..d1476274 --- /dev/null +++ b/test/start-hook-test-app/index.html @@ -0,0 +1,8 @@ + + + Test NGINX passed + + +

NGINX is working

+ + diff --git a/test/start-hook-test-app/index2.html b/test/start-hook-test-app/index2.html new file mode 100644 index 00000000..e73a98c6 --- /dev/null +++ b/test/start-hook-test-app/index2.html @@ -0,0 +1,8 @@ + + + Test NGINX passed + + +

NGINX2 is working

+ + diff --git a/test/start-hook-test-app/nginx-cfg/default.conf b/test/start-hook-test-app/nginx-cfg/default.conf new file mode 100644 index 00000000..e947c98b --- /dev/null +++ b/test/start-hook-test-app/nginx-cfg/default.conf @@ -0,0 +1,8 @@ +server { + listen 8080; + server_name localhost2; + root /opt/app-root/src; + index ${INDEX_FILE}; + resolver ${DNS_SERVER}; + +} \ No newline at end of file diff --git a/test/start-hook-test-app/nginx-start/init.sh b/test/start-hook-test-app/nginx-start/init.sh new file mode 100755 index 00000000..132164e2 --- /dev/null +++ b/test/start-hook-test-app/nginx-start/init.sh @@ -0,0 +1,19 @@ +setup_dns_env_var() { + if [ -z "$DNS_SERVER" ]; then + export DNS_SERVER=`cat /etc/resolv.conf | grep "nameserver " | cut -d " " -f 2 | tr '\n' ' '` + echo "Using system dns server ${DNS_SERVER}" + else + echo "Using user defined dns server: ${DNS_SERVER}" + fi +} + +inject_env_vars() { + ## Replace only specified environment variables in specified file. + envsubst '${DNS_SERVER},${INDEX_FILE}' < ${NGINX_CONFIGURATION_PATH}/$1 > output.conf + cp output.conf ${NGINX_CONFIGURATION_PATH}/$1 + echo "This is $1: " && cat ${NGINX_CONFIGURATION_PATH}/$1 +} + +export INDEX_FILE=index2.html +setup_dns_env_var +inject_env_vars "default.conf" diff --git a/test/test-app b/test/test-app new file mode 120000 index 00000000..b2a51557 --- /dev/null +++ b/test/test-app @@ -0,0 +1 @@ +../examples/1.26/test-app \ No newline at end of file From 32088dbc4b227bc3ea6c91ea8e7f5eee7c4bd291 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Tue, 26 May 2026 15:38:55 +0200 Subject: [PATCH 09/13] Remove excluded combinations from multispec --- 1.20/Dockerfile.c9s | 88 ----------------------------------- 1.20/Dockerfile.fedora | 89 ------------------------------------ 1.22-micro/Dockerfile.fedora | 89 ------------------------------------ 1.22/Dockerfile.c9s | 88 ----------------------------------- 1.22/Dockerfile.fedora | 89 ------------------------------------ 1.24/Dockerfile.fedora | 89 ------------------------------------ 1.26/Dockerfile.rhel8 | 88 ----------------------------------- README.md | 10 ++-- specs/multispec.yml | 37 --------------- 9 files changed, 5 insertions(+), 662 deletions(-) delete mode 100644 1.20/Dockerfile.c9s delete mode 100644 1.20/Dockerfile.fedora delete mode 100644 1.22-micro/Dockerfile.fedora delete mode 100644 1.22/Dockerfile.c9s delete mode 100644 1.22/Dockerfile.fedora delete mode 100644 1.24/Dockerfile.fedora delete mode 100644 1.26/Dockerfile.rhel8 diff --git a/1.20/Dockerfile.c9s b/1.20/Dockerfile.c9s deleted file mode 100644 index 2747b1d0..00000000 --- a/1.20/Dockerfile.c9s +++ /dev/null @@ -1,88 +0,0 @@ -FROM quay.io/sclorg/s2i-core-c9s:c9s - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.20 \ - NGINX_SHORT_VER=120 \ - VERSION=0 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ - version="1" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/1.20/Dockerfile.fedora b/1.20/Dockerfile.fedora deleted file mode 100644 index 5ff20497..00000000 --- a/1.20/Dockerfile.fedora +++ /dev/null @@ -1,89 +0,0 @@ -FROM quay.io/fedora/s2i-core:37 - - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.20 \ - NGINX_SHORT_VER=120 \ - VERSION=0 \ - ARCH=x86_64 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ - version="${VERSION}" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ${FGC}/nginx " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN dnf install -y gettext hostname && \ - INSTALL_PKGS="nss_wrapper-libs nginx nginx-mod-stream nginx-mod-http-perl" && \ - dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - dnf clean all - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22-micro/Dockerfile.fedora b/1.22-micro/Dockerfile.fedora deleted file mode 100644 index c90355f9..00000000 --- a/1.22-micro/Dockerfile.fedora +++ /dev/null @@ -1,89 +0,0 @@ -FROM quay.io/fedora/s2i-core:37 - - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.22 \ - NGINX_SHORT_VER=122 \ - VERSION=0 \ - ARCH=x86_64 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ - version="${VERSION}" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ${FGC}/nginx " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN dnf install -y gettext hostname && \ - INSTALL_PKGS="nss_wrapper-libs nginx nginx-mod-stream nginx-mod-http-perl" && \ - dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - dnf clean all - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.c9s b/1.22/Dockerfile.c9s deleted file mode 100644 index 199dfdc0..00000000 --- a/1.22/Dockerfile.c9s +++ /dev/null @@ -1,88 +0,0 @@ -FROM quay.io/sclorg/s2i-core-c9s:c9s - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.22 \ - NGINX_SHORT_VER=122 \ - VERSION=0 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="sclorg/${NAME}-${NGINX_SHORT_VER}" \ - version="1" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build sclorg/${NAME}-${NGINX_SHORT_VER}:latest " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/1.22/Dockerfile.fedora b/1.22/Dockerfile.fedora deleted file mode 100644 index c90355f9..00000000 --- a/1.22/Dockerfile.fedora +++ /dev/null @@ -1,89 +0,0 @@ -FROM quay.io/fedora/s2i-core:37 - - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.22 \ - NGINX_SHORT_VER=122 \ - VERSION=0 \ - ARCH=x86_64 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ - version="${VERSION}" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ${FGC}/nginx " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN dnf install -y gettext hostname && \ - INSTALL_PKGS="nss_wrapper-libs nginx nginx-mod-stream nginx-mod-http-perl" && \ - dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - dnf clean all - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/1.24/Dockerfile.fedora b/1.24/Dockerfile.fedora deleted file mode 100644 index e732ac73..00000000 --- a/1.24/Dockerfile.fedora +++ /dev/null @@ -1,89 +0,0 @@ -FROM quay.io/fedora/s2i-core:38 - - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.24 \ - NGINX_SHORT_VER=124 \ - VERSION=0 \ - ARCH=x86_64 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="fedora/${NAME}-${NGINX_SHORT_VER}" \ - version="${VERSION}" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ${FGC}/nginx " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN dnf install -y gettext hostname && \ - INSTALL_PKGS="nss_wrapper-libs nginx nginx-mod-stream nginx-mod-http-perl" && \ - dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - dnf clean all - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/1.26/Dockerfile.rhel8 b/1.26/Dockerfile.rhel8 deleted file mode 100644 index 01faad62..00000000 --- a/1.26/Dockerfile.rhel8 +++ /dev/null @@ -1,88 +0,0 @@ -FROM ubi8/s2i-core:1 - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.26 \ - NGINX_SHORT_VER=126 \ - VERSION=0 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi8/${NAME}-${NGINX_SHORT_VER}" \ - version="1" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi8/${NAME}-${NGINX_SHORT_VER}:latest " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/README.md b/README.md index 57aee56f..96686977 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ Table start --> ||CentOS Stream 9|CentOS Stream 10|Fedora|RHEL 8|RHEL 9|RHEL 10| |:--|:--:|:--:|:--:|:--:|:--:|:--:| -|1.20|
`quay.io/sclorg/nginx-120-c9s`
||
`quay.io/fedora/nginx-120`
|
`registry.redhat.io/rhel8/nginx-120`
|
`registry.redhat.io/rhel9/nginx-120`
|| -|1.22|
`quay.io/sclorg/nginx-122-c9s`
||
`quay.io/fedora/nginx-122`
|
`registry.redhat.io/rhel8/nginx-122`
|
`registry.redhat.io/rhel9/nginx-122`
|| -|1.22-micro|
`quay.io/sclorg/nginx-122-micro-c9s`
||
`quay.io/fedora/nginx-122-micro`
|
`registry.redhat.io/rhel8/nginx-122-micro`
||| -|1.24|
`quay.io/sclorg/nginx-124-c9s`
||
`quay.io/fedora/nginx-124`
|
`registry.redhat.io/rhel8/nginx-124`
|
`registry.redhat.io/rhel9/nginx-124`
|| -|1.26|
`quay.io/sclorg/nginx-126-c9s`
|
`quay.io/sclorg/nginx-126-c10s`
|
`quay.io/fedora/nginx-126`
|
`registry.redhat.io/rhel8/nginx-126`
|
`registry.redhat.io/rhel9/nginx-126`
|
`registry.redhat.io/rhel10/nginx-126`
| +|1.20||||
`registry.redhat.io/rhel8/nginx-120`
|
`registry.redhat.io/rhel9/nginx-120`
|| +|1.22||||
`registry.redhat.io/rhel8/nginx-122`
|
`registry.redhat.io/rhel9/nginx-122`
|| +|1.22-micro|
`quay.io/sclorg/nginx-122-micro-c9s`
|||
`registry.redhat.io/rhel8/nginx-122-micro`
||| +|1.24|
`quay.io/sclorg/nginx-124-c9s`
|||
`registry.redhat.io/rhel8/nginx-124`
|
`registry.redhat.io/rhel9/nginx-124`
|| +|1.26|
`quay.io/sclorg/nginx-126-c9s`
|
`quay.io/sclorg/nginx-126-c10s`
|
`quay.io/fedora/nginx-126`
||
`registry.redhat.io/rhel9/nginx-126`
|
`registry.redhat.io/rhel10/nginx-126`
| diff --git a/specs/multispec.yml b/specs/multispec.yml index 46d8ad9d..9bebd44c 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -2,32 +2,6 @@ version: 1 specs: distroinfo: - fedora37: - distros: - - fedora-37-x86_64 - s2i_base: quay.io/fedora/s2i-core:37 - org: "fedora" - prod: "fedora" - openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" - redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" - img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" - pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" - pkg_manager: "dnf" - environment_setup: "" - - fedora38: - distros: - - fedora-38-x86_64 - s2i_base: quay.io/fedora/s2i-core:38 - org: "fedora" - prod: "fedora" - openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" - redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" - img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" - pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" - pkg_manager: "dnf" - environment_setup: "" - fedora40: distros: - fedora-40-x86_64 @@ -120,28 +94,24 @@ specs: short: "120" common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" - latest_fedora: "f37" "1.22": version: "1.22" short: "122" common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" - latest_fedora: "f37" "1.22-micro": version: "1.22" short: "122" suffix: "-micro" common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-micro-{{ spec.prod }}" - latest_fedora: "f37" "1.24": version: "1.24" short: "124" common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" - latest_fedora: "f38" "1.26": version: "1.26" @@ -154,27 +124,21 @@ matrix: include: - version: "1.20" distros: - - fedora-37-x86_64 - rhel-8-x86_64 - rhel-9-x86_64 - - centos-stream-9-x86_64 - version: "1.22" distros: - - fedora-37-x86_64 - rhel-8-x86_64 - rhel-9-x86_64 - - centos-stream-9-x86_64 - version: "1.22-micro" distros: - - fedora-37-x86_64 - rhel-8-x86_64 - centos-stream-9-x86_64 - version: "1.24" distros: - - fedora-38-x86_64 - rhel-8-x86_64 - rhel-9-x86_64 - centos-stream-9-x86_64 @@ -182,7 +146,6 @@ matrix: - version: "1.26" distros: - fedora-40-x86_64 - - rhel-8-x86_64 - rhel-9-x86_64 - rhel-10-x86_64 - centos-stream-9-x86_64 From cd4e2985fe2429d87ba0c22aff5604eda2442208 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Wed, 27 May 2026 10:31:06 +0200 Subject: [PATCH 10/13] Remove version 1.20 for RHEL9 --- 1.20/Dockerfile.rhel9 | 88 ------------------------------------------- README.md | 2 +- specs/multispec.yml | 1 - 3 files changed, 1 insertion(+), 90 deletions(-) delete mode 100644 1.20/Dockerfile.rhel9 diff --git a/1.20/Dockerfile.rhel9 b/1.20/Dockerfile.rhel9 deleted file mode 100644 index 69b32099..00000000 --- a/1.20/Dockerfile.rhel9 +++ /dev/null @@ -1,88 +0,0 @@ -FROM ubi9/s2i-core:1 - -EXPOSE 8080 -EXPOSE 8443 - -ENV NAME=nginx \ - NGINX_VERSION=1.20 \ - NGINX_SHORT_VER=120 \ - VERSION=0 - -ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ - DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ -protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ -image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ -as a base image for other applications based on nginx $NGINX_VERSION web server. \ -Nginx server image can be extended using source-to-image tool." - -LABEL summary="${SUMMARY}" \ - description="${DESCRIPTION}" \ - io.k8s.description="${DESCRIPTION}" \ - io.k8s.display-name="Nginx ${NGINX_VERSION}" \ - io.openshift.expose-services="8080:http" \ - io.openshift.expose-services="8443:https" \ - io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ - com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ - name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ - version="1" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ - maintainer="SoftwareCollections.org " \ - help="For more information visit https://github.com/sclorg/${NAME}-container" \ - usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " - -ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ - NGINX_CONF_PATH=/etc/nginx/nginx.conf \ - NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ - NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ - NGINX_APP_ROOT=${APP_ROOT} \ - NGINX_LOG_PATH=/var/log/nginx \ - NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl - -RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ - yum -y clean all --enablerepo='*' - -# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH - -# Copy extra files to the image. -COPY $NGINX_VERSION/root/ / - -# Changing ownership and user rights to support following use-cases: -# 1) running container on OpenShift, whose default security model -# is to run the container under random UID, but GID=0 -# 2) for working root-less container with UID=1001, which does not have -# to have GID=0 -# 3) for default use-case, that is running container directly on operating system, -# with default UID and GID (1001:0) -# Supported combinations of UID:GID are thus following: -# UID=1001 && GID=0 -# UID=&& GID=0 -# UID=1001 && GID= -RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ - mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ - mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - mkdir -p ${NGINX_LOG_PATH} && \ - mkdir -p ${NGINX_PERL_MODULE_PATH} && \ - chown -R 1001:0 ${NGINX_CONF_PATH} && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ - chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ - chmod ug+rw ${NGINX_CONF_PATH} && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ - chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ - chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ - chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ - rpm-file-permissions - -USER 1001 - -STOPSIGNAL SIGQUIT - -CMD $STI_SCRIPTS_PATH/usage diff --git a/README.md b/README.md index 96686977..61d00af5 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Table start --> ||CentOS Stream 9|CentOS Stream 10|Fedora|RHEL 8|RHEL 9|RHEL 10| |:--|:--:|:--:|:--:|:--:|:--:|:--:| -|1.20||||
`registry.redhat.io/rhel8/nginx-120`
|
`registry.redhat.io/rhel9/nginx-120`
|| +|1.20||||
`registry.redhat.io/rhel8/nginx-120`
||| |1.22||||
`registry.redhat.io/rhel8/nginx-122`
|
`registry.redhat.io/rhel9/nginx-122`
|| |1.22-micro|
`quay.io/sclorg/nginx-122-micro-c9s`
|||
`registry.redhat.io/rhel8/nginx-122-micro`
||| |1.24|
`quay.io/sclorg/nginx-124-c9s`
|||
`registry.redhat.io/rhel8/nginx-124`
|
`registry.redhat.io/rhel9/nginx-124`
|| diff --git a/specs/multispec.yml b/specs/multispec.yml index 9bebd44c..fe0053df 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -125,7 +125,6 @@ matrix: - version: "1.20" distros: - rhel-8-x86_64 - - rhel-9-x86_64 - version: "1.22" distros: From cbd4648f092f74c086cd4804fef9d5ec0414c1a7 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Wed, 27 May 2026 10:59:59 +0200 Subject: [PATCH 11/13] Change packages for rhel8 --- 1.20/Dockerfile.rhel8 | 2 +- 1.22/Dockerfile.rhel8 | 2 +- 1.24/Dockerfile.rhel8 | 2 +- specs/multispec.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/1.20/Dockerfile.rhel8 b/1.20/Dockerfile.rhel8 index daa5b737..eae963e2 100644 --- a/1.20/Dockerfile.rhel8 +++ b/1.20/Dockerfile.rhel8 @@ -39,7 +39,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ diff --git a/1.22/Dockerfile.rhel8 b/1.22/Dockerfile.rhel8 index f18304b6..5b0bc184 100644 --- a/1.22/Dockerfile.rhel8 +++ b/1.22/Dockerfile.rhel8 @@ -39,7 +39,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ diff --git a/1.24/Dockerfile.rhel8 b/1.24/Dockerfile.rhel8 index 6e1fa88c..1640c9fe 100644 --- a/1.24/Dockerfile.rhel8 +++ b/1.24/Dockerfile.rhel8 @@ -39,7 +39,7 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl RUN yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ + INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ diff --git a/specs/multispec.yml b/specs/multispec.yml index fe0053df..52a4c044 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -24,7 +24,7 @@ specs: openshift_tags: "builder,${NAME},${NAME}-${NGINX_SHORT_VER}" redhat_component: "${NAME}-${NGINX_SHORT_VER}-container" img_name: "{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" - pkgs: "nginx nginx-all-modules" + pkgs: "nginx nginx-mod-stream nginx-mod-http-perl" pkg_manager: "yum" environment_setup: >-4 yum -y module enable nginx:$NGINX_VERSION && \ From f7f2bde13a008865b3cd41a54d22e5adbbb0202c Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Fri, 29 May 2026 12:37:13 +0200 Subject: [PATCH 12/13] add distgen check to github workflow --- .github/workflows/container-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/container-tests.yml b/.github/workflows/container-tests.yml index 7be3ffb9..cdc94c13 100644 --- a/.github/workflows/container-tests.yml +++ b/.github/workflows/container-tests.yml @@ -4,6 +4,8 @@ on: - created jobs: + distgen-check: + uses: "sclorg/ci-actions/.github/workflows/distgen-check.yml@main" check-readme: uses: "sclorg/ci-actions/.github/workflows/check-readme.yml@main" container-tests: From 0eb40cf32dfabe73270c84ffd337601cf92bfea8 Mon Sep 17 00:00:00 2001 From: Nikola Davidova Date: Fri, 29 May 2026 12:49:46 +0200 Subject: [PATCH 13/13] resolve rhel 9 1.20 combination --- 1.20/Dockerfile.rhel9 | 87 +++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- specs/multispec.yml | 8 ++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 1.20/Dockerfile.rhel9 diff --git a/1.20/Dockerfile.rhel9 b/1.20/Dockerfile.rhel9 new file mode 100644 index 00000000..f15c5296 --- /dev/null +++ b/1.20/Dockerfile.rhel9 @@ -0,0 +1,87 @@ +FROM ubi9/s2i-core:1 + +EXPOSE 8080 +EXPOSE 8443 + +ENV NAME=nginx \ + NGINX_VERSION=1.20 \ + NGINX_SHORT_VER=120 \ + VERSION=0 + +ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ + DESCRIPTION="Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP \ +protocols, with a strong focus on high concurrency, performance and low memory usage. The container \ +image provides a containerized packaging of the nginx $NGINX_VERSION daemon. The image can be used \ +as a base image for other applications based on nginx $NGINX_VERSION web server. \ +Nginx server image can be extended using source-to-image tool." + +LABEL summary="${SUMMARY}" \ + description="${DESCRIPTION}" \ + io.k8s.description="${DESCRIPTION}" \ + io.k8s.display-name="Nginx ${NGINX_VERSION}" \ + io.openshift.expose-services="8080:http" \ + io.openshift.expose-services="8443:https" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="ubi9/${NAME}-${NGINX_SHORT_VER}" \ + version="1" \ + com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ + maintainer="SoftwareCollections.org " \ + help="For more information visit https://github.com/sclorg/${NAME}-container" \ + usage="s2i build ubi9/${NAME}-${NGINX_SHORT_VER}:latest " + +ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ + NGINX_CONF_PATH=/etc/nginx/nginx.conf \ + NGINX_DEFAULT_CONF_PATH=${APP_ROOT}/etc/nginx.default.d \ + NGINX_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/nginx \ + NGINX_APP_ROOT=${APP_ROOT} \ + NGINX_LOG_PATH=/var/log/nginx \ + NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl + +RUN INSTALL_PKGS="nss_wrapper-libs gettext hostname nginx nginx-all-modules" && \ + yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + rpm -V $INSTALL_PKGS && \ + nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \ + yum -y clean all --enablerepo='*' + +# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH +COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH + +# Copy extra files to the image. +COPY $NGINX_VERSION/root/ / + +# Changing ownership and user rights to support following use-cases: +# 1) running container on OpenShift, whose default security model +# is to run the container under random UID, but GID=0 +# 2) for working root-less container with UID=1001, which does not have +# to have GID=0 +# 3) for default use-case, that is running container directly on operating system, +# with default UID and GID (1001:0) +# Supported combinations of UID:GID are thus following: +# UID=1001 && GID=0 +# UID=&& GID=0 +# UID=1001 && GID= +RUN sed -i -f ${NGINX_APP_ROOT}/nginxconf.sed ${NGINX_CONF_PATH} && \ + mkdir -p ${NGINX_APP_ROOT}/etc/nginx.d/ && \ + mkdir -p ${NGINX_APP_ROOT}/etc/nginx.default.d/ && \ + mkdir -p ${NGINX_APP_ROOT}/src/nginx-start/ && \ + mkdir -p ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + mkdir -p ${NGINX_LOG_PATH} && \ + mkdir -p ${NGINX_PERL_MODULE_PATH} && \ + chown -R 1001:0 ${NGINX_CONF_PATH} && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/etc && \ + chown -R 1001:0 ${NGINX_APP_ROOT}/src/nginx-start/ && \ + chown -R 1001:0 ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \ + chmod ug+rw ${NGINX_CONF_PATH} && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/etc && \ + chmod -R ug+rwX ${NGINX_APP_ROOT}/src/nginx-start/ && \ + chmod -R ug+rwX ${NGINX_CONTAINER_SCRIPTS_PATH}/nginx-start && \ + chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run && \ + rpm-file-permissions + +USER 1001 + +STOPSIGNAL SIGQUIT + +CMD $STI_SCRIPTS_PATH/usage diff --git a/README.md b/README.md index 61d00af5..96686977 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Table start --> ||CentOS Stream 9|CentOS Stream 10|Fedora|RHEL 8|RHEL 9|RHEL 10| |:--|:--:|:--:|:--:|:--:|:--:|:--:| -|1.20||||
`registry.redhat.io/rhel8/nginx-120`
||| +|1.20||||
`registry.redhat.io/rhel8/nginx-120`
|
`registry.redhat.io/rhel9/nginx-120`
|| |1.22||||
`registry.redhat.io/rhel8/nginx-122`
|
`registry.redhat.io/rhel9/nginx-122`
|| |1.22-micro|
`quay.io/sclorg/nginx-122-micro-c9s`
|||
`registry.redhat.io/rhel8/nginx-122-micro`
||| |1.24|
`quay.io/sclorg/nginx-124-c9s`
|||
`registry.redhat.io/rhel8/nginx-124`
|
`registry.redhat.io/rhel9/nginx-124`
|| diff --git a/specs/multispec.yml b/specs/multispec.yml index 52a4c044..41b8a4e5 100644 --- a/specs/multispec.yml +++ b/specs/multispec.yml @@ -125,6 +125,7 @@ matrix: - version: "1.20" distros: - rhel-8-x86_64 + - rhel-9-x86_64 - version: "1.22" distros: @@ -149,3 +150,10 @@ matrix: - rhel-10-x86_64 - centos-stream-9-x86_64 - centos-stream-10-x86_64 + + combination_extras: + - version: "1.20" + distros: + - rhel-9-x86_64 + data: + environment_setup: ""