Skip to content
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

Support c10s and add new version 8.3 #461

Merged
merged 8 commits into from
Aug 8, 2024
Merged

Support c10s and add new version 8.3 #461

merged 8 commits into from
Aug 8, 2024

Conversation

phracek
Copy link
Member

@phracek phracek commented Aug 7, 2024

This pull request is separated into more commits.

  1. Move directory 8.2 -> 8.3
  2. Copy version back 8.3 -> 8.2
  3. Fix symlinks in 8.2 directory like we have in other versions
  4. Copy Dockerfile.c9s to Dockerfile.c10s
  5. Make some modifications in Dockerfiles.
  6. Fix container-setup-scripts
  7. Fix OpenShift 4 tests

phracek added 7 commits August 7, 2024 15:05
Signed-off-by: Petr "Stone" Hracek <[email protected]>
Signed-off-by: Petr "Stone" Hracek <[email protected]>
Signed-off-by: Petr "Stone" Hracek <[email protected]>
Signed-off-by: Petr "Stone" Hracek <[email protected]>
Signed-off-by: Petr "Stone" Hracek <[email protected]>
Signed-off-by: Petr "Stone" Hracek <[email protected]>
@phracek
Copy link
Member Author

phracek commented Aug 7, 2024

[test-all]

@phracek
Copy link
Member Author

phracek commented Aug 7, 2024

@pkubatrh @hhorak @remicollet Please review it. The tests passed. Especially also for CentOS Stream 10

@phracek
Copy link
Member Author

phracek commented Aug 7, 2024

There are differences between Dockerfiles

Dockerfile.fedora against Dockerfile.c10s

$ diff -u Dockerfile.fedora Dockerfile.c10s
--- Dockerfile.fedora	2024-08-07 15:05:53
+++ Dockerfile.c10s	2024-08-07 15:05:53
@@ -1,4 +1,4 @@
-FROM quay.io/fedora/s2i-base:40
+FROM quay.io/sclorg/s2i-base-c10s:c10s

 # This image provides an Apache+PHP environment for running PHP
 # applications.
@@ -6,9 +6,14 @@
 EXPOSE 8080
 EXPOSE 8443

+# Description
+# This image provides an Apache 2.4 + PHP 7.4 environment for running PHP applications.
+# Exposed ports:
+# * 8080 - alternative port for http
+
 ENV PHP_VERSION=8.3 \
-    PHP_SHORT_VER=83 \
-    PATH=$PATH:/usr/bin
+    PHP_VER_SHORT=83 \
+    NAME=php

 ENV SUMMARY="Platform for building and running PHP $PHP_VERSION applications" \
     DESCRIPTION="PHP $PHP_VERSION available as container is a base platform for \
@@ -19,30 +24,30 @@
 a database-enabled webpage with PHP is fairly simple. The most common use of PHP coding \
 is probably as a replacement for CGI scripts."

-ENV NAME=php \
-    VERSION=0 \
-    RELEASE=1 \
-    ARCH=x86_64
-
-LABEL summary="$SUMMARY" \
-      description="$DESCRIPTION" \
-      io.k8s.description="$DESCRIPTION" \
-      io.k8s.display-name="Apache 2.4 with PHP $PHP_VERSION" \
+LABEL summary="${SUMMARY}" \
+      description="${DESCRIPTION}" \
+      io.k8s.description="${DESCRIPTION}" \
+      io.k8s.display-name="Apache 2.4 with PHP ${PHP_VERSION}" \
       io.openshift.expose-services="8080:http" \
-      io.openshift.tags="builder,php" \
-      name="fedora/$NAME-$PHP_SHORT_VER" \
-      com.redhat.component="$NAME" \
-      version="$VERSION" \
-      usage="s2i build https://github.com/sclorg/s2i-php-container.git --context-dir=/$PHP_VERSION/test/test-app quay.io/fedora/$NAME-$PHP_SHORT_VER sample-server" \
+      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" \
+      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" \
       maintainer="SoftwareCollections.org <[email protected]>"

 # Install Apache httpd and PHP
-ARG INSTALL_PKGS="php php-fpm php-mysqlnd php-bcmath \
+ARG INSTALL_PKGS="php php-fpm php-mysqlnd php-pgsql php-bcmath \
                   php-gd php-intl php-ldap php-mbstring php-pdo \
                   php-process php-soap php-opcache php-xml \
-                  php-gmp php-pecl-apcu mod_ssl hostname"
+                  php-gmp php-pecl-apcu php-pecl-zip mod_ssl hostname"

-RUN dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS --nogpgcheck && \
+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" && \
     dnf -y clean all --enablerepo='*'

Dockerfile.c9s against Dockerfile.c10s

$ diff -u Dockerfile.c9s Dockerfile.c10s
--- Dockerfile.c9s	2024-08-07 15:05:53
+++ Dockerfile.c10s	2024-08-07 15:05:53
@@ -1,4 +1,4 @@
-FROM quay.io/sclorg/s2i-base-c9s:c9s
+FROM quay.io/sclorg/s2i-base-c10s:c10s

 # 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}-c9s" \
+      name="sclorg/${NAME}-${PHP_VER_SHORT}-c10s" \
       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}-c9s sample-server" \
+      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" \
       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" && \

Dockerfile.rhe9 against Dockerfile.c10s

$ diff -u Dockerfile.rhel9 Dockerfile.c10s
--- Dockerfile.rhel9	2024-08-07 15:05:53
+++ Dockerfile.c10s	2024-08-07 15:05:53
@@ -1,4 +1,4 @@
-FROM ubi9/s2i-base:1
+FROM quay.io/sclorg/s2i-base-c10s:c10s

 # 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="sclorg/${NAME}-${PHP_VER_SHORT}-c10s" \
       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 sclorg/${NAME}-${PHP_VER_SHORT}-c10s 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 Aug 8, 2024

ALL TESTS PASSED

@remicollet
Copy link
Contributor

LGTM

@remicollet
Copy link
Contributor

Side note: if in the future a php 8.3 stream is available for EL-9, it won't be usable on EL-9, because capstone is missing there (php-opcache new requirement)

@phracek phracek merged commit d73cce1 into master Aug 8, 2024
23 checks passed
@phracek phracek deleted the support_c10s branch August 8, 2024 08:49
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.

2 participants