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: 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 deleted file mode 100644 index 7295ee5f..00000000 --- a/1.20/Dockerfile.c9s +++ /dev/null @@ -1,94 +0,0 @@ -FROM quay.io/sclorg/s2i-base-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}-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 " - -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 - -# 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" && \ - 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.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 -# 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 - -# 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 deleted file mode 100644 index 4a5bce64..00000000 --- a/1.20/Dockerfile.fedora +++ /dev/null @@ -1,99 +0,0 @@ -FROM quay.io/fedora/s2i-core:37 - -# nginx 1.20 image. -# -# Volumes: -# * /var/log/nginx/ - Storage for logs - -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}" \ - 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 && \ - yum -y module enable nginx:$NGINX_VERSION && \ - INSTALL_PKGS="nss_wrapper 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 - -# 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..eae963e2 100644 --- a/1.20/Dockerfile.rhel8 +++ b/1.20/Dockerfile.rhel8 @@ -39,18 +39,17 @@ 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 gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ + 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" && \ 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 @@ -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..f15c5296 100644 --- a/1.20/Dockerfile.rhel9 +++ b/1.20/Dockerfile.rhel9 @@ -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 INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-all-modules" && \ +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" && \ @@ -84,9 +84,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/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/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..a7eab96d 100644 --- a/1.22-micro/Dockerfile.c9s +++ b/1.22-micro/Dockerfile.c9s @@ -43,12 +43,12 @@ LABEL summary="${SUMMARY}" \ 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" \ + name="sclorg/${NAME}-${NGINX_SHORT_VER}-micro" \ 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/${NAME}-${NGINX_SHORT_VER}-micro:latest " COPY --from=build /mnt/rootfs/ / 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 index c28fe81b..9495ee6a 120000 --- a/1.22-micro/core-scripts +++ b/1.22-micro/core-scripts @@ -1 +1 @@ -../common/shared-scripts/core/ \ No newline at end of file +../common/shared-scripts/core \ No newline at end of file diff --git a/1.22-micro/root b/1.22-micro/root index 0fd29717..8f0efefb 120000 --- a/1.22-micro/root +++ b/1.22-micro/root @@ -1 +1 @@ -../1.22/root/ \ No newline at end of file +../1.22/root \ No newline at end of file diff --git a/1.22-micro/s2i b/1.22-micro/s2i index f1990500..09155fd2 120000 --- a/1.22-micro/s2i +++ b/1.22-micro/s2i @@ -1 +1 @@ -../1.22/s2i/ \ No newline at end of file +../1.22/s2i \ No newline at end of file diff --git a/1.22-micro/test b/1.22-micro/test index 5fe54e73..419df4f9 120000 --- a/1.22-micro/test +++ b/1.22-micro/test @@ -1 +1 @@ -../1.22/test/ \ No newline at end of file +../test \ No newline at end of file diff --git a/1.22/.exclude-c9s b/1.22/.exclude-c9s deleted file mode 100644 index e69de29b..00000000 diff --git a/1.22/.exclude-fedora b/1.22/.exclude-fedora deleted file mode 100644 index e69de29b..00000000 diff --git a/1.22/Dockerfile.c9s b/1.22/Dockerfile.c9s deleted file mode 100644 index b2c59803..00000000 --- a/1.22/Dockerfile.c9s +++ /dev/null @@ -1,94 +0,0 @@ -FROM quay.io/sclorg/s2i-base-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}-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 " - -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 - -# 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" && \ - 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 - -# 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 deleted file mode 100644 index c582e9e8..00000000 --- a/1.22/Dockerfile.fedora +++ /dev/null @@ -1,98 +0,0 @@ -FROM quay.io/fedora/s2i-core:37 - -# nginx 1.22 image. -# -# Volumes: -# * /var/log/nginx/ - Storage for logs - -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}" \ - 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 - -# 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..5b0bc184 100644 --- a/1.22/Dockerfile.rhel8 +++ b/1.22/Dockerfile.rhel8 @@ -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 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,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..d88564b7 100644 --- a/1.22/Dockerfile.rhel9 +++ b/1.22/Dockerfile.rhel9 @@ -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.c9s b/1.24/Dockerfile.c9s index 6add3832..5d7ae752 100644 --- a/1.24/Dockerfile.c9s +++ b/1.24/Dockerfile.c9s @@ -23,12 +23,12 @@ LABEL summary="${SUMMARY}" \ 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" \ + 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 quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-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,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 && \ - INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \ + 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.rhel8 b/1.24/Dockerfile.rhel8 index e62d8794..1640c9fe 100644 --- a/1.24/Dockerfile.rhel8 +++ b/1.24/Dockerfile.rhel8 @@ -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 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 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..d68d7d03 100644 --- a/1.26/Dockerfile.c10s +++ b/1.26/Dockerfile.c10s @@ -23,12 +23,11 @@ LABEL summary="${SUMMARY}" \ 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" \ + 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 quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-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 \ @@ -38,7 +37,6 @@ 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" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ diff --git a/1.26/Dockerfile.c9s b/1.26/Dockerfile.c9s index d6c9e8e5..6c5c7ace 100644 --- a/1.26/Dockerfile.c9s +++ b/1.26/Dockerfile.c9s @@ -23,12 +23,12 @@ LABEL summary="${SUMMARY}" \ 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" \ + 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 quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-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,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 && \ - INSTALL_PKGS="nss_wrapper gettext hostname nginx nginx-all-modules" && \ + 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.26/Dockerfile.fedora b/1.26/Dockerfile.fedora index cacfe28a..0bdbc2bb 100644 --- a/1.26/Dockerfile.fedora +++ b/1.26/Dockerfile.fedora @@ -24,7 +24,7 @@ LABEL summary="${SUMMARY}" \ 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}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ name="fedora/${NAME}-${NGINX_SHORT_VER}" \ version="${VERSION}" \ maintainer="SoftwareCollections.org " \ diff --git a/1.26/Dockerfile.rhel10 b/1.26/Dockerfile.rhel10 index c50685b1..a92d2c0c 100644 --- a/1.26/Dockerfile.rhel10 +++ b/1.26/Dockerfile.rhel10 @@ -23,11 +23,11 @@ LABEL summary="${SUMMARY}" \ 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}" \ + 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-${NGINX_SHORT_VER} " + 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 \ @@ -37,7 +37,6 @@ 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" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ diff --git a/1.26/Dockerfile.rhel8 b/1.26/Dockerfile.rhel8 deleted file mode 100644 index c7de9429..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-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" && \ - 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/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 diff --git a/Makefile b/Makefile index f8e8c69d..0674d588 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,19 @@ DOCKER_BUILD_CONTEXT = .. .PHONY: $(shell test -f common/common.mk || echo >&2 'Please do "git submodule update --init" first.') include common/common.mk + +generate: + for version in ${VERSIONS} ; do \ + if [[ "$$version" == *-micro ]]; then \ + $(generator) -v $$version -m manifest-micro.yml -s specs/multispec.yml ; \ + elif [[ "$$version" == *-minimal ]]; then \ + $(generator) -v $$version -m manifest-minimal.yml -s specs/multispec.yml ; \ + else \ + $(generator) -v $$version -m manifest.yml -s specs/multispec.yml ; \ + fi \ + done + +# use clean-versions provided by common.mk +clean-hook: clean-versions + +script_env += NOT_RELEASED_VERSIONS="$(NOT_RELEASED_VERSIONS)" diff --git a/README.md b/README.md index c4e37e71..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/rhel9/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`
|| @@ -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 ----- diff --git a/manifest-micro.yml b/manifest-micro.yml new file mode 100644 index 00000000..dc50d24d --- /dev/null +++ b/manifest-micro.yml @@ -0,0 +1,36 @@ +# Manifest for micro 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.micro + dest: Dockerfile.rhel8 + + - src: src/Dockerfile.micro + dest: Dockerfile.c9s + + +# Symbolic links +# This section is the last one on purpose because the generator.py +# does not allow dead symlinks. +SYMLINK_RULES: + - src: ../1.22/root + dest: root + check_symlink: false + + - src: ../1.22/s2i + dest: s2i + check_symlink: false + + - src: ../common/shared-scripts/core + dest: core-scripts + check_symlink: false + + - src: ../test + dest: test diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 00000000..7911c0c4 --- /dev/null +++ b/manifest.yml @@ -0,0 +1,67 @@ +# 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.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..99e2d8d7 --- /dev/null +++ b/specs/multispec.yml @@ -0,0 +1,171 @@ +version: 1 + +specs: + distroinfo: + fedora40: + distros: + - fedora-40-x86_64 + s2i_base: quay.io/fedora/s2i-core:40 + 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: "" + + rhel8: + distros: + - rhel-8-x86_64 + s2i_base: ubi8/s2i-core:1 + org: "ubi8" + prod: "rhel8" + 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: "yum" + environment_setup: >-4 + yum -y module enable nginx:$NGINX_VERSION && \ + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + micro_build_base: "ubi8/ubi" + micro_releasever: "8" + micro_pkgs: "@nginx:{{ spec.version }}/common findutils hostname nss_wrapper-libs gettext" + micro_platform: "el8" + + rhel9: + distros: + - rhel-9-x86_64 + s2i_base: ubi9/s2i-core:1 + org: "ubi9" + prod: "rhel9" + 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:$NGINX_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,${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: "" + 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:$NGINX_VERSION && \ + license_terms: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" + micro_build_base: "quay.io/centos/centos:stream9" + micro_releasever: "9" + micro_pkgs: "nginx-core findutils hostname nss_wrapper-libs gettext" + micro_platform: "el9" + + 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" + suffix: "" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" + + "1.22": + version: "1.22" + short: "122" + suffix: "" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" + + "1.22-micro": + version: "1.22" + short: "122" + suffix: "-micro" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-micro-{{ spec.prod }}" + + "1.24": + version: "1.24" + short: "124" + suffix: "" + common_image_name: "{{ spec.org }}/nginx-{{ spec.short }}-{{ spec.prod }}" + rhel_image_name: "{{ spec.org }}/nginx-{{ spec.short }}" + + "1.26": + version: "1.26" + short: "126" + suffix: "" + 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: + - rhel-8-x86_64 + - rhel-9-x86_64 + + - version: "1.22" + distros: + - rhel-8-x86_64 + - rhel-9-x86_64 + + - version: "1.22-micro" + distros: + - rhel-8-x86_64 + - centos-stream-9-x86_64 + + - version: "1.24" + distros: + - rhel-8-x86_64 + - rhel-9-x86_64 + - centos-stream-9-x86_64 + + - version: "1.26" + distros: + - fedora-40-x86_64 + - rhel-9-x86_64 + - 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: "" diff --git a/1.24/Dockerfile.c8s b/src/Dockerfile similarity index 80% rename from 1.24/Dockerfile.c8s rename to src/Dockerfile index d69ccd72..444496b8 100644 --- a/1.24/Dockerfile.c8s +++ b/src/Dockerfile @@ -1,11 +1,11 @@ -FROM quay.io/sclorg/s2i-core-c8s:c8s +FROM {{ spec.s2i_base }} EXPOSE 8080 EXPOSE 8443 ENV NAME=nginx \ - NGINX_VERSION=1.24 \ - NGINX_SHORT_VER=124 \ + NGINX_VERSION={{ spec.version }} \ + NGINX_SHORT_VER={{ spec.short }} \ VERSION=0 ENV SUMMARY="Platform for running nginx $NGINX_VERSION or building nginx-based application" \ @@ -23,12 +23,16 @@ LABEL summary="${SUMMARY}" \ 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" \ + name="{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}" \ +{% if spec.prod in ["rhel8", "rhel9", "c8s", "c9s"] %} version="1" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \ +{% 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 quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c8s: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 \ @@ -38,12 +42,16 @@ 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" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ +{% 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" && \ - yum -y clean all --enablerepo='*' + {{ spec.pkg_manager }} -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 diff --git a/1.24/Dockerfile.fedora b/src/Dockerfile.fedora similarity index 86% rename from 1.24/Dockerfile.fedora rename to src/Dockerfile.fedora index 4a34d65b..ba3b6427 100644 --- a/1.24/Dockerfile.fedora +++ b/src/Dockerfile.fedora @@ -1,16 +1,12 @@ -FROM quay.io/fedora/s2i-core:38 +FROM {{ spec.s2i_base }} -# nginx 1.24 image. -# -# Volumes: -# * /var/log/nginx/ - Storage for logs EXPOSE 8080 EXPOSE 8443 ENV NAME=nginx \ - NGINX_VERSION=1.24 \ - NGINX_SHORT_VER=124 \ + NGINX_VERSION={{ spec.version }} \ + NGINX_SHORT_VER={{ spec.short }} \ VERSION=0 \ ARCH=x86_64 @@ -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,${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" \ @@ -43,12 +39,12 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ 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 && \ +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" && \ - dnf clean all + {{ spec.pkg_manager }} clean all # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH diff --git a/1.22-micro/Dockerfile.fedora b/src/Dockerfile.micro similarity index 65% rename from 1.22-micro/Dockerfile.fedora rename to src/Dockerfile.micro index a6863af0..ab351a5a 100644 --- a/1.22-micro/Dockerfile.fedora +++ b/src/Dockerfile.micro @@ -1,12 +1,23 @@ -FROM registry.fedoraproject.org/fedora:37 AS build +FROM {{ spec.micro_build_base }} AS build RUN mkdir -p /mnt/rootfs +{% if spec.prod == "rhel8" %} +# 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 +{% elif spec.prod == "c9s" %} # 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 " && \ +# 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 " && \ +{% endif %} 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 && \ + INSTALL_PKGS="$MICRO_PKGS {{ spec.micro_pkgs }} " && \ + dnf --installroot /mnt/rootfs --releasever {{ spec.micro_releasever }} --setopt install_weak_deps=false --nodocs module enable nginx:{{ spec.version }} -y && \ +{% if spec.prod == "rhel8" %} + dnf --installroot /mnt/rootfs --releasever {{ spec.micro_releasever }} --setopt install_weak_deps=false --nodocs install $INSTALL_PKGS -y && \ +{% else %} + dnf install --installroot /mnt/rootfs $INSTALL_PKGS --releasever {{ spec.micro_releasever }} --setopt install_weak_deps=false --nodocs -y && \ +{% endif %} dnf -y --installroot /mnt/rootfs clean all && \ rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* @@ -16,8 +27,8 @@ EXPOSE 8080 EXPOSE 8443 ENV NAME=nginx \ - NGINX_VERSION=1.22 \ - NGINX_SHORT_VER=122 \ + NGINX_VERSION={{ spec.version }} \ + NGINX_SHORT_VER={{ spec.short }} \ VERSION=0 ENV SUMMARY="Platform for running a micro nginx $NGINX_VERSION or building nginx-based application" \ @@ -32,7 +43,7 @@ therefore options for extending this image are limited." \ STI_SCRIPTS_PATH=/usr/libexec/s2i \ APP_ROOT=/opt/app-root \ HOME=/opt/app-root/src \ - PLATFORM="fedora" + PLATFORM="{{ spec.micro_platform }}" LABEL summary="${SUMMARY}" \ description="${DESCRIPTION}" \ @@ -40,15 +51,23 @@ 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" \ - version="${VERSION}" \ + io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \ + com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \ + name="{{ spec.org }}/${NAME}-${NGINX_SHORT_VER}-micro" \ +{% 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 ${FGC}/nginx " + usage="s2i build {{ spec.org }}/${NAME}-${NGINX_SHORT_VER}-micro:latest " COPY --from=build /mnt/rootfs/ / +{% if spec.prod == "rhel8" %} +COPY --from=build /etc/yum.repos.d/ubi.repo /etc/ +{% endif %} ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_CONF_PATH=/etc/nginx/nginx.conf \ @@ -58,12 +77,12 @@ ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \ NGINX_LOG_PATH=/var/log/nginx # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH -COPY $NGINX_VERSION-micro/s2i/bin/ $STI_SCRIPTS_PATH +COPY {{ spec.version }}{{ spec.suffix }}/s2i/bin/ $STI_SCRIPTS_PATH # Copy extra files to the image. -COPY $NGINX_VERSION-micro/root/ / +COPY {{ spec.version }}{{ spec.suffix }}/root/ / -COPY $NGINX_VERSION-micro/core-scripts/usr /usr +COPY {{ spec.version }}{{ spec.suffix }}/core-scripts/usr /usr WORKDIR ${HOME} 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 <