sclorg / nginx-container

Nginx high-performance HTTP server and reverse proxy container images based on Red Hat Software Collections and intended for OpenShift and general usage. Users can choose between Red Hat Enterprise Linux, Fedora, and CentOS based images.
http://softwarecollections.org
Apache License 2.0
91 stars 196 forks source link

Add support for Testing nginx-1.26 in CentOS Stream 10 #315

Closed phracek closed 1 month ago

phracek commented 1 month ago

This pull request contains three updates.

phracek commented 1 month ago

[test]

github-actions[bot] commented 1 month ago

Pull Request validation

Success

🟢 CI - All checks have passed 🟢 Review - Reviewed by a member 🟢 Approval - Changes were approved


Auto Merge

Success

🟢 Pull Request is not marked as draft and it's not blocked by dont-merge label 🟢 Pull Request meet requirements, title has correct form 🟢 Pull Request meet requirements, mergeable is true 🟢 Pull Request meet requirements, mergeable_state is clean 🟢 Pull Request has correct target branch master 🟢 Pull Request was merged

phracek commented 1 month ago

Differences between Dockerfiles.

Diff between 1.26/Dockerfile.fedora and 1.26/Dockerfile.c10s:

$ diff -u 1.26/Dockerfile.fedora 1.26/Dockerfile.c10s
--- 1.26/Dockerfile.fedora  2024-07-29 12:41:25
+++ 1.26/Dockerfile.c10s    2024-07-29 12:38:30
@@ -1,14 +1,12 @@
-FROM quay.io/fedora/s2i-core:40
+FROM quay.io/sclorg/s2i-core-c10s:c10s

-
 EXPOSE 8080
 EXPOSE 8443

 ENV NAME=nginx \
     NGINX_VERSION=1.26 \
     NGINX_SHORT_VER=126 \
-    VERSION=0 \
-    ARCH=x86_64
+    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 \
@@ -24,12 +22,13 @@
       io.openshift.expose-services="8080:http" \
       io.openshift.expose-services="8443:https" \
       io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \
-      com.redhat.component="${NAME}-${NGINX_SHORT_VER}" \
-      name="fedora/${NAME}-${NGINX_SHORT_VER}" \
-      version="${VERSION}" \
+      com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \
+      name="sclorg/${NAME}-${NGINX_SHORT_VER}-c10s" \
+      version="1" \
+      com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
       help="For more information visit https://github.com/sclorg/${NAME}-container" \
-      usage="s2i build <SOURCE-REPOSITORY> ${FGC}/nginx <APP-NAME>"
+      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c10s:latest <APP-NAME>"

 ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
     NGINX_CONF_PATH=/etc/nginx/nginx.conf \
@@ -39,12 +38,12 @@
     NGINX_LOG_PATH=/var/log/nginx \
     NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl

-RUN dnf install -y gettext hostname && \
-    INSTALL_PKGS="nss_wrapper bind-utils nginx nginx-mod-stream nginx-mod-http-perl" && \
+# Modules does not exist
+RUN INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \
     dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
     nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \
-    dnf clean all
+    dnf -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
 COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH

Diff between 1.26/Dockerfile.c9s and 1.26/Dockerfile.c10s:

$ diff -u 1.26/Dockerfile.c9s 1.26/Dockerfile.c10s
--- 1.26/Dockerfile.c9s 2024-07-02 09:23:20
+++ 1.26/Dockerfile.c10s    2024-07-29 12:38:30
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-core-c9s:c9s
+FROM quay.io/sclorg/s2i-core-c10s:c10s

 EXPOSE 8080
 EXPOSE 8443
@@ -23,12 +23,12 @@
       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}-c10s" \
       version="1" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
       help="For more information visit https://github.com/sclorg/${NAME}-container" \
-      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c9s:latest <APP-NAME>"
+      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c10s:latest <APP-NAME>"

 ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
     NGINX_CONF_PATH=/etc/nginx/nginx.conf \
@@ -39,12 +39,11 @@
     NGINX_PERL_MODULE_PATH=${APP_ROOT}/etc/perl

 # Modules does not exist
-RUN yum -y module enable nginx:$NGINX_VERSION && \
-    INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \
-    yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
+RUN INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \
+    dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
     nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \
-    yum -y clean all --enablerepo='*'
+    dnf -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
 COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH

Diff between 1.26/Dockerfile.rhel9 and 1.26/Dockerfile.c10s:

$ diff -u 1.26/Dockerfile.rhel9 1.26/Dockerfile.c10s
--- 1.26/Dockerfile.rhel9   2024-07-02 09:23:20
+++ 1.26/Dockerfile.c10s    2024-07-29 12:38:30
@@ -1,4 +1,4 @@
-FROM ubi9/s2i-core:1
+FROM quay.io/sclorg/s2i-core-c10s:c10s

 EXPOSE 8080
 EXPOSE 8443
@@ -23,12 +23,12 @@
       io.openshift.expose-services="8443:https" \
       io.openshift.tags="builder,${NAME},${NAME}-${NGINX_SHORT_VER}" \
       com.redhat.component="${NAME}-${NGINX_SHORT_VER}-container" \
-      name="ubi9/${NAME}-${NGINX_SHORT_VER}" \
+      name="sclorg/${NAME}-${NGINX_SHORT_VER}-c10s" \
       version="1" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       maintainer="SoftwareCollections.org <sclorg@redhat.com>" \
       help="For more information visit https://github.com/sclorg/${NAME}-container" \
-      usage="s2i build <SOURCE-REPOSITORY> ubi9/${NAME}-${NGINX_SHORT_VER}:latest <APP-NAME>"
+      usage="s2i build <SOURCE-REPOSITORY> quay.io/sclorg/${NAME}-${NGINX_SHORT_VER}-c10s:latest <APP-NAME>"

 ENV NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \
     NGINX_CONF_PATH=/etc/nginx/nginx.conf \
@@ -38,12 +38,12 @@
     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 bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \
-    yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
+# Modules does not exist
+RUN INSTALL_PKGS="nss_wrapper bind-utils gettext hostname nginx nginx-mod-stream nginx-mod-http-perl" && \
+    dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
     nginx -v 2>&1 | grep -qe "nginx/$NGINX_VERSION\." && echo "Found VERSION $NGINX_VERSION" && \
-    yum -y clean all --enablerepo='*'
+    dnf -y clean all --enablerepo='*'

 # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH
 COPY $NGINX_VERSION/s2i/bin/ $STI_SCRIPTS_PATH
phracek commented 1 month ago

Test passed locally for C10S:

==============================================
Tests were run for image quay.io/sclorg/nginx-126-c10s:1
==============================================
Test cases results:

 [PASSED] for 'test-app' test_s2i_usage (00:00:00)
 [PASSED] for 'test-app' test_docker_run_usage (00:00:01)
 [PASSED] for 'test-app' test_application (00:00:02)
 [PASSED] for 'test-app' test_log_output (00:00:02)
 [PASSED] for 'test-app' test_log_volume_output (00:00:02)
 [PASSED] for 'test-app' test_application_user (00:00:02)
 [PASSED] for 'start-hook-test-app' test_pre_init_script (00:00:02)
 [PASSED] for 'miscellaneous-tests' run_dockerfiles_test (00:00:15)

Tests for quay.io/sclorg/nginx-126-c10s:1 succeeded.