From b1a638dd58f9a1180fc6d4ab5e994b7323ab813a Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Sep 2025 11:10:31 +0200 Subject: [PATCH 1/6] Remove scl_enable and CentOS7 and RHEL7 dockerfiles Signed-off-by: Petr "Stone" Hracek --- 2.4-micro/root/opt/app-root/scl_enable | 3 - 2.4/.exclude-centos7 | 0 2.4/Dockerfile | 76 ------------------------- 2.4/Dockerfile.rhel7 | 77 -------------------------- 2.4/root/opt/app-root/scl_enable | 3 - 5 files changed, 159 deletions(-) delete mode 100644 2.4-micro/root/opt/app-root/scl_enable delete mode 100644 2.4/.exclude-centos7 delete mode 100644 2.4/Dockerfile delete mode 100644 2.4/Dockerfile.rhel7 delete mode 100644 2.4/root/opt/app-root/scl_enable diff --git a/2.4-micro/root/opt/app-root/scl_enable b/2.4-micro/root/opt/app-root/scl_enable deleted file mode 100644 index 373330d9..00000000 --- a/2.4-micro/root/opt/app-root/scl_enable +++ /dev/null @@ -1,3 +0,0 @@ -# This will make scl collection binaries work out of box. -unset BASH_ENV PROMPT_COMMAND ENV -source scl_source enable httpd24 diff --git a/2.4/.exclude-centos7 b/2.4/.exclude-centos7 deleted file mode 100644 index e69de29b..00000000 diff --git a/2.4/Dockerfile b/2.4/Dockerfile deleted file mode 100644 index 0a6d1c21..00000000 --- a/2.4/Dockerfile +++ /dev/null @@ -1,76 +0,0 @@ -FROM quay.io/centos7/s2i-core-centos7 - -# Apache HTTP Server image. -# -# Volumes: -# * /var/www - Datastore for httpd -# * /var/log/httpd24 - Storage for logs when $HTTPD_LOG_TO_VOLUME is set -# Environment: -# * $HTTPD_LOG_TO_VOLUME (optional) - When set, httpd will log into /var/log/httpd24 - -ENV HTTPD_VERSION=2.4 - -ENV SUMMARY="Platform for running Apache httpd $HTTPD_VERSION or building httpd-based application" \ - DESCRIPTION="Apache httpd $HTTPD_VERSION available as container, is a powerful, efficient, \ -and extensible web server. Apache supports a variety of features, many implemented as compiled modules \ -which extend the core functionality. \ -These can range from server-side programming language support to authentication schemes. \ -Virtual hosting allows one Apache installation to serve many different Web sites." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Apache httpd $HTTPD_VERSION" \ - io.openshift.expose-services="8080:http,8443:https" \ - io.openshift.tags="builder,httpd,httpd24" \ - name="centos7/httpd-24-centos7" \ - version="$HTTPD_VERSION" \ - com.redhat.component="httpd24-container" \ - usage="s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ quay.io/centos7/httpd-24-centos7 sample-server" \ - maintainer="SoftwareCollections.org " - -EXPOSE 8080 -EXPOSE 8443 - -RUN yum install -y yum-utils && \ - yum install -y centos-release-scl epel-release && \ - INSTALL_PKGS="gettext hostname nss_wrapper bind-utils httpd24 httpd24-mod_ssl httpd24-mod_ldap httpd24-mod_session httpd24-mod_auth_mellon httpd24-mod_security openssl" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - scl enable httpd24 -- httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \ - yum -y clean all --enablerepo='*' - -ENV HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \ - HTTPD_APP_ROOT=${APP_ROOT} \ - HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/httpd.d \ - HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ - HTTPD_MAIN_CONF_MODULES_D_PATH=/etc/httpd/conf.modules.d \ - HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ - HTTPD_TLS_CERT_PATH=/etc/httpd/tls \ - HTTPD_VAR_RUN=/var/run/httpd \ - HTTPD_DATA_PATH=/var/www \ - HTTPD_DATA_ORIG_PATH=/opt/rh/httpd24/root/var/www \ - HTTPD_LOG_PATH=/var/log/httpd24 \ - HTTPD_SCL=httpd24 - -# When bash is started non-interactively, to run a shell script, for example it -# looks for this variable and source the content of this file. This will enable -# the SCL for all scripts without need to do 'scl enable'. -ENV BASH_ENV=${HTTPD_APP_ROOT}/scl_enable \ - ENV=${HTTPD_APP_ROOT}/scl_enable \ - PROMPT_COMMAND=". ${HTTPD_APP_ROOT}/scl_enable" - -COPY 2.4/s2i/bin/ $STI_SCRIPTS_PATH -COPY 2.4/root / - -# Reset permissions of filesystem to default values -RUN /usr/libexec/httpd-prepare && rpm-file-permissions - -USER 1001 - -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["${HTTPD_DATA_PATH}"] -# VOLUME ["${HTTPD_LOG_PATH}"] - -CMD ["/usr/bin/run-httpd"] diff --git a/2.4/Dockerfile.rhel7 b/2.4/Dockerfile.rhel7 deleted file mode 100644 index c22e836e..00000000 --- a/2.4/Dockerfile.rhel7 +++ /dev/null @@ -1,77 +0,0 @@ -FROM rhscl/s2i-core-rhel7:1 - -# Apache HTTP Server image. -# -# Volumes: -# * /var/www - Datastore for httpd -# * /var/log/httpd24 - Storage for logs when $HTTPD_LOG_TO_VOLUME is set -# Environment: -# * $HTTPD_LOG_TO_VOLUME (optional) - When set, httpd will log into /var/log/httpd24 - -ENV HTTPD_VERSION=2.4 - -ENV SUMMARY="Platform for running Apache httpd $HTTPD_VERSION or building httpd-based application" \ - DESCRIPTION="Apache httpd $HTTPD_VERSION available as container, is a powerful, efficient, \ -and extensible web server. Apache supports a variety of features, many implemented as compiled modules \ -which extend the core functionality. \ -These can range from server-side programming language support to authentication schemes. \ -Virtual hosting allows one Apache installation to serve many different Web sites." - -LABEL summary="$SUMMARY" \ - description="$DESCRIPTION" \ - io.k8s.description="$DESCRIPTION" \ - io.k8s.display-name="Apache httpd $HTTPD_VERSION" \ - io.openshift.expose-services="8080:http,8443:https" \ - io.openshift.tags="builder,httpd,httpd24" \ - name="rhscl/httpd-24-rhel7" \ - version="$HTTPD_VERSION" \ - com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#rhel" \ - com.redhat.component="httpd24-container" \ - usage="s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ rhscl/httpd-24-rhel7 sample-server" \ - maintainer="SoftwareCollections.org " - -EXPOSE 8080 -EXPOSE 8443 - -RUN yum install -y yum-utils && \ - prepare-yum-repositories rhel-server-rhscl-7-rpms && \ - INSTALL_PKGS="gettext hostname nss_wrapper bind-utils httpd24 httpd24-mod_ssl httpd24-mod_ldap httpd24-mod_session httpd24-mod_auth_mellon httpd24-mod_security openssl" && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ - rpm -V $INSTALL_PKGS && \ - scl enable httpd24 -- httpd -v | grep -qe "Apache/$HTTPD_VERSION" && echo "Found VERSION $HTTPD_VERSION" && \ - yum -y clean all --enablerepo='*' - -ENV HTTPD_CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/httpd/ \ - HTTPD_APP_ROOT=${APP_ROOT} \ - HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/httpd.d \ - HTTPD_MAIN_CONF_PATH=/etc/httpd/conf \ - HTTPD_MAIN_CONF_MODULES_D_PATH=/etc/httpd/conf.modules.d \ - HTTPD_MAIN_CONF_D_PATH=/etc/httpd/conf.d \ - HTTPD_TLS_CERT_PATH=/etc/httpd/tls \ - HTTPD_VAR_RUN=/var/run/httpd \ - HTTPD_DATA_PATH=/var/www \ - HTTPD_DATA_ORIG_PATH=/opt/rh/httpd24/root/var/www \ - HTTPD_LOG_PATH=/var/log/httpd24 \ - HTTPD_SCL=httpd24 - -# When bash is started non-interactively, to run a shell script, for example it -# looks for this variable and source the content of this file. This will enable -# the SCL for all scripts without need to do 'scl enable'. -ENV BASH_ENV=${HTTPD_APP_ROOT}/scl_enable \ - ENV=${HTTPD_APP_ROOT}/scl_enable \ - PROMPT_COMMAND=". ${HTTPD_APP_ROOT}/scl_enable" - -COPY 2.4/s2i/bin/ $STI_SCRIPTS_PATH -COPY 2.4/root / - -# Reset permissions of filesystem to default values -RUN /usr/libexec/httpd-prepare && rpm-file-permissions - -USER 1001 - -# Not using VOLUME statement since it's not working in OpenShift Online: -# https://github.com/sclorg/httpd-container/issues/30 -# VOLUME ["${HTTPD_DATA_PATH}"] -# VOLUME ["${HTTPD_LOG_PATH}"] - -CMD ["/usr/bin/run-httpd"] diff --git a/2.4/root/opt/app-root/scl_enable b/2.4/root/opt/app-root/scl_enable deleted file mode 100644 index 373330d9..00000000 --- a/2.4/root/opt/app-root/scl_enable +++ /dev/null @@ -1,3 +0,0 @@ -# This will make scl collection binaries work out of box. -unset BASH_ENV PROMPT_COMMAND ENV -source scl_source enable httpd24 From 5e5008d5425bcca8b30523255ab30803b502faf9 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Sep 2025 11:11:16 +0200 Subject: [PATCH 2/6] Update README.md documentation. Use RHEL10 instead of RHEL8 Signed-off-by: Petr "Stone" Hracek --- .../share/container-scripts/httpd/README.md | 18 ++++++++--------- README.md | 20 +++++++++---------- examples/README.md | 4 ++-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/2.4/root/usr/share/container-scripts/httpd/README.md b/2.4/root/usr/share/container-scripts/httpd/README.md index cd8b3962..318b2854 100644 --- a/2.4/root/usr/share/container-scripts/httpd/README.md +++ b/2.4/root/usr/share/container-scripts/httpd/README.md @@ -22,11 +22,11 @@ Virtual hosting allows one Apache installation to serve many different Web sites Usage in OpenShift ------------------ -In this example, we assume that you are using the `rhel8/httpd-24` image, available through the `openshift/httpd:2.4-el8` imagestream tag in Openshift. +In this example, we assume that you are using the `rhel10/httpd-24` image, available through the `openshift/httpd:2.4-el10` imagestream tag in Openshift. To build a simple [httpd-sample-app](https://github.com/sclorg/httpd-ex.git) application in Openshift: ``` -oc new-app openshift/httpd:2.4-el8~https://github.com/sclorg/httpd-ex.git +oc new-app openshift/httpd:2.4-el10~https://github.com/sclorg/httpd-ex.git ``` To access the application: @@ -74,7 +74,7 @@ To use the httpd image in a Dockerfile, follow these steps: #### 1. Pull a base builder image to build on ``` -podman pull rhel8/httpd-24 +podman pull rhel10/httpd-24 ``` #### 2. Pull an application code @@ -97,7 +97,7 @@ For all these three parts, you can either set up all manually and use the `httpd ##### 3.1. To use your own setup, create a Dockerfile with this content: ``` -FROM registry.redhat.io/rhel8/httpd-24 +FROM registry.redhat.io/rhel10/httpd-24 # Add application sources ADD app-src/index.html /var/www/html/index.html @@ -108,7 +108,7 @@ CMD run-httpd ##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: ``` -FROM registry.redhat.io/rhel8/httpd-24 +FROM registry.redhat.io/rhel10/httpd-24 # Add application sources to a directory where the assemble script expects them # and set permissions so that the container runs without the root access @@ -153,7 +153,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 httpd -p 8080:8080 -v /wwwdata:/var/www:Z rhel8/httpd-24 +$ podman run -d --name httpd -p 8080:8080 -v /wwwdata:/var/www:Z rhel10/httpd-24 ``` This creates a container named `httpd` running the Apache HTTP Server, serving data from @@ -177,13 +177,13 @@ If you want to run the image and mount the log files into `/wwwlogs` on the host as a container volume, execute the following command: ``` -$ podman run -d -u 0 -e HTTPD_LOG_TO_VOLUME=1 --name httpd -v /wwwlogs:/var/log/httpd24:Z rhel8/httpd-24 +$ podman run -d -u 0 -e HTTPD_LOG_TO_VOLUME=1 --name httpd -v /wwwlogs:/var/log/httpd24:Z rhel10/httpd-24 ``` To run an image using the `event` MPM (rather than the default `prefork`), execute the following command: ``` -$ podman run -d -e HTTPD_MPM=event --name httpd rhel8/httpd-24 +$ podman run -d -e HTTPD_MPM=event --name httpd rhel10/httpd-24 ``` You can also set the following mount points by passing the `-v /host:/container` flag to podman. @@ -226,7 +226,7 @@ By default, Apache HTTP Server container runs as UID 1001. That means the volume To run the container as a different UID, use `-u` option. For example if you want to run the container as UID 1234, execute the following command: ``` -podman run -d -u 1234 rhel8/httpd-24 +podman run -d -u 1234 rhel10/httpd-24 ``` To log into a volume mounted directory, the container needs to be run as UID 0 (see above). diff --git a/README.md b/README.md index 75ce80ef..1e1abfb1 100644 --- a/README.md +++ b/README.md @@ -35,31 +35,31 @@ Installation ------------ Choose either the CentOS Stream 9, CentOS Stream 10, RHEL8 based image, RHEL9 based image, or RHEL10 based image: -* **RHEL8 based image** +* **RHEL10 based image** These images are available in the [Red Hat Container Catalog](https://catalog.redhat.com/software/containers/ubi8/httpd-24/6065b844aee24f523c207943?architecture=amd64&image=6660528072b80acc3c2193f3&container-tabs=overview). To download it run: ``` - $ podman pull registry.access.redhat.com/rhel8/httpd-24 + $ podman pull registry.access.redhat.com/rhel10/httpd-24 ``` - To build a RHEL8 based Apache HTTP Server image, you need to run Docker build on a properly + To build a RHEL10 based Apache HTTP Server image, you need to run Docker build on a properly subscribed RHEL machine. ``` $ git clone --recursive https://github.com/sclorg/httpd-container.git $ cd httpd-container $ git submodule update --init - $ make build TARGET=rhel8 VERSIONS=2.4 + $ make build TARGET=rhel10 VERSIONS=2.4 ``` -* **CentOS Stream 9 based image** +* **CentOS Stream 10 based image** This image is available on DockerHub. To download it run: ``` - $ podman pull quay.io/sclorg/httpd-24-c9s + $ podman pull quay.io/sclorg/httpd-24-c10s ``` To build a CentOS based Apache HTTP Server image from scratch run: @@ -68,7 +68,7 @@ Choose either the CentOS Stream 9, CentOS Stream 10, RHEL8 based image, RHEL9 ba $ git clone --recursive https://github.com/sclorg/httpd-container.git $ cd httpd-container $ git submodule update --init - $ make build TARGET=c9s VERSIONS=2.4 + $ make build TARGET=c10s VERSIONS=2.4 ``` For using other versions of Apache HTTP Server, just replace the `2.4` value by particular version @@ -98,13 +98,13 @@ Users can choose between testing Apache HTTP Server based on a RHEL or CentOS St * **RHEL based image** - To test a RHEL8 based Apache HTTP Server image, you need to run the test on a properly + To test a RHEL10 based Apache HTTP Server image, you need to run the test on a properly subscribed RHEL machine. ``` $ cd httpd-container $ git submodule update --init - $ make test TARGET=rhel8 VERSIONS=2.4 + $ make test TARGET=rhel10 VERSIONS=2.4 ``` * **CentOS Stream based image** @@ -112,7 +112,7 @@ Users can choose between testing Apache HTTP Server based on a RHEL or CentOS St ``` $ cd httpd-container $ git submodule update --init - $ make test TARGET=c9s VERSIONS=2.4 + $ make test TARGET=c10s VERSIONS=2.4 ``` For using other versions of Apache HTTP Server, just replace the `2.4` value by particular version diff --git a/examples/README.md b/examples/README.md index 18c32529..7b3ad601 100644 --- a/examples/README.md +++ b/examples/README.md @@ -5,13 +5,13 @@ This directory includes several examples of how to use the httpd container to se Building and deploying in OpenShift ------------------- ``` -oc new-app rhel8/httpd-24~https://github.com/sclorg/httpd-ex.git +oc new-app rhel10/httpd-24~https://github.com/sclorg/httpd-ex.git ``` Building with s2i ------------------- ``` -s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ sclorg/httpd-24-c9s httpd-sample-app +s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ sclorg/httpd-24-c10s httpd-sample-app ``` The `s2i` binary can be obtained from https://github.com/openshift/source-to-image. From 7aeaa148567c841bf4a0a224bd59834d14af194b Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Sep 2025 11:12:48 +0200 Subject: [PATCH 3/6] Remove SCL definition from whole container. test/run also checks if SCL is running. It is not valid anymore Signed-off-by: Petr "Stone" Hracek --- 2.4-micro/root/usr/libexec/httpd-prepare | 16 ---------------- 2.4-micro/s2i/bin/usage | 9 +++++++-- 2.4/root/usr/libexec/httpd-prepare | 16 ---------------- 2.4/s2i/bin/usage | 9 +++++++-- test/run | 14 +------------- 5 files changed, 15 insertions(+), 49 deletions(-) diff --git a/2.4-micro/root/usr/libexec/httpd-prepare b/2.4-micro/root/usr/libexec/httpd-prepare index bab0276e..3454cd1d 100755 --- a/2.4-micro/root/usr/libexec/httpd-prepare +++ b/2.4-micro/root/usr/libexec/httpd-prepare @@ -4,22 +4,6 @@ set -e source ${HTTPD_CONTAINER_SCRIPTS_PATH}/common.sh -# compatibility symlinks so we hide SCL paths -if [ -v HTTPD_SCL ] ; then - # /opt/rh/httpd24/root/etc/httpd will be symlink to /etc/httpd - mv /opt/rh/httpd24/root/etc/httpd /etc/httpd - ln -s /etc/httpd /opt/rh/httpd24/root/etc/httpd - - # /opt/rh/httpd24/root/var/run/httpd will be symlink to /var/run/httpd - mv /opt/rh/httpd24/root/var/run/httpd /var/run/httpd - ln -s /var/run/httpd /opt/rh/httpd24/root/var/run/httpd - - # /opt/rh/httpd24/root/var/www will be symlink to /var/www - rm -rf /var/www - mv /opt/rh/httpd24/root/var/www /var/www - ln -s /var/www /opt/rh/httpd24/root/var/www -fi - mkdir -p ${HTTPD_CONFIGURATION_PATH} chmod -R a+rwx ${HTTPD_MAIN_CONF_PATH} chmod -R a+rwx ${HTTPD_MAIN_CONF_D_PATH} diff --git a/2.4-micro/s2i/bin/usage b/2.4-micro/s2i/bin/usage index d2c7a3a3..134c0733 100755 --- a/2.4-micro/s2i/bin/usage +++ b/2.4-micro/s2i/bin/usage @@ -1,8 +1,13 @@ #!/bin/sh DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'` -NAMESPACE=centos -[[ $DISTRO =~ rhel* ]] && NAMESPACE=rhscl +NAMESPACE=sclorg +if [[ $DISTRO =~ rhel* ]]; then + NAMESPACE=rhel10 + DISTRO="" +else + DISTRO="-c10s" +fi cat < Date: Wed, 3 Sep 2025 11:13:34 +0200 Subject: [PATCH 4/6] Update usage to proper detection of name Add to examples Dockerfile and Dockerfile.s2i notes what source-to-image means Signed-off-by: Petr "Stone" Hracek --- 2.4-micro/s2i/bin/usage | 2 +- 2.4/s2i/bin/usage | 2 +- examples/Dockerfile | 12 +++++++++++- examples/Dockerfile.s2i | 3 +-- examples/sample-test-app/Dockerfile | 11 ++++++++++- examples/sample-test-app/Dockerfile.s2i | 12 ++++++++++-- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/2.4-micro/s2i/bin/usage b/2.4-micro/s2i/bin/usage index 134c0733..9ebe8e2a 100755 --- a/2.4-micro/s2i/bin/usage +++ b/2.4-micro/s2i/bin/usage @@ -15,7 +15,7 @@ To use it, install S2I: https://github.com/openshift/source-to-image Sample invocation: -s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ ${NAMESPACE}/httpd-24-${DISTRO}7 httpd-sample-app +s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ ${NAMESPACE}/httpd-24${DISTRO} httpd-sample-app You can then run the resulting image via: podman run -p 8080:8080 httpd-sample-app diff --git a/2.4/s2i/bin/usage b/2.4/s2i/bin/usage index 134c0733..9ebe8e2a 100755 --- a/2.4/s2i/bin/usage +++ b/2.4/s2i/bin/usage @@ -15,7 +15,7 @@ To use it, install S2I: https://github.com/openshift/source-to-image Sample invocation: -s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ ${NAMESPACE}/httpd-24-${DISTRO}7 httpd-sample-app +s2i build https://github.com/sclorg/httpd-container.git --context-dir=examples/sample-test-app/ ${NAMESPACE}/httpd-24${DISTRO} httpd-sample-app You can then run the resulting image via: podman run -p 8080:8080 httpd-sample-app diff --git a/examples/Dockerfile b/examples/Dockerfile index 0f97950b..1a9e17f6 100644 --- a/examples/Dockerfile +++ b/examples/Dockerfile @@ -1,4 +1,14 @@ -FROM registry.redhat.io/rhel8/httpd-24 +FROM registry.redhat.io/rhel10/httpd-24 + +# This image supports the Source-to-Image +# In order to support the Source-to-Image framework, there are some interesting +# scripts inside the builder image, that can be run in a Dockerfile directly as well: +# * The `/usr/libexec/s2i/assemble` script inside the image is run in order +# to produce a new image with the application artifacts. +# The script takes sources of a given application and places them into +# appropriate directories inside the image. +# * The `/usr/libexec/s2i/run` script executes the application and is set as +# a default command in the resulting container image. # Add application sources ADD app-src/index.html /var/www/html/index.html diff --git a/examples/Dockerfile.s2i b/examples/Dockerfile.s2i index 7368fbf2..e21eda0b 100644 --- a/examples/Dockerfile.s2i +++ b/examples/Dockerfile.s2i @@ -1,7 +1,6 @@ -FROM registry.redhat.io/rhel8/httpd-24 +FROM registry.redhat.io/rhel10/httpd-24 # This image supports the Source-to-Image -# (see more at https://docs.openshift.com/container-platform/3.11/creating_images/s2i.html). # In order to support the Source-to-Image framework, there are some interesting # scripts inside the builder image, that can be run in a Dockerfile directly as well: # * The `/usr/libexec/s2i/assemble` script inside the image is run in order diff --git a/examples/sample-test-app/Dockerfile b/examples/sample-test-app/Dockerfile index a32f518c..03e502ec 100644 --- a/examples/sample-test-app/Dockerfile +++ b/examples/sample-test-app/Dockerfile @@ -1,5 +1,14 @@ -FROM registry.redhat.io/rhel8/httpd-24 +FROM registry.redhat.io/rhel10/httpd-24 +# This image supports the Source-to-Image +# In order to support the Source-to-Image framework, there are some interesting +# scripts inside the builder image, that can be run in a Dockerfile directly as well: +# * The `/usr/libexec/s2i/assemble` script inside the image is run in order +# to produce a new image with the application artifacts. +# The script takes sources of a given application and places them into +# appropriate directories inside the image. +# * The `/usr/libexec/s2i/run` script executes the application and is set as +# a default command in the resulting container image. # Add application sources ADD index.html /var/www/html/index.html diff --git a/examples/sample-test-app/Dockerfile.s2i b/examples/sample-test-app/Dockerfile.s2i index 9c497372..18fd336a 100644 --- a/examples/sample-test-app/Dockerfile.s2i +++ b/examples/sample-test-app/Dockerfile.s2i @@ -1,10 +1,18 @@ -FROM registry.redhat.io/rhel8/httpd-24 +FROM registry.redhat.io/rhel10/httpd-24 +# This image supports the Source-to-Image +# In order to support the Source-to-Image framework, there are some interesting +# scripts inside the builder image, that can be run in a Dockerfile directly as well: +# * The `/usr/libexec/s2i/assemble` script inside the image is run in order +# to produce a new image with the application artifacts. +# The script takes sources of a given application and places them into +# appropriate directories inside the image. +# * The `/usr/libexec/s2i/run` script executes the application and is set as +# a default command in the resulting container image. # Add application sources ADD . /tmp/src # Assemble script installs the dependencies -# TODO: describe what assemble does, and link to https://docs.openshift.com/container-platform/3.11/creating_images/s2i.html RUN /usr/libexec/s2i/assemble # Run script uses standard ways to run the application From 265b3b737bb9cb868299e03a12b4ae8ac8de9037 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 3 Sep 2025 11:15:02 +0200 Subject: [PATCH 5/6] Update imagestreams and refers to the latest iamge that is ubi10 Signed-off-by: Petr "Stone" Hracek --- imagestreams/httpd-centos.json | 4 ++-- imagestreams/httpd-rhel-aarch64.json | 4 ++-- imagestreams/httpd-rhel.json | 4 ++-- imagestreams/imagestreams.yaml | 6 +++--- test/run | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/imagestreams/httpd-centos.json b/imagestreams/httpd-centos.json index 59a1972f..2db52ee9 100644 --- a/imagestreams/httpd-centos.json +++ b/imagestreams/httpd-centos.json @@ -90,7 +90,7 @@ "annotations": { "openshift.io/display-name": "Apache HTTP Server 2.4 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and serve static content via Apache HTTP Server (httpd) 2.4 on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/httpd-container/blob/master/2.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and serve static content via Apache HTTP Server (httpd) 2.4 on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/httpd-container/blob/master/2.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-httpd", "tags": "builder,httpd", "version": "2.4", @@ -98,7 +98,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "2.4-ubi9" + "name": "2.4-ubi10" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/httpd-rhel-aarch64.json b/imagestreams/httpd-rhel-aarch64.json index 5e2cbdb5..3666a41a 100644 --- a/imagestreams/httpd-rhel-aarch64.json +++ b/imagestreams/httpd-rhel-aarch64.json @@ -90,7 +90,7 @@ "annotations": { "openshift.io/display-name": "Apache HTTP Server 2.4 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and serve static content via Apache HTTP Server (httpd) 2.4 on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/httpd-container/blob/master/2.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and serve static content via Apache HTTP Server (httpd) 2.4 on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/httpd-container/blob/master/2.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-httpd", "tags": "builder,httpd", "version": "2.4", @@ -98,7 +98,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "2.4-ubi8" + "name": "2.4-ubi10" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/httpd-rhel.json b/imagestreams/httpd-rhel.json index 01688e7e..3666a41a 100644 --- a/imagestreams/httpd-rhel.json +++ b/imagestreams/httpd-rhel.json @@ -90,7 +90,7 @@ "annotations": { "openshift.io/display-name": "Apache HTTP Server 2.4 (Latest)", "openshift.io/provider-display-name": "Red Hat, Inc.", - "description": "Build and serve static content via Apache HTTP Server (httpd) 2.4 on UBI 9. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/httpd-container/blob/master/2.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", + "description": "Build and serve static content via Apache HTTP Server (httpd) 2.4 on UBI 10. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/httpd-container/blob/master/2.4/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version available on OpenShift, including major version updates.\n", "iconClass": "icon-httpd", "tags": "builder,httpd", "version": "2.4", @@ -98,7 +98,7 @@ }, "from": { "kind": "ImageStreamTag", - "name": "2.4-ubi9" + "name": "2.4-ubi10" }, "referencePolicy": { "type": "Local" diff --git a/imagestreams/imagestreams.yaml b/imagestreams/imagestreams.yaml index 5d087c11..800096a8 100644 --- a/imagestreams/imagestreams.yaml +++ b/imagestreams/imagestreams.yaml @@ -10,7 +10,7 @@ https://github.com/sclorg/httpd-container/blob/master/APP_VERSION/README.md. imagestream_files: - filename: httpd-centos.json - latest: "2.4-ubi9" + latest: "2.4-ubi10" distros: - name: UBI 8 app_versions: ["2.4"] @@ -25,7 +25,7 @@ app_versions: ["2.4-micro"] - filename: httpd-rhel.json - latest: "2.4-ubi9" + latest: "2.4-ubi10" distros: - name: UBI 8 app_versions: ["2.4"] @@ -41,7 +41,7 @@ - filename: httpd-rhel-aarch64.json - latest: "2.4-ubi8" + latest: "2.4-ubi10" distros: - name: UBI 8 app_versions: ["2.4"] diff --git a/test/run b/test/run index ab33c9cc..78b33bf2 100755 --- a/test/run +++ b/test/run @@ -1,6 +1,6 @@ #!/usr/bin/env bash -IMAGE_NAME="${IMAGE_NAME:-rhel8/httpd-24}" +IMAGE_NAME="${IMAGE_NAME:-rhel10/httpd-24}" THISDIR=$(dirname ${BASH_SOURCE[0]}) . ${THISDIR}/utils.sh From 701137b0bdf6c93b8afb087f2583055cfcca8867 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Wed, 10 Sep 2025 09:32:26 +0200 Subject: [PATCH 6/6] Update README.md for micro image. As 2.4-micro is not available in RHEL land. Let's use CentOS Stream 9 in README.md Signed-off-by: Petr "Stone" Hracek --- .../share/container-scripts/httpd/README.md | 18 +++++++++--------- README.md | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/2.4-micro/root/usr/share/container-scripts/httpd/README.md b/2.4-micro/root/usr/share/container-scripts/httpd/README.md index 020bbe4a..cc608a93 100644 --- a/2.4-micro/root/usr/share/container-scripts/httpd/README.md +++ b/2.4-micro/root/usr/share/container-scripts/httpd/README.md @@ -24,7 +24,7 @@ If you need to install packages inside the image, please use the full sized imag Usage in OpenShift ------------------ -In this example, we assume that you are using the `rhel8/httpd-24-micro` image, available through the `httpd:24-micro` imagestream tag in Openshift. +In this example, we assume that you are using the `quay.io/sclorg/httpd-24-micro-c9s` image, available through the `httpd:2.4-micro-el9` imagestream tag in Openshift. To build a simple [httpd-sample-app](https://github.com/sclorg/httpd-ex.git) application in Openshift: ``` @@ -76,7 +76,7 @@ To use the httpd image in a Dockerfile, follow these steps: #### 1. Pull a base builder image to build on ``` -podman pull rhel8/httpd-24-micro +podman pull quay.io/sclorg/httpd-24-micro-c9s ``` #### 2. Pull an application code @@ -99,7 +99,7 @@ For all these three parts, you can either set up all manually and use the `httpd ##### 3.1. To use your own setup, create a Dockerfile with this content: ``` -FROM registry.redhat.io/rhel8/httpd-24-micro +FROM quay.io/sclorg/httpd-24-micro-c9s # Add application sources ADD app-src/index.html /var/www/html/index.html @@ -110,7 +110,7 @@ CMD run-httpd ##### 3.2. To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: ``` -FROM registry.redhat.io/rhel8/httpd-24-micro +FROM quay.io/sclorg/httpd-24-micro-c9s # Add application sources to a directory where the assemble script expects them # and set permissions so that the container runs without the root access @@ -155,7 +155,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 httpd -p 8080:8080 -v /wwwdata:/var/www:Z rhel8/httpd-24-micro +$ podman run -d --name httpd -p 8080:8080 -v /wwwdata:/var/www:Z quay.io/sclorg/httpd-24-micro-c9s ``` This creates a container named `httpd` running the Apache HTTP Server, serving data from @@ -179,13 +179,13 @@ If you want to run the image and mount the log files into `/wwwlogs` on the host as a container volume, execute the following command: ``` -$ podman run -d -u 0 -e HTTPD_LOG_TO_VOLUME=1 --name httpd -v /wwwlogs:/var/log/httpd24:Z rhel8/httpd-24-micro +$ podman run -d -u 0 -e HTTPD_LOG_TO_VOLUME=1 --name httpd -v /wwwlogs:/var/log/httpd24:Z quay.io/sclorg/httpd-24-micro-c9s ``` To run an image using the `event` MPM (rather than the default `prefork`), execute the following command: ``` -$ podman run -d -e HTTPD_MPM=event --name httpd rhel8/httpd-24-micro +$ podman run -d -e HTTPD_MPM=event --name httpd quay.io/sclorg/httpd-24-micro-c9s ``` You can also set the following mount points by passing the `-v /host:/container` flag to podman. @@ -228,7 +228,7 @@ By default, Apache HTTP Server container runs as UID 1001. That means the volume To run the container as a different UID, use `-u` option. For example if you want to run the container as UID 1234, execute the following command: ``` -podman run -d -u 1234 rhel8/httpd-24-micro +podman run -d -u 1234 quay.io/sclorg/httpd-24-micro-c9s ``` To log into a volume mounted directory, the container needs to be run as UID 0 (see above). @@ -245,6 +245,6 @@ See also -------- Dockerfile and other sources for this container image are available on https://github.com/sclorg/httpd-container. -In that repository, the Dockerfile for RHEL8 is called Dockerfile.rhel8, +In that repository, the Dockerfile for CentOS Stream 9 is called Dockerfile.c9s, the Dockerfile for CentOS Stream 10 is called Dockerfile.c10s, and the Dockerfile for Fedora is called Dockerfile.fedora. diff --git a/README.md b/README.md index 1e1abfb1..48c80d30 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Choose either the CentOS Stream 9, CentOS Stream 10, RHEL8 based image, RHEL9 ba * **RHEL10 based image** - These images are available in the [Red Hat Container Catalog](https://catalog.redhat.com/software/containers/ubi8/httpd-24/6065b844aee24f523c207943?architecture=amd64&image=6660528072b80acc3c2193f3&container-tabs=overview). + These images are available in the [Red Hat Container Catalog](https://catalog.redhat.com/en/search?searchType=containers). To download it run: ```