此内容没有您所选择的语言版本。
Chapter 7. Application Images
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 Name | Description | Default |
---|---|---|
| Allows the installation of all specified cpan packages and the running of their tests |
|
| Specifies a mirror URL which will used by cpanminus to install dependencies | URL is not specified by default |
| 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 |
| 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 Name | Description | Default |
---|---|---|
| Informs PHP of which errors, warnings and notices you would like it to take action for |
|
| Controls whether or not and where PHP will output errors, notices and arnings |
|
| Cause display errors which occur during PHP’s startup sequence to be handled separately from display errors |
|
|
Store the last error/warning message in |
|
| Link errors to documentation related to the error |
|
| Path for PHP source files |
|
| Location for session data files |
|
The following environment variable sets its equivalent property value in the opcache.ini
file:
Variable Name | Description | Default |
---|---|---|
| The OPcache shared memory storage size | 16M |
You can also override the entire directory used to load the PHP configuration by setting:
Variable Name | Description |
---|---|
|
Sets the path to the |
| 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 Name | Description |
---|---|
|
Used to run the application from a Python script. This should be a path to a Python file (defaults to |
|
Used to run the application with Gunicorn, as documented here. This variable specifies a WSGI callable with the pattern |
| Path to a valid Python file with a Gunicorn configuration file. |
|
Set this variable to a non-empty value to inhibit the execution of |
|
Set this variable to a non-empty value to inhibit the execution of |
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 Name | Description |
---|---|
|
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 |
| 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. |
| These variables indicate the minimum and maximum threads that will be available in Puma's thread pool. |
| This variable indicates the number of worker processes that will be launched. See documentation on Puma’s clustered mode. |
| 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 Name | Description |
---|---|
| User name for the Thermostat agent to use connecting to storage |
| Password for connecting to storage |
| The URL for Thermostat storage |
| 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 passwordagentpass1
-
agentuser2
with passwordagentpass2
Either one of them, or both, can be used for Thermostat agent connections.
In addition, the following client users will be usable:
-
clientuser1
with passwordclientpass1
-
clientuser2
with passwordclientpass2
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 Name | Description |
---|---|
| Space-separated list of user names for Thermostat agents to connect to storage |
| Space-separated list of passwords for agents connecting to storage |
| Space-separated list of user names for Thermostat clients to connect to storage |
| Space-separated list of passwords for clients connecting to storage |
| User name for the MongoDB backing storage |
| Password for the MongoDB backing storage |
| MongoDB URL to connect to |