Discussion
Pegasystems Inc.
IT
Last activity: 26 Oct 2018 5:05 EDT
Building WebLogic 12.2.1.2.0 Pega Docker Image
This Docker image prepares an Oracle WebLogic Server (a developer desktop licensed version of WebLogic Server) image for development purposes by creating a sample domain preconfigured to run Pega applications.
The following instructions are for building the WebLogic Proprietary information hidden.0 Pega Docker image using Linux.
Datasource and JMS resources are automatically configured according to the Pega Platform Installation Guide for Oracle WebLogic Server using the datasource.properties file.
You can find the Pega Platform Installation Guide for Oracle WebLogic Server for your Pega platform version here: https://community.pega.com/knowledgebase/products/platform
Pega archives placed in the /pega/deploy directory are automatically deployed.
Split-Schema installations are supported using Pega 7 deployment plan.
The domain name is base_domain
Pega 7 platform versions supported
- Pega 7.3
- Pega 7.3.1
- Pega 7.4
Build Prerequisites
Download the following prerequisites and copy them to the directory where the Docker build file (Dockerfile) is stored.
- Oracle WebLogic Server Proprietary information hidden.0 - Generic Installer (developer desktop licensed version) WebLogic Download Page
- Oracle Java JDK 8u171 - 64-bit RedHat package Java Download Page
Run Prerequisites
A database with the Pega rulebase must be installed and connected to the Docker container.
Volumes
At runtime, the image exposes the following mount point as volumes:
/pega
Ports
The admin server listens to port 7001. This port can be exposed and mapped to a different host port while running the container for the first time.
WebLogic Console
WebLogic Console app is reachable at ip_address:<mapped_port>/console
Domain admin credentials are: weblogic/Pegasys1+
Note: you can change the password by providing a different one in the ADMIN_PASSWORD variable when the container is run. For example:
- e 'ADMIN_PASSWORD=my_password'
Build
$ docker build -t prpc_wls:12.2.1 .
Run
Prepare the datasource
Edit the datasource.properties file and provide the JDBC connection details. The following datasource.oracle.properties Oracle based sample is placed in pega/etc
datasource.name=PegaRules
datasource.database.name=PEGA
datasource.target=AdminServer
datasource.filename=PegaRules.xml
datasource.jndiname=jdbc/PegaRULES
datasource.driver.class=oracle.jdbc.OracleDriver
datasource.url=jdbc:oracle:thin:@oradb:1521/pega
datasource.username=PEGA_DATA
datasource.password=PEGA
datasource.pool.initialSize=10
datasource.pool.maxSize=60
datasource.test.query=SQL SELECT 1 FROM DUAL
The docker --link run option can be used to reference the database container using an alias. In the above sample (datasource.url=jdbc:oracle:thin:@oradb:1521/pega) the database alias oradb is referenced in the JDBC URL and must be provided at runtime in this way:
--link <db_container_name>:oradb
Prepare the host directories
Create the expected folder structure in your system.
The local pega directory can be used as a template.
/pega
Within this directory the following directories are expected:
/deploy
Place the archives to be automatically deployed at runtime in this directory.
/etc
Place the datasource configuration file and the standard Pega configuration files in this directory. The standard Pega configuration files are:
* datasource.properties
* adminDatasource.properties (optional)
* prbootstrap.properties
* prconfig.xml
* prlogging.xml
* prlog4j2.xml
/tmp
This will be used as Pega temporary directory
/logs
This directory is assigned to the ${pega.log.location} environment variable. Ensure that the prlogging.xml or prlog4j2.xml file (the file to use depends on the logging configuration selected) is updated to include this variable in file paths.
/lib
Place here the JDBC driver referenced by the -e DRIVER= run option
Run command
Run WebLogic in interactive mode using as_wls1221_ora_740 as host and container name, exposing port 7741, linking a database container db-pega-740 using the db alias, using the JDBC driver dbdriver.jar, mounting the host path obtained via bash command $(pwd) on the container volume /pega
$ docker run -it -p 7740:7001 -h as_wls1221_ora_740 --name=as_wls1221_ora_740 \
--link db-pega-740:db \
-v $(pwd):/pega \
-e 'DRIVER=dbdriver.jar' \
-e 'USER_MEM_ARGS=-Xms2048m -Xmx4096m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=1024m -XX:ReservedCodeCacheSize=256m -XX:+UseCodeCacheFlushing' \
- e 'ADMIN_PASSWORD=my_password' \
prpc_wls:12.2.1
More details about the used arguments:
Argument |
Required |
Description |
-it |
No |
Launches the container in interactive mode. The Server logs are provided in the output. Pressing CTRL+C will halt the container |
-p 7740:7001 |
No |
Exposes the container port 7001 on the host port 7740. |
-h <hostname> |
Yes |
Assigns a static hostname to the container |
--name=<ContainerName> |
No |
Assigns a static name to the container. This name will be used by Docker to identify the container |
-v $(pwd):/pega
|
Yes |
Creates a bind mount point for the pega directory |
-e DRIVER=<DriverName> |
Yes |
Uses the specified JDBC driver. The driver must be placed in the /pega/lib directory |
-e 'USER_MEM_ARGS=...' |
No |
Uses the JAVA Options provided |
-e 'ADMIN_PASSWORD=my_password' |
No |
Uses a custom password for the WebLogic admin account |
prpc_wls:12.2.1 |
Yes |
The image to run |
Dual-User Configuration
The Admin Datasource is required to automatically apply DML statements to the Pega Schemas.
Note: To inform Pega about the Admin Datasource availability, the following environment entries are required.
prconfig/database/databases/PegaRULES/dataSourceAdmin
prconfig/database/databases/PegaDATA/dataSourceAdmin
These string entries must contain the JNDI name of the Admin Datasource(s). Since WebLogic doesn't allow to add custom entries to the JNDI tree the Application Deployment Descriptors must be used instead.
The deployment plan in /pega/deploy/prpc/plan takes care of providing values for those entries.
Stopping 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.
Starting an existing container
$ docker start -i -a <Container_Name>
Attached are the files from my sample. I hope this is useful to you!