Discussion
Pegasystems Inc.
IT
Last activity: 10 Aug 2018 11:29 EDT
Building JBoss EAP 7 Pega Docker Image
This Docker image creates a JBoss Enterprise Application Platform (EAP) 7.0.x standalone instance pre-configured to run Pega applications that run on an Oracle database.
Application server configuration is applied when container is booted for the first time by the Docker entry point script provided: entrypoint.sh
The Docker entry point invokes the jboss-cli script PegaConfig.cli to configure the standalone instance according to Pega Installation Guide by using the datasources defined in the properties file: pega/etc/datasources.properties
You can find the Pega Platform Installation Guide for JBoss RedHat for your Pega platform version here:
https://community.pega.com/knowledgebase/products/platform (Deployment Guides > Pega Platform 7.4 Installation Guides for JBoss RedHat)
Pega archives placed in the /pega/deploy directory are automatically deployed.
Note: This image is meant to work only with Oracle databases. For example, the Oracle JDBC driver for Java 8 ojdbc8.jar is expected in the pega/lib directory.
Pega 7 versions supported
Pega 7.4
Build Prerequisites
Download the following prerequisites and copy them in the directory specified below.
- RedHat JBoss EAP 7.0.x Application Platform
Download jboss-eap-7.0.x.zip from RedHat JBoss EAP webpage
This file must be placed in the media directory. - RedHat JBoss EAP 7 patches
Cumulative patches for a ZIP or Installer installation of JBoss EAP are available to download from the Red Hat Customer Portal.
These files must be placed in the media/patches directory
Run Prerequisites
A PegaRULES database must be already installed and reachable from the docker container.
Volumes
At run time, the image exposes the following mount point as volumes:
/pega
Ports
The following ports are exposed:
- JBOSS_MGMT_NATIVE_PORT 9999
- JBOSS_MGMT_HTTP_PORT 9990
- JBOSS_HTTP_PORT 8080
JBoss Console
JBoss Console app is available at http://<container_address>:9990/console
Administrator credentials are admin/Pegasys1+
Build
$ docker build -t prpc_jboss:7 .
Run
Prepare the datasource
Edit the datasources.properties file and provide the JDBC connection details. The following datasources.properties Oracle-based sample is placed in pega/etc
base.datasource.name=PegaRULES
base.datasource.driver.name=oracle
base.datasource.jndi.name=java:/jdbc/PegaRULES
base.datasource.url=jdbc:oracle:thin:@db:1521/pega.oracle.xe
base.datasource.username=PEGA_DATA
base.datasource.password=PEGA
base.datasource.pool.initialSize=10
base.datasource.pool.maxSize=60
admin.datasource.name=AdminPegaRULES
admin.datasource.driver.name=oracle
admin.datasource.jndi.name=java:/jdbc/AdminPegaRULES
admin.datasource.url=jdbc:oracle:thin:@db:1521/pega.oracle.xe
admin.datasource.username=PEGA_INSTALL
admin.datasource.password=PEGA
admin.datasource.pool.initialSize=1
admin.datasource.pool.maxSize=5
rules.defaultSchemaName=PEGA_RULES
data.defaultSchemaName=PEGA_DATA
The docker --link run option can be used to reference the database container using an alias. In the properties files above, the database alias db is referenced in the JDBC URL and must be provided at run time by mapping the db alias with the name of a running Oracle container oracle_container_name. For example, --link oracle_container_name:db
Prepare the host directories
Create the necessary folder structure in your computer. Use the local pega directory as a template.
/pega - In this directory the following directories are expected:
Directory |
Description |
/deploy |
Place the archives to be automatically deployed at run time in this directory. |
/etc |
Place the datasource configuration file and the standard Pega configuration files in this directory: * datasources.properties * prbootstrap.properties * prconfig.xml * prlog4j2.xml |
/tmp |
Use this directory as the Pega temporary directory. |
/logs |
This directory is assigned to the ${pega.log.location} env variable. Ensure that the prlog4j2.xml file is updated to include this variable in file paths. |
/lib |
Place the Oracle JDBC driver here. |
Run command
Run JBoss 7 in standalone mode using as-jboss7-ora-740 as host name, remapping container port 8080 to host port 9740, linking a running database container named db-oraxe-pega-740 using the db alias, mounting the host path at the current working directory on the container volume /pega
$ docker run -it -p 9740:8080 \
-h as-jboss7-ora-740 \
--name=as_jboss7_ora_740 \
--link db-oraxe-pega-740:db \
-v $(pwd):/pega \
prpc_jboss:7
Arguments for the docker run command
Argument |
Description |
-it |
Runs the container in interactive mode. The Server logs are provided in the output. Pressing CTRL+C halts the container. |
-p 9740:8080 |
Exposes the container port 8080 on the host port 9740. |
-h <hostname> |
Assigns a static host name to the container Note: JBoss does not accept a host name with underscore characters. If underscores are used in the host name, the standalone instance will not boot correctly. |
--name=<containerName> |
Assigns a static name to the container |
--link db-oraxe-pega-740:db |
Links the running database container named db-oraxe-pega-740 The JBoss container can reach the database using the db hostname. |
-v $(pwd):/pega |
Creates a bind mount point for the pega directory using the current host directory |
prpc_jboss:7 |
Specifies the image to run |
Stop a running container
Attach an interactive console to the container.
This is not required if you run the container with the -i option:
$ docker attach --sig-proxy=true Container_Name
Press CTRL+C to stop the container.
Start an existing container
$ docker start -i -a <Container_Name>
Attached are the files from my sample. I hope this is useful to you!