This repository contains the source for building various versions of the Perl application as a reproducible Docker image using source-to-image. Users can choose between RHEL and CentOS based builder images. The resulting image can be run using Docker.
To build a simple perl-sample-app application, using standalone S2I and then run the resulting image with Docker execute:
-
For RHEL based image
$ s2i build https://github.com/openshift/s2i-perl.git --context-dir=5.16/test/sample-test-app/ openshift/perl-516-rhel7 perl-sample-app $ docker run -p 8080:8080 perl-sample-app
-
For CentOS based image
$ s2i build https://github.com/openshift/s2i-perl.git --context-dir=5.16/test/sample-test-app/ openshift/perl-516-centos7 perl-sample-app $ docker run -p 8080:8080 perl-sample-app
Accessing the application:
$ curl 127.0.0.1:8080
-
<perl-version>
-
Dockerfile
CentOS based Dockerfile.
-
Dockerfile.rhel7
RHEL based Dockerfile. In order to perform build or test actions on this Dockerfile you need to run the action on a properly subscribed RHEL machine.
-
s2i/bin/
This folder contains scripts that are run by S2I:
-
assemble
Used to install the sources into a location where the application will be run and prepare the application for deployment (eg. installing modules, etc.). In order to install application dependencies, the application must contain a
cpanfile
file, in which the user specifies the modules and their versions. An example of a cpanfile is available within our test application. -
run
This script is responsible for running the application, using the Apache web server.
-
usage*
This script prints the usage of this image.
-
-
contrib/
This folder contains a file with commonly used modules.
-
test/
This folder contains the S2I test framework.
-
To set environment variables, you can place them as a key value pair into a .sti/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.