diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 6a7bc74..9d011b2 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -30,6 +30,14 @@ jobs: quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" + - dockerfile: "5.38/Dockerfile.fedora" + docker_context: "5.38" + registry_namespace: "fedora" + tag: "5.38" + image_name: "perl-538" + quayio_username: "QUAY_IMAGE_FEDORA_BUILDER_USERNAME" + quayio_token: "QUAY_IMAGE_FEDORA_BUILDER_TOKEN" + steps: - name: Build and push to quay.io registry uses: sclorg/build-and-push-action@v4 diff --git a/5.38/Dockerfile.c9s b/5.38/Dockerfile.c9s index 5d4287f..237e24e 100644 --- a/5.38/Dockerfile.c9s +++ b/5.38/Dockerfile.c9s @@ -1,12 +1,12 @@ FROM quay.io/sclorg/s2i-base-c9s:c9s -# This image provides a Perl 5.36 environment you can use to run your Perl applications. +# This image provides a Perl 5.38 environment you can use to run your Perl applications. EXPOSE 8080 # Image metadata -ENV PERL_VERSION=5.36 \ - PERL_SHORT_VER=536 \ +ENV PERL_VERSION=5.38 \ + PERL_SHORT_VER=538 \ NAME=perl ENV SUMMARY="Platform for building and running Perl $PERL_VERSION applications" \ @@ -37,7 +37,7 @@ LABEL summary="$SUMMARY" \ # Deselect a default stream RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ yum -y --allowerasing distrosync && \ - yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ + yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ yum -y clean all --enablerepo='*' diff --git a/5.38/Dockerfile.fedora b/5.38/Dockerfile.fedora index 7a32e24..bb40d4b 100644 --- a/5.38/Dockerfile.fedora +++ b/5.38/Dockerfile.fedora @@ -1,11 +1,11 @@ -FROM quay.io/fedora/s2i-base:38 +FROM quay.io/fedora/s2i-base:39 -# This image provides a Perl 5.36 environment you can use to run your Perl applications. +# This image provides a Perl 5.38 environment you can use to run your Perl applications. EXPOSE 8080 # Image metadata -ENV PERL_VERSION=5.36 \ - PERL_SHORT_VER=536 \ +ENV PERL_VERSION=5.38 \ + PERL_SHORT_VER=538 \ VERSION=0 \ NAME=perl \ PATH=/opt/app-root/src/extlib/bin:$PATH \ @@ -36,7 +36,6 @@ LABEL summary="$SUMMARY" \ usage="s2i build quay.io/fedora/fedora/$NAME-$PERL_SHORT_VER " RUN INSTALL_PKGS="perl perl-devel mod_fcgid perl-App-cpanminus perl-FCGI patch" && \ - dnf -y module enable perl:$PERL_VERSION && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ perl -v | grep -qe "v$PERL_VERSION\." && echo "Found VERSION $PERL_VERSION" && \ diff --git a/5.38/README.md b/5.38/README.md index 4707275..9281fc5 100644 --- a/5.38/README.md +++ b/5.38/README.md @@ -1,7 +1,7 @@ -Perl 5.36 container image +Perl 5.38 container image ========================= -This container image includes Perl 5.36 as an [S2I](https://github.com/openshift/source-to-image) base image for your Perl 5.36 applications. +This container image includes Perl 5.38 as an [S2I](https://github.com/openshift/source-to-image) base image for your Perl 5.38 applications. Users can choose Fedora based builder image. The Fedora images are available in [Quay.io](https://quay.io/fedora/). The resulting image can be run using [podman](https://github.com/containers/libpod). @@ -11,8 +11,8 @@ Note: while the examples in this README are calling `podman`, you can replace an Description ----------- -Perl 5.36 available as container is a base platform for -building and running various Perl 5.36 applications and frameworks. +Perl 5.38 available as container is a base platform for +building and running various Perl 5.38 applications and frameworks. Perl is a high-level programming language with roots in C, sed, awk and shell scripting. Perl is good at handling processes and files, and is especially good at handling text. Perl's hallmarks are practicality and efficiency. While it is used to do a lot of @@ -26,11 +26,11 @@ version, that is included in the image; those versions can be changed anytime. Usage in Openshift ------------------ -In this example, we will assume that you are using the `ubi9/perl-536` image, available via `perl:5.36` imagestream tag in Openshift. +In this example, we will assume that you are using the `ubi9/perl-538` image, available via `perl:5.38` imagestream tag in Openshift. To build a simple [perl-sample-app](https://github.com/sclorg/dancer-ex.git) application in Openshift: ``` -oc new-app perl:5.36~https://github.com/sclorg/dancer-ex.git +oc new-app perl:5.38~https://github.com/sclorg/dancer-ex.git ``` **To access the application:** @@ -67,10 +67,10 @@ To use the Perl image in a Dockerfile, follow these steps: #### 1. Pull a base builder image to build on ``` -podman pull ubi9/perl-536 +podman pull ubi9/perl-538 ``` -An ubi9 image `ubi9/perl-536` is used in this example. +An ubi9 image `ubi9/perl-538` is used in this example. #### 2. Pull and application code @@ -93,7 +93,7 @@ For all these three parts, users can either setup all manually and use commands ##### 3.1 To use your own setup, create a Dockerfile with this content: ``` -FROM ubi9/perl-536 +FROM ubi9/perl-538 # Add application sources ADD app-src . @@ -130,7 +130,7 @@ CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND ##### 3.2 To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content: ``` -FROM ubi9/perl-536 +FROM ubi9/perl-538 # Add application sources to a directory that the assemble scriptexpects them # and set permissions so that the container runs without root access diff --git a/Makefile b/Makefile index 5f825c6..c72af81 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Variables are documented in common/build.sh. BASE_IMAGE_NAME = perl -VERSIONS = 5.26-mod_fcgid 5.26 5.30-mod_fcgid 5.30 5.32 5.34 5.36 +VERSIONS = 5.26-mod_fcgid 5.26 5.30-mod_fcgid 5.30 5.32 5.34 5.36 5.38 OPENSHIFT_NAMESPACES = 5.16 # HACK: Ensure that 'git pull' for old clones doesn't cause confusion. diff --git a/README.md b/README.md index c46c05d..11cb4bd 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Images available on Quay are: * Fedora [perl-5.32](https://quay.io/repository/fedora/perl-532) * Fedora [perl-5.34](https://quay.io/repository/fedora/perl-534) * Fedora [perl-5.36](https://quay.io/repository/fedora/perl-536) +* Fedora [perl-5.38](https://quay.io/repository/fedora/perl-538) This repository contains the source for building various versions of the Perl application as a reproducible container image using @@ -34,6 +35,7 @@ Perl versions currently provided: * [perl-5.32](5.32) * [perl-5.34](5.34) * [perl-5.36](5.36) +* [perl-5.38](5.38) RHEL versions currently supported: * RHEL7 @@ -107,6 +109,9 @@ see [usage documentation](5.34/README.md). For information about usage of the Dockerfile for Perl 5.36 - mod_fcgid version, see [usage documentation](5.36/README.md). +For information about usage of the Dockerfile for Perl 5.38 - mod_fcgid version, +see [usage documentation](5.38/README.md). + Test ---- This repository also provides a [S2I](https://github.com/openshift/source-to-image) test framework, diff --git a/examples/from-dockerfile/5.38/Dockerfile b/examples/from-dockerfile/5.38/Dockerfile new file mode 100644 index 0000000..855986e --- /dev/null +++ b/examples/from-dockerfile/5.38/Dockerfile @@ -0,0 +1,32 @@ +FROM ubi9/perl-538 + +# Add application sources +ADD app-src . + +# Set the paths to local Perl modules +ENV PATH=/opt/app-root/src/extlib/bin:${PATH} +ENV PERL5LIB=/opt/app-root/src/extlib/lib/perl5 + +# Install the dependencies +RUN cpanm --notest -l extlib Module::CoreList && \ + cpanm --notest -l extlib --installdeps . + +# Install Plack as an FCGI server +RUN cpanm --notest -l extlib Plack::Handler::FCGI FCGI::ProcManager +RUN patch --read-only=ignore -d ./extlib/lib/perl5 -p2 < /opt/app-root/Plack-1.0047-Work-around-mod_fcgid-bogus-SCRIPT_NAME-PATH_INFO.patch +RUN printf '\ +FcgidInitialEnv MODFCGID_VIRTUAL_LOCATION /\n\ +PassEnv HOME\n\ +FcgidInitialEnv "HOME" "%s"\n\ +PassEnv PATH\n\ +FcgidInitialEnv "PATH" "%s"\n\ +PassEnv PERL5LIB\n\ +FcgidInitialEnv "PERL5LIB" "%s"\n\ +\n\ +SetHandler fcgid-script\n\ +Options +ExecCGI\n\ +FcgidWrapper "/opt/app-root/psgiwrapper /usr/bin/env plackup -s FCGI ./app.psgi" virtual\n\ +\n' "$HOME" "$PATH" "$PERL5LIB"> /opt/app-root/etc/httpd.d/40-psgi.conf + +# Run scripts uses standard ways to run the application +CMD exec httpd -C 'Include /opt/app-root/etc/httpd.conf' -D FOREGROUND diff --git a/examples/from-dockerfile/5.38/Dockerfile.s2i b/examples/from-dockerfile/5.38/Dockerfile.s2i new file mode 100644 index 0000000..e34647e --- /dev/null +++ b/examples/from-dockerfile/5.38/Dockerfile.s2i @@ -0,0 +1,14 @@ +FROM ubi9/perl-538 + +# Add application sources to a directory that the assemble script expects them +# and set permissions so that the container runs without root access +USER 0 +ADD app-src /tmp/src +RUN chown -R 1001:0 /tmp/src +USER 1001 + +# Install the dependencies +RUN /usr/libexec/s2i/assemble + +# Set the default command for the resulting image +CMD /usr/libexec/s2i/run diff --git a/test/run-modfcgid b/test/run-modfcgid index dc1bc40..34197f7 100755 --- a/test/run-modfcgid +++ b/test/run-modfcgid @@ -196,6 +196,8 @@ test_application() { version="5.34" elif [ x"$VERSION" == "x5.36" ]; then version="5.36" + elif [ x"$VERSION" == "x5.38" ]; then + version="5.38" fi test_scl_usage "perl --version" "v${version}." ct_check_testcase_result $?