Chapter 8. Daemon Images

8.1. Apache HTTP Server

8.1.1. Description 3

The rhscl/httpd-24-rhel7 image provides an Apache HTTP 2.4 Server; the rhscl-beta/httpd-24-rhel7 image includes the changes provided by the updated httpd24 Software Collection distributed with Red Hat Software Collections 3.2 Beta. The image can be used as a base image for other applications based on Apache HTTP web server.

8.1.2. Access

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

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

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

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

The rhscl/httpd-24-rhel7 image supports using the S2I tool.

8.1.3. Configuration

The Apache HTTP Server container image supports the following configuration variables, which can be set by using the -e option with the docker run command:

Variable NameDescription

HTTPD_LOG_TO_VOLUME

By default, httpd logs into standard output, so the logs are accessible by using the docker logs command. When HTTPD_LOG_TO_VOLUME is set, httpd logs into /var/log/httpd24, which can be mounted to host system using the container volumes.

HTTPD_MPM

This variable can be set to change the default Multi-Processing Module (MPM) from the package default MPM.

If you want to run the image and mount the log files into /wwwlogs on the host as a container volume, execute the following command:

$ docker run -d -u 0 -e HTTPD_LOG_TO_VOLUME=1 --name httpd -v /wwwlogs:/var/log/httpd24:Z rhscl/httpd-24-rhel7

To run an image using the event MPM (rather than the default prefork), execute the following command:

$ docker run -d -e HTTPD_MPM=event --name httpd rhscl/httpd-24-rhel7

You can also set the following mount points by passing the -v /host:/container option to the docker run command:

Volume Mount PointDescription

/var/www

Apache HTTP Server data directory

/var/log/httpd24

Apache HTTP Server log directory (available only when running as root)

When mouting a directory from the host into the container, ensure that the mounted directory has the appropriate permissions and that the owner and group of the directory matches the user UID or name which is running inside the container.

Note

The rhscl/httpd-24-rhel7 container image now uses 1001 as the default UID to work correctly within the source-to-image strategy in OpenShift. Additionally, the container image listens on port 8080 by default. Previously, the rhscl/httpd-24-rhel7 container image listened on port 80 by default and ran as UID 0.

To run the rhscl/httpd-24-rhel7 container image as UID 0, specify the -u 0 option of the docker run command:

docker run -u 0 rhscl/httpd-24-rhel7

Replace the rhscl/httpd-24-rhel7 image name with rhscl-beta/httpd-24-rhel7 in the commands above when using the Beta image.

8.2. nginx

8.2.1. Description

The rhscl-beta/nginx-114-rhel7 image provides an nginx 1.14 server and a reverse proxy server; the image can be used as a base image for other applications based on nginx 1.14 web server. The rhscl/nginx-112-rhel7 image provides an nginx 1.12 server and a reverse proxy server.

8.2.2. Access

To pull the rhscl-beta/nginx-114-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl-beta/nginx-114-rhel7

To pull the rhscl/nginx-112-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/nginx-112-rhel7

8.2.3. Configuration

The nginx container images support the following configuration variable, which can be set by using the -e option with the docker run command:

Variable NameDescription

NGINX_LOG_TO_VOLUME

By default, nginx logs into standard output, so the logs are accessible by using the docker logs command. When NGINX_LOG_TO_VOLUME is set, nginx logs into /var/opt/rh/rh-nginx114/log/nginx/ or /var/log/nginx112, which can be mounted to host system using the container volumes.

The rhscl-beta/nginx-114-rhel7 and rhscl/nginx-112-rhel7 images support using the S2I tool.

8.3. Varnish Cache

8.3.1. Description

The rhscl-beta/varnish-6-rhel7 image provides Varnish Cache 6.0, an HTTP reverse proxy; the rhscl/varnish-5-rhel7 image provides Varnish Cache 5.0.

8.3.2. Access

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

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

To pull the rhscl/varnish-5-rhel7 image, run the following command as root:

# docker pull registry.access.redhat.com/rhscl/varnish-5-rhel7

8.3.3. Configuration

No further configuration is required.

The rhscl-beta/varnish-6-rhel7 and rhscl/varnish-5-rhel7 images support using the S2I tool. Note that the default.vcl configuration file in the directory accessed by S2I needs to be in the VCL format.