ubi9/perl-532

Apache 2.4 with mod_perl/5.32

Red Hat
Updated
Overview

Features

Release categoryGenerally Available
Privilege modeUnprivileged

Download this image

This will require authentication. View other options.

Description

Perl 5.32 available as container is a base platform for building and running various Perl 5.32 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 different things, Perl's most common applications are system administration utilities and web programming.

This container image includes an npm utility, so users can use it to install JavaScript modules for their web applications. There is no guarantee for any specific npm or nodejs version, that is included in the image; those versions can be changed anytime and the nodejs itself is included just to make the npm work.

Usage in Openshift

In this example, we will assume that you are using the ubi9/perl-532 image, available via perl:5.32 imagestream tag in Openshift. To build a simple nodejs-sample-app application in Openshift: oc new-app perl:5.32~https://github.com/sclorg/dancer-ex.git

To access the application:

$ oc get pods
$ oc exec <pod> -- curl 127.0.0.1:8080

Source-to-Image framework and scripts

This image supports the Source-to-Image (S2I) strategy in OpenShift. The Source-to-Image is an OpenShift framework which makes it easy to write images that take application source code as an input, use a builder image like this Node.js container image, and produce a new image that runs the assembled application as an output.

To support the Source-to-Image framework, important scripts are included in the builder image:

  • The /usr/libexec/s2i/assemble script inside the image is run 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. It utilizes some common patterns in Perl application development (see the Environment variables section below).
  • The /usr/libexec/s2i/run script is set as the default command in the resulting container image (the new image with the application artifacts). It runs httpd for production.

Building an application using a Dockerfile

Compared to the Source-to-Image strategy, using a Dockerfile is a more flexible way to build a Node.js container image with an application. Use a Dockerfile when Source-to-Image is not sufficiently flexible for you or when you build the image outside of the OpenShift environment.

To use the Node.js image in a Dockerfile, follow these steps:

1. Pull a base builder image to build on

podman pull ubi9/perl-532

A RHEL9 image ubi9/perl-532 is used in this example.

2. Pull and application code

An example application available at https://github.com/sclorg/dancer-ex.git is used here. Feel free to clone the repository for further experiments.

git clone https://github.com/sclorg/dancer-ex.git app-src

3. Prepare an application inside a container

This step usually consists of at least these parts:

  • putting the application source into the container
  • installing the dependencies
  • setting the default command in the resulting image

For all these three parts, users can either setup all manually and use commands perl and cpan explicitly in the Dockerfile (3.1.), or users can use the Source-to-Image scripts inside the image (3.2.; see more about these scripts in the section "Source-to-Image framework and scripts" above), that already know how to set-up and run some common Perl applications.

3.1 To use your own setup, create a Dockerfile with this content:
FROM ubi9/perl-532

# Add application sources
ADD app-src .


# Install the dependencies
RUN export PATH=${PATH}:/opt/rh/rh-perl532/root/usr/bin/&& \
     export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/opt/rh/rh-perl532/root/usr/lib64 && \
     cpanm --notest -l extlib Module::CoreList && \
     cpanm --notest -l extlib --installdeps .

CMD sed -i '1i<Location/>' /opt/app-root/etc/httpd.d/40-psgi.conf
CMD sed -i '2iSetHandler perl-script' /opt/app-root/etc/httpd.d/40-psgi.conf
CMD sed -i '3iPerlResponseHandler Plack::Handler::Apache2' /opt/app-root/etc/httpd.d/40-psgi.conf
CMD sed -i '4iPerlSetVar psgi_app app.psgi' /opt/app-root/etc/httpd.d/40-psgi.conf
CMD sed -i '5i</Location>' /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
3.2 To use the Source-to-Image scripts and build an image using a Dockerfile, create a Dockerfile with this content:
FROM centos/perl-532-centos7

# Add application sources to a directory that the assemble scriptexpects 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

4. Build a new image from a Dockerfile prepared in the previous step

podman build -t perl-app .

5. Run the resulting image with final application

podman run -d perl-app

Environment variables for Source-to-Image

To set environment variables, you can place them as a key value pair into a .s2i/environment file inside your source code repository.

  • ENABLE_CPAN_TEST

    Allow the installation of all specified cpan packages and the running of their tests. The default value is false.

  • CPAN_MIRROR

    This variable specifies a mirror URL which will used by cpanminus to install dependencies. By default the URL is not specified.

  • PERL_APACHE2_RELOAD

    Set this to "true" to enable automatic reloading of modified Perl modules.

  • HTTPD_START_SERVERS

    The StartServers directive sets the number of child server processes created on startup. Default is 8.

  • HTTPD_MAX_REQUEST_WORKERS

    Number of simultaneous requests that will be handled by Apache. The default is 256, but it will be automatically lowered if memory is limited.

  • PSGI_FILE

    Override PSGI application detection.

    If the PSGI_FILE variable is set to empty value, no PSGI application will be detected and mod_perl not be reconfigured.

    If the PSGI_FILE variable is set and non-empty, it will define path to the PSGI application file. No detection will be used.

    If the PSGI_FILE variable does not exist, autodetection will be used: If exactly one ./*.psgi file exists, mod_perl will be configured to execute that file.

  • PSGI_URI_PATH

    This variable overrides location URI path that is handled path the PSGI application. Default value is "/".

See also

Dockerfile and other sources are available on https://github.com/sclorg/s2i-perl-container. In that repository you also can find another versions of Perl environment Dockerfiles. Dockerfile for CentOS is called Dockerfile, Dockerfile for RHEL7 is called Dockerfile.rhel7, Dockerfile for RHEL8 is called Dockerfile.rhel8, Dockerfile for RHEL9 is called Dockerfile.rhel9 and the Fedora Dockerfile is called Dockerfile.fedora.

Products using this container

Type

Builder image

Stream

Single-stream

Size

331.6 MB

(927.1 MB uncompressed)

Digest

Category

Programming Languages & Runtimes
SecuritySpecifications

Image specifications

The following information was extracted from the dockerfile and other sources.

Canonical image IDApache 2.4 with mod_perl/5.32
SummaryPlatform for building and running Perl 5.32 applications
DescriptionPerl 5.32 available as container is a base platform for building and running various Perl 5.32 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 different things, Perl's most common applications are system administration utilities and web programming.
ProviderRed Hat
MaintainerSoftwareCollections.org <sclorg@redhat.com>
Repository nameubi9/perl-532
Image version1
Architectureamd64
Usages2i build <SOURCE-REPOSITORY> ubi9/perl-532:latest <APP-NAME>
Exposed ports8080:http
Working directory/opt/app-root/src
PackagesContainerfileGet this image
Terms & conditionsThe Red Hat Universal Base Image is free to deploy on Red Hat or non-Red Hat platforms and freely redistributable. Software vendors and community projects which build on UBI may have additional EULAs which apply to their layered software. Please refer to the End User License Agreement for the Red Hat Universal Base Image for information about use of the Red Hat Universal Base Image and associated software and source code.

Registry tokens

Use a registry service account token to authenticate your container client. This allows you to pull images without using your personal Red Hat credentials, which is recommended for CI/CD pipelines and automated deployments.

Using Podman login


Image identifiers

Red Hat login

Use the following instructions to get images from a Red Hat container registry using your Red Hat login.

Using Podman login


Image identifiers


Unauthenticated

Use the following instructions to get images from a Red Hat container registry without providing authentication.

Update to new container registryTo support our existing users and users to come, we will be transitioning our product portfolio and customers to a new container registry. The new registry uses standard OAuth mechanisms to provide customers with the ability to configure their systems to pull containerized content using static tokens or their Red Hat login. Customers are encouraged to begin using the new registry as their preferred authentication method.

Using podman

Use the following command(s) from a system with podman installed.


Image identifiers

Getting source containers

Source code is available for all Red Hat UBI-based images in the form of downloadable containers. Here are a few things you should know about Red Hat source containers.

  • Although they are packaged as containers, source containers cannot be run. So instead of using podman pull to get them to your system, use the skopeo command.
  • Source containers are named based on the binary containers they represent. So, for example, to get the source container for a particular standard RHEL UBI 8 container (registry.access.redhat.com/ubi8/ubi8.1-397) you simply append -source to get the source code container for that image (registry.access.redhat.com/ubi8/ubi8.1-397-source).
  • Once a source container is copied to a local directory, you can use a combination of tar,gzip, and rpm commands to work with that content.

Step one

Use skopeo to copy the source image to a local directory

Step two

Inspect the image

Step three

Untar the contents

Step four

Begin examining and using the content.

Red Hat logoLinkedInYouTubeFacebookTwitter

Platforms

Products & services

Try, buy, sell

Help

About Red Hat Ecosystem Catalog

The Red Hat Ecosystem Catalog is the official source for discovering and learning more about the Red Hat Ecosystem of both Red Hat and certified third-party products and services.

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2025 Red Hat, LLC
Feedback