Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-6773

Issue with ubi9/php-80

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • rhel-9.0.0
    • php-81-container
    • None
    • Moderate
    • rhel-stacks-web-servers
    • ssg_core_services
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      Description of problem:

      When switching from ubi8 to ubi9 the change from mod_php to php fpm breaks configs with environment variables

      Version-Release number of selected component (if applicable):

      How reproducible:

      Dockerfile.ubi8

      1. ubi8
        FROM registry.access.redhat.com/ubi8/php-80

      USER 0
      ADD . /tmp/src
      RUN chown -R 1001:0 /tmp/src
      USER 1001

      1. Install the dependencies
        RUN /usr/libexec/s2i/assemble
      1. Set the default command for the resulting image
        CMD /usr/libexec/s2i/run
        Dockerfile.ubi9
      1. ubi9
        FROM registry.access.redhat.com/ubi9/php-80

      USER 0
      ADD . /tmp/src
      RUN chown -R 1001:0 /tmp/src
      USER 1001

      1. Uncomment this sed to fix the environment variables
      2. RUN sed -i "s/.clear_env.=.*/clear_env = no/g" /etc/php-fpm.d/www.conf
      1. Install the dependencies
        RUN /usr/libexec/s2i/assemble
      1. Set the default command for the resulting image
        CMD /usr/libexec/s2i/run
        With those two docker files in the same directly build out a phpinfo file

      cat <<EOF >>phpinfo.php
      <?php

      phpinfo();

      ?>
      EOF
      UBI8 baseline of expected results
      Now run the ubi8 image to see the expected baseline

      docker build . -f Dockerfile.ubi8 -t test8:latest
      podman run -e FOO=BAR -p 8080:8080 test8:latest
      open a browser to http://127.0.0.1:8080/phpinfo.php

      note:

      in loaded modules "mod_php"

      environment variable FOO is set to bar

      UBI9 showing issue
      docker build . -f Dockerfile.ubi9 -t test9:latest
      podman run -e FOO=BAR -p 8080:8080 test9:latest
      open a browser to http://127.0.0.1:8080/phpinfo.php

      note:

      no loaded modules "mod_php"

      php-fpm now set to active in cgi

      environment varible FOO is now missing

      From here you can edit the Dockerfile.ubi9 and uncomment the sed line/rebuild/rerun and see the normal expected results.

              rcollet@redhat.com Remi Collet
              rhn-support-mabellon Miguel Abellon
              rhscl-container-qe bot rhscl-container-qe bot
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: