Skip to content

Building and testing container on RHEL10 host #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

phracek
Copy link
Member

@phracek phracek commented Jan 16, 2025

This pull request enables building and testing s2i-php-container on RHEL10 host.

The pull request is separated into 2 commits:

  1. The first one adds 8.3/Dockerfile.rhel10
  2. The second one updates README.md files with RHEL10 information

Copy link

github-actions bot commented Jan 16, 2025

Pull Request validation

Failed

🔴 Review - Missing review from a member (1 required)

Success

🟢 CI - All checks have passed

@phracek
Copy link
Member Author

phracek commented Jan 16, 2025

Differences between C10S and RHEL10 Dockerfiles for 8.3:

 diff -u 8.3/Dockerfile.c10s 8.3/Dockerfile.rhel10
--- 8.3/Dockerfile.c10s 2024-08-08 10:55:09
+++ 8.3/Dockerfile.rhel10       2025-01-15 15:24:52
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-base-c10s:c10s
+FROM registry.stage.redhat.io/ubi10/s2i-base

 # This image provides an Apache+PHP environment for running PHP
 # applications.
@@ -32,12 +32,12 @@
       io.openshift.tags="builder,${NAME},${NAME}${PHP_VER_SHORT},${NAME}-${PHP_VER_SHORT}" \
       io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
       io.s2i.scripts-url="image:///usr/libexec/s2i" \
-      name="sclorg/${NAME}-${PHP_VER_SHORT}-c10s" \
+      name="ubi10/${NAME}-${PHP_VER_SHORT}" \
       com.redhat.component="${NAME}-${PHP_VER_SHORT}-container" \
       version="1" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \
-      usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app sclorg/${NAME}-${PHP_VER_SHORT}-c10s sample-server" \
+      usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app ubi10/${NAME}-${PHP_VER_SHORT} sample-server" \
       maintainer="SoftwareCollections.org <[email protected]>"

 # Install Apache httpd and PHP

Differences between RHEL9 and RHEL10 dockerfiles for 8.3 is:

diff -u 8.3/Dockerfile.rhel9 8.3/Dockerfile.rhel10
--- 8.3/Dockerfile.rhel9        2024-08-08 10:55:09
+++ 8.3/Dockerfile.rhel10       2025-01-15 15:24:52
@@ -1,4 +1,4 @@
-FROM ubi9/s2i-base:1
+FROM registry.stage.redhat.io/ubi10/s2i-base

 # This image provides an Apache+PHP environment for running PHP
 # applications.
@@ -7,7 +7,7 @@
 EXPOSE 8443

 # Description
-# This image provides an Apache 2.4 + PHP 8.0 environment for running PHP applications.
+# This image provides an Apache 2.4 + PHP 7.4 environment for running PHP applications.
 # Exposed ports:
 # * 8080 - alternative port for http

@@ -32,12 +32,12 @@
       io.openshift.tags="builder,${NAME},${NAME}${PHP_VER_SHORT},${NAME}-${PHP_VER_SHORT}" \
       io.openshift.s2i.scripts-url="image:///usr/libexec/s2i" \
       io.s2i.scripts-url="image:///usr/libexec/s2i" \
-      name="ubi9/${NAME}-${PHP_VER_SHORT}" \
+      name="ubi10/${NAME}-${PHP_VER_SHORT}" \
       com.redhat.component="${NAME}-${PHP_VER_SHORT}-container" \
       version="1" \
       com.redhat.license_terms="https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI" \
       help="For more information visit https://github.com/sclorg/s2i-${NAME}-container" \
-      usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app ubi9/${NAME}-${PHP_VER_SHORT} sample-server" \
+      usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=${PHP_VERSION}/test/test-app ubi10/${NAME}-${PHP_VER_SHORT} sample-server" \
       maintainer="SoftwareCollections.org <[email protected]>"

 # Install Apache httpd and PHP
@@ -46,8 +46,7 @@
                   php-process php-soap php-opcache php-xml \
                   php-gmp php-pecl-apcu php-pecl-zip mod_ssl hostname"

-RUN dnf module -y enable php:$PHP_VERSION && \
-    dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
+RUN dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     dnf reinstall -y tzdata && \
     rpm -V $INSTALL_PKGS && \
     php -v | grep -qe "v$PHP_VERSION\." && echo "Found VERSION $PHP_VERSION" && \
@@ -61,7 +60,6 @@
     PHP_FPM_CONF_D_PATH=/etc/php-fpm.d \
     PHP_FPM_CONF_FILE=www.conf \
     PHP_FPM_RUN_DIR=/run/php-fpm \
-    PHP_CLEAR_ENV=ON \
     PHP_MAIN_FPM_CONF_FILE=/etc/php-fpm.conf \
     PHP_FPM_LOG_PATH=/var/log/php-fpm \
     HTTPD_CONFIGURATION_PATH=${APP_ROOT}/etc/conf.d \
@@ -82,10 +80,6 @@
 # Reset permissions of filesystem to default values
 RUN /usr/libexec/container-setup && rpm-file-permissions

-# RPM uses a wrong file in the config
-# Related: https://bugzilla.redhat.com/show_bug.cgi?id=2092356
-RUN sed -i "s/mod_php7.c/mod_php.c/" /etc/httpd/conf.d/php.conf
-
 USER 1001

 # Set the default CMD to print the usage of the language image

@phracek
Copy link
Member Author

phracek commented Jan 20, 2025

[test]

Copy link

github-actions bot commented Jan 20, 2025

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
CentOS Stream 10 - 8.3CentOS-Stream-10x86_64✅ passed31.01.2025 09:11:317min 35stest pipeline
Fedora - 8.3Fedora-latestx86_64✅ passed31.01.2025 09:11:2710min 58stest pipeline
Fedora - 8.2Fedora-latestx86_64✅ passed31.01.2025 09:11:2510min 47stest pipeline
Fedora - 8.1Fedora-latestx86_64✅ passed31.01.2025 09:11:2010min 41stest pipeline
RHEL10 - 8.3RHEL-10-Nightlyx86_64✅ passed31.01.2025 09:11:2914min 30stest pipeline
RHEL9 - 8.0RHEL-9.4.0-Nightlyx86_64✅ passed31.01.2025 09:11:2015min 42stest pipeline
RHEL9 - 8.2RHEL-9.4.0-Nightlyx86_64✅ passed29.01.2025 08:49:1514min 44stest pipeline
RHEL9 - 8.1RHEL-9.4.0-Nightlyx86_64✅ passed31.01.2025 09:11:1913min 55stest pipeline
RHEL8 - 7.4RHEL-8.10.0-Nightlyx86_64✅ passed31.01.2025 09:11:1916min 51stest pipeline
RHEL8 - 8.0RHEL-8.10.0-Nightlyx86_64✅ passed29.01.2025 08:49:0815min 36stest pipeline
RHEL8 - 8.2RHEL-8.10.0-Nightlyx86_64✅ passed31.01.2025 09:11:2516min 45stest pipeline

@phracek
Copy link
Member Author

phracek commented Jan 20, 2025

The build RHEL10 failed here:

$ STEP 13/16: RUN /usr/libexec/container-setup && rpm-file-permissions
chmod: cannot access '/etc/pki/tls/certs/localhost.crt': No such file or directory
Error: building at STEP "RUN /usr/libexec/container-setup && rpm-file-permissions": while running runtime: exit status 1
errexit on line 33, common/build.sh
errexit on line 33, common/build.sh
errexit on line 41, common/build.sh
errexit on line 42, common/build.sh
errexit on line 61, common/build.sh
errexit on line 61, common/build.sh
make[1]: *** [common/common.mk:87: 8.3] Error 1

@phracek
Copy link
Member Author

phracek commented Jan 22, 2025

Use short names and fix error.

[test]

@phracek
Copy link
Member Author

phracek commented Jan 29, 2025

[test]

Copy link
Contributor

@remicollet remicollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Add OS host also to test/run, container-setup and s2i/bin/run

Signed-off-by: Petr "Stone" Hracek <[email protected]>
Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek phracek force-pushed the building_testing_rhel10 branch from 4b9b133 to ac616b4 Compare January 31, 2025 09:10
@phracek
Copy link
Member Author

phracek commented Jan 31, 2025

Apply fix from #479 into 8.3/Dockerfile.rhel10

[test]

@phracek phracek merged commit b778765 into master Jan 31, 2025
11 checks passed
@phracek phracek deleted the building_testing_rhel10 branch January 31, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants