This repository contains the sources for S2I builder image for perl 5.24 as well as some sample applications. This is a port to Fedora of software collections Perl located here, that is now using base-runtime and Perl module. Please note that this solution uses httpd 2.4 to display results.
First you need to build the builder image. After you have the builder image, you can use it for a S2I build. You can build and run the sample app like this:
$ docker build --tag=koscicz/perl . $ s2i build https://github.com/container-images/perl.git --context-dir=test/sample-test-app/ koscicz/perl perl-sample-app $ docker run -p 8080:8080 perl-sample-app
This will build and run you application on 127.0.0.1:8080. You can also build the builder image by running
make. This will also tag your image as koscicz/perl.
You can use the
openshift-template.yml in this repository to run your application in Openshift. You can either use web interface, in which case you'll just have to fill out a form, requiring a source repository for your app and name of this app. In case you want to use cli, you can do it like this, after you login:
$ oc new-project perl-test $ oc new-app https://raw.githubusercontent.com/container-images/perl/master/openshift-template.yml -p APP_NAME="perl-example" -p SOURCE_REPOSITORY="https://github.com/kosciCZ/perl-example"
These commands will build the sample application on your Openshift platform.
This repository contains a
test folder with some tests to ensure proper functionality. You can run test by using Makefile. You have two options:
make allThis will build, tag and test the image
make testThis will run the test on the image, that is defined in the Makefile. By default it is koscicz/perl
Or you can execute the test script directly, as described below in Repository organization
Fedora based Dockerfile.
This folder contains scripts that are run by S2I:
Used to install the sources into a location where the application
will be run and prepare the application for deployment (eg. installing
In order to install application dependencies, the application must contain a
cpanfilefile, in which the user specifies the modules and their versions.
An example of a cpanfile is available within our test application.
All files with
.plextension are handled by mod_perl.
If exactly one file with
.psgiextension exists in the top-level
directory, the mod_perl will be autoconfigured to execute the PSGI
application for any request URI path with Plack's mod_perl adaptor.
This script is responsible for running the application, using the
Apache web server.
This script prints the usage of this image.
This folder contains a file with commonly used modules.
This folder contains some sample applications you can use to test you image.
A simple Perl application used for testing purposes by the S2I test framework.
This is a script that runs a test suite on the builder image, to ensure it has all the necessary functionality.
Run it by
./run IMAGE, where
IMAGEis your builder image.
To set environment variables, you can place them as a key value pair into a
file inside your source code repository.
Allow the installation of all specified cpan packages and the running of their tests. The default value is
This variable specifies a mirror URL which will used by cpanminus to install dependencies.
By default the URL is not specified.
Set this to "true" to enable automatic reloading of modified Perl modules.
directive sets the number of child server processes created on startup. Default is 8.
Number of simultaneous requests that will be handled by Apache. The default
is 256, but it will be automatically lowered if memory is limited.
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.
This variable overrides location URI path that is handled path the PSGI
application. Default value is "/".