Search

Chapter 7. Application Images

download PDF

7.1. Node.js

7.1.1. Description

The rhscl/nodejs-6-rhel7 image provides a Node.js 6 platform for building and running applications. The rhscl/nodejs-4-rhel7 image provides a Node.js 4 platform.

7.1.2. Access

To pull the rhscl/nodejs-6-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/nodejs-6-rhel7

To pull the rhscl/nodejs-4-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/nodejs-4-rhel7

7.1.3. Configuration

No further configuration is required.

7.2. Perl

7.2.1. Description

The rhscl/perl-524-rhel7 image provides a Perl 5.24 platform for building and running applications, the rhscl/perl-520-rhel7 image provides a Perl 5.20 platform. Apache httpd 2.4 with mod_perl for deploying Perl web applications is preinstalled. The images also supports deploying Perl Web Server Gateway Interface (PSGI) applications.

7.2.2. Access

To pull the rhscl/perl-524-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/perl-524-rhel7

To pull the rhscl/perl-520-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/perl-520-rhel7

7.2.3. Configuration

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

Variable NameDescriptionDefault

ENABLE_CPAN_TEST

Allows the installation of all specified cpan packages and the running of their tests

false

CPAN_MIRROR

Specifies a mirror URL which will used by cpanminus to install dependencies

URL is not specified by default

PSGI_FILE

Specifies relative path to the PSGI application file; Use empty value to disable the PSGI autoconfiguration

Single *.psgi file in the top-level directory, if it exists

PSGI_URI_PATH

Specifies URI path that is handled by the PSGI application

/

To install additional Perl modules from the Comprehensive Perl Archive Network (CPAN), create a cpanfile in the root directory of your application sources. The file must conform to the cpanfile format as defined in Module-CPANFile CPAN distribution. For detailed information about the cpanfile format, refer to the cpanfile documentation.

To modify the Apache httpd behavior, drop the .htaccess file in the application sources tree where appropriate. For details about .htaccess, see the Apache HTTP Server Tutorial.

7.3. PHP

7.3.1. Description

The rhscl/php-70-rhel7 image provides a PHP 7.0 platform for building and running applications, the rhscl/php-56-rhel7 image provides a PHP 5.6 platform.

7.3.2. Access

To pull the rhscl/php-70-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/php-70-rhel7

To pull the rhscl/php-56-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/php-56-rhel7

7.3.3. Configuration

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

The following environment variables set their equivalent property value in the php.ini file:

Variable NameDescriptionDefault

ERROR_REPORTING

Informs PHP of which errors, warnings and notices you would like it to take action for

E_ALL & ~E_NOTICE

DISPLAY_ERRORS

Controls whether or not and where PHP will output errors, notices and arnings

ON

DISPLAY_STARTUP_ERRORS

Cause display errors which occur during PHP’s startup sequence to be handled separately from display errors

OFF

TRACK_ERRORS

Store the last error/warning message in $php_errormsg (boolean)

OFF

HTML_ERRORS

Link errors to documentation related to the error

ON

INCLUDE_PATH

Path for PHP source files

.:/opt/app-root/src:/opt/rh/php56/root/usr/share/pear

SESSION_PATH

Location for session data files

/tmp/sessions

The following environment variable sets its equivalent property value in the opcache.ini file:

Variable NameDescriptionDefault

OPCACHE_MEMORY_CONSUMPTION

The OPcache shared memory storage size

16M

You can also override the entire directory used to load the PHP configuration by setting:

Variable NameDescription

PHPRC

Sets the path to the php.ini file

PHP_INI_SCAN_DIR

Path to scan for additional ini configuration files

In case the DocumentRoot of the application is nested within the source directory /opt/app-root/src, users can provide their own .htaccess file. This allows the overriding of Apache’s behavior and specifies how application requests should be handled. The .htaccess file needs to be located at the root of the application source. For details about .htaccess, see the Apache HTTP Server Tutorial.

7.4. Python

7.4.1. Description

The rhscl/python-35-rhel7 image provides a Python 3.5 platform for building and running applications. The rhscl/python-34-rhel7 image includes a Python 3.4 platform, and the rhscl/python-27-rhel7 image provides a Python 2.7 platform.

7.4.2. Access

To pull the rhscl/python-35-rhel7 image, run the following command as root:

# podman pull registry.access.redhat.com/rhscl/python-35-rhel7

To pull the rhscl/python-34-rhel7 image, run the following command as root:

# podman pull registry.access.redhat.com/rhscl/python-34-rhel7

To pull the rhscl/python-27-rhel7 image, run the following command as root:

# podman pull registry.access.redhat.com/rhscl/python-27-rhel7

7.4.3. Configuration

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

Variable NameDescription

APP_FILE

Used to run the application from a Python script. This should be a path to a Python file (defaults to app.py) that will be passed to the Python interpreter to start the application.

APP_MODULE

Used to run the application with Gunicorn, as documented here. This variable specifies a WSGI callable with the pattern MODULE_NAME:VARIABLE_NAME, where MODULE_NAME is the full dotted path of a module, and VARIABLE_NAME refers to a WSGI callable inside the specified module. Gunicorn will look for a WSGI callable named application if not specified. If APP_MODULE is not provided, the run script will look for a wsgi.py file in your project and use it if it exists. If using setup.py for installing the application, the MODULE_NAME part can be read from there. For an example, see setup-test-app.

APP_CONFIG

Path to a valid Python file with a Gunicorn configuration file.

DISABLE_COLLECTSTATIC

Set this variable to a non-empty value to inhibit the execution of manage.py collectstatic during the build. This affects only Django projects.

DISABLE_MIGRATE

Set this variable to a non-empty value to inhibit the execution of manage.py migrate when the produced image is run. This affects only Django projects.

7.5. Ruby

7.5.1. Description

The rhscl/ruby-24-rhel7 image provides a Ruby 2.4 platform for building and running applications; Node.js 6 is preinstalled for assets compilation.

The rhscl/ruby-23-rhel7 image provides a Ruby 2.3 platform for building and running applications; Node.js 4 is preinstalled for assets compilation.

The rhscl/ruby-22-rhel7 image provides a Ruby 2.2 platform; Node.js 0.10 is preinstalled for assets compilation.

7.5.2. Access

To pull the rhscl/ruby-24-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/ruby-24-rhel7

To pull the rhscl/ruby-23-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/ruby-23-rhel7

To pull the rhscl/ruby-22-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/ruby-22-rhel7

7.5.3. Configuration

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

Variable NameDescription

RACK_ENV

This variable specifies the environment where the Ruby application will be deployed (unless overwritten) - production, development, test. Each level has different behaviors in terms of logging verbosity, error pages, Ruby gem installation, and other. Note that application assets will be compiled only if the RACK_ENV is set to production.

DISABLE_ASSET_COMPILATION

This variable indicates that the asset compilation process will be skipped. Because this only takes place when the application is run in the production environment, it should be used only when assets are already compiled.

PUMA_MIN_THREADS, PUMA_MAX_THREADS

These variables indicate the minimum and maximum threads that will be available in Puma's thread pool.

PUMA_WORKERS

This variable indicates the number of worker processes that will be launched. See documentation on Puma’s clustered mode.

RUBYGEM_MIRROR

Set this variable to use a custom RubyGems mirror URL to download required gem packages during the build process.

For S2I scripts to work, you need to include the puma or rack gem in the application’s Gemfile.

7.6. Ruby on Rails

7.6.1. Description

The rhscl/ror-50-rhel7 provides a Ruby on Rails 5.0 platform for building and running applications and it contains Ruby 2.4, Ruby on Rails 5.0, and Node.js 6 preinstalled.

The rhscl/ror-42-rhel7 provides a Ruby on Rails 4.2 platform for building and running applications and it contains Ruby 2.3, Ruby on Rails 4.2, and Node.js 4 preinstalled.

The rhscl/ror-41-rhel7 provides a Ruby on Rails 4.1 platform and it contains Ruby 2.2, Ruby on Rails 4.1, and Node.js 0.10 preinstalled.

7.6.2. Access

To pull the rhscl/ror-50-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/ror-50-rhel7

To pull the rhscl/ror-42-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/ror-42-rhel7

To pull the rhscl/ror-41-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/ror-41-rhel7

7.6.3. Configuration

No further configuration is required.

The rhscl/ror-50-rhel7 image contains and enables the rh-ruby24, rh-ror50, and rh-nodejs6 Software Collections. The rhscl/ror-42-rhel7 image contains and enables the rh-ruby23, rh-ror42, and rh-nodejs4 Software Collections. The rhscl/ror-41-rhel7 image contains and enables the rh-ruby22, rh-ror41, and nodejs010 Software Collections.

For automatic S2I builds, use the Ruby container.

7.7. Phusion Passenger

7.7.1. Description

The rhscl/passenger-40-rhel7 image provides a Phusion Passenger 4.0 application server configured with Apache httpd web server. It also provides a Ruby 2.2 platform for building and running applications. Node.js 0.10 is preinstalled for assets compilation.

7.7.2. Access

To pull the rhscl/passenger-40-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/passenger-40-rhel7

7.7.3. Configuration

No further configuration is required; this image contains and enables the rh-ruby22, rh-ror41, nodejs010, rh-passenger40, and httpd24 Software Collections. It is especially designed to support automatic S2I builds.

7.8. Thermostat Agent

7.8.1. Description

The rhscl/thermostat-16-agent-rhel7 image provides a thermostat agent suitable for monitoring Java applications in containers.

The rhscl/thermostat-16-agent-rhel7 and rhscl/thermostat-1-agent-rhel7 images are no longer supported.

7.8.2. Access

To pull the rhscl/thermostat-16-agent-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/thermostat-16-agent-rhel7

7.8.3. Usage

The image is intended to be used as a base image for builder and runtime images in your Dockerfile using:

FROM rhscl/thermostat-16-agent-rhel7

See this example of a Dockerfile, which will have the Thermostat agent pre-installed.

Once the rhscl/thermostat-16-agent-rhel7 image has been introduced into the image hierarchy, the Thermostat agent can be started by setting the three required Thermostat environment variables. For example, an image called rhscl/thermostat-test uses rhscl/thermostat-16-agent-rhel7 as its base image and runs Java app foo on deployment. A Thermostat agent can be started together with foo by setting the following environment variables:

  • THERMOSTAT_AGENT_USERNAME
  • THERMOSTAT_AGENT_PASSWORD
  • THERMOSTAT_DB_URL

The rhscl/thermostat-16-storage-rhel7 image can be used to set up a storage endpoint for the agent to connect to.

7.8.4. Configuration

The image recognizes the following environment variables that you can set during initialization by passing -e VAR=VALUE to the docker run command:

Variable NameDescription

THERMOSTAT_AGENT_USERNAME

User name for the Thermostat agent to use connecting to storage

THERMOSTAT_AGENT_PASSWORD

Password for connecting to storage

THERMOSTAT_DB_URL

The URL for Thermostat storage

APP_USER

The application user the Java app Thermostat shall monitor runs as

7.9. Thermostat Storage

7.9.1. Description

The rhscl/thermostat-16-storage-rhel7 contains a Thermostat 1.6 storage, which provides a web endpoint for storing and retrieving data. This image is based on the rh-thermostat16 Software Collection.

The rhscl/thermostat-16-storage-rhel7 image is no longer supported.

7.9.2. Access

To pull the rhscl/thermostat-16-storage-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/thermostat-16-storage-rhel7

7.9.3. Usage

To run Thermostat storage connected to some other MongoDB backend (for example, provided by another container), you need to provide the MongoDB URL, mongo user name and password, and agent and client user names and passwords. Run the following command:

# docker run -d \
  -e MONGO_URL=mongodb://172.17.0.1:27017 \
  -e MONGO_USERNAME=<mongouser> \
  -e MONGO_PASSWORD=<mongopass> \
  -e THERMOSTAT_AGENT_USERNAMES=<agentuser1,agentuser2> \
  -e THERMOSTAT_AGENT_PASSWORDS=<agentpass1,agentpass2> \
  -e THERMOSTAT_CLIENT_USERNAMES=<clientuser1,clientuser2> \
  -e THERMOSTAT_CLIENT_PASSWORDS=<clientpass1,clientpass2> \
  --name thermostat16-storage \
  rhscl/thermostat-16-storage-rhel7

This will run a container with the HTTP layer connected to the MongoDB URL using the provided mongo user name and password. The container can be accessed at http://ip-address:8080/thermostat/storage with the appropriate client or agent credentials that you specified with the environment variables. To find the IP address, run the following command:

# docker inspect --format '\{\{ .NetworkSettings.IPAddress }}' thermostat16-storage

The command from the example above creates the following agent users:

  • agentuser1 with password agentpass1
  • agentuser2 with password agentpass2

Either one of them, or both, can be used for Thermostat agent connections.

In addition, the following client users will be usable:

  • clientuser1 with password clientpass1
  • clientuser2 with password clientpass2

Either one of them, or both, can be used for Thermostat client connections.

7.9.4. Configuration

The rhscl/thermostat-16-storage-rhel7 image recognizes the following environment variables that you can set during initialization by passing -e VAR=VALUE to the docker run command:

Variable NameDescription

THERMOSTAT_AGENT_USERNAMES

Space-separated list of user names for Thermostat agents to connect to storage

THERMOSTAT_AGENT_PASSWORDS

Space-separated list of passwords for agents connecting to storage

THERMOSTAT_CLIENT_USERNAMES

Space-separated list of user names for Thermostat clients to connect to storage

THERMOSTAT_CLIENT_PASSWORDS

Space-separated list of passwords for clients connecting to storage

MONGO_USERNAME

User name for the MongoDB backing storage

MONGO_PASSWORD

Password for the MongoDB backing storage

MONGO_URL

MongoDB URL to connect to

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.