Setting up the Docker® context
To build the required Docker images, the context for building them must be established as described in the Docker build command description.
The following components provide this context:
- The artifacts that you downloaded by following the steps that are described in GitHub repo.
- The
release.zip
andStaticContent.zip
files that you built in Building the SPM application.
Building IBM® Social Program Management (SPM) resources
Some of the Docker images that you build rely on the release.zip
and StaticContent.zip
files that you built in Building the SPM application.
If you built release.zip
and StaticContent.zip
on a different computer to the one where container environment will be deployed, you must transfer the files to the computer you’re currently working on.
For simplicity, it is assumed that these files are copied to /tmp/
.
Preparing the SPM environment
Prepare the SPM Docker environment by using the release.zip
file.
For the following steps, use the $SPM_HOME
folder that you created in GitHub repo.
- To create a
release-stage
folder to contain the contents ofrelease.zip
, run the following command:
mkdir $SPM_HOME/dockerfiles/Liberty/content/release-stage
mkdir $env:SPM_HOME\dockerfiles\Liberty\content\release-stage
- To extract
release.zip
into therelease-stage
folder, run the following commands:
unzip -qd $SPM_HOME/dockerfiles/Liberty/content/release-stage /tmp/release.zipchmod +x $SPM_HOME/dockerfiles/Liberty/content/release-stage/*.sh
unzip -qd $env:SPM_HOME\dockerfiles\Liberty\content\release-stage $env:TMP\release.zip
Where /tmp/release.zip
(or for Windows: $env:TMP\release.zip
) is the absolute path where the release.zip
is saved.
Modifying SPM properties
Bootstrap.properties
and AppServer.properties
are required to configure WebSphere® Liberty.
However the relevant properties in Bootstrap.properties
that you modify in the on-premise implementation of SPM are no longer relevant because Kubernetes configmaps provide the necessary values for the database configuration.
The only properties that you must modify in AppServer.properties
are security.username
and security.password
.
These properties contain the WebSphere Liberty administrator credentials.
If the password is changed, the value must be re-encrypted by running the following commands and updating AppServer.properties
with the new encrypted password:
./build.sh encrypt -Dpassword=<The password to be encrypted>
cd %SERVER_DIR%build.bat encrypt -Dpassword=<The password to be encrypted>
Copy the property files by using the following command:
cd $SPM_HOME/dockerfiles/Liberty/contentcp -vf *.properties release-stage/project/properties/
cd $env:SPM_HOME\dockerfiles\Liberty\content\copy *.properties .\release-stage\project\properties\ -Force
WebSphere Liberty server configuration
All configuration of WebSphere Liberty will be handled by the Helm Charts. See the Preparing Helm Charts topic for more information.
Copying static content artifacts
Copy the static content .zip
file for Docker image creation. Run the following command:
cp -vf /tmp/StaticContent.zip $SPM_HOME/dockerfiles/HTTPServer/
copy $env:TMP\StaticContent.zip $env:SPM_HOME\dockerfiles\HTTPServer\ -Force
Installing external artifacts
In addition to release.zip
and StaticContent.zip
, download and install the following artifacts.
Add the Ant zip file to the Docker environment
Copy apache-ant-1.10.6-bin.zip
to $SPM_HOME/dockerfiles/Liberty/content
. If Ant is not already available on the computer, run the following commands:
cd $SPM_HOME/dockerfiles/Liberty/contentwget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.6-bin.zip
cd $env:SPM_HOME\dockerfiles\Liberty\contentwget https://archive.apache.org/dist/ant/binaries/apache-ant-1.10.6-bin.zip
CryptoConfig.jar
CryptoConfig.jar
is required for SPM cryptography to function correctly. This jar is automatically created in the following locations when you run the
build.sh configtest
target:
$SERVER_DIR/build/CryptoConfig.jar
$JAVA_HOME/jre/lib/ext/CryptoConfig.jar
However, the release.zip
does not include this jar file, so the jar file must be copied separately from the environment where the release.zip
was built.
Place the CryptoConfig.jar
file in $SPM_HOME/dockerfiles/Liberty/content/release-stage/build
.
For convenience, you can use a docker container to create the CryptoConfig.jar
file.
Note the use of $ANT_HOME
environment variable in the following docker run
command.
This value must map to a working copy of Ant on your workstation.
If you do not have a copy of Ant locally you can extract it from $SPM_HOME
using:
unzip -qd /tmp/ $SPM_HOME/dockerfiles/Liberty/content/apache-ant-1.10.6-bin.zipexport ANT_HOME=/tmp/apache-ant-1.10.6
unzip -qd $env:TMP $env:SPM_HOME\dockerfiles\Liberty\content\apache-ant-1.10.6-bin.zip$env:ANT_HOME = "$env:TMP\apache-ant-1.10.6"
docker run --rm \-v $ANT_HOME:/tmp/ant \-v $SPM_HOME/dockerfiles/Liberty/content/release-stage:/work/dir \-v $SPM_HOME/dockerfiles/Liberty/content/release-stage/SetEnvironment.sh:/work/SetEnvironment.sh \-w /work/dir \-u root \-e ANT_HOME=/tmp/ant \-e WLP_HOME=/opt/ibm/wlp \ibmcom/websphere-liberty:24.0.0.6-full-java8-ibmjava-ubi \
docker run --rm `-v $env:ANT_HOME\:/tmp/ant `-v $env:SPM_HOME\dockerfiles\Liberty\content\release-stage\:/work/dir `-v $env:SPM_HOME\dockerfiles\Liberty\content\release-stage\SetEnvironment.sh:/work/SetEnvironment.sh `-w /work/dir `-u root `-e ANT_HOME=/tmp/ant `-e WLP_HOME=/opt/ibm/wlp `ibmcom/websphere-liberty:24.0.0.6-full-java8-ibmjava-ubi `
Installing javax.mail.jar and activation.jar files
Java Mail is an external dependency for SPM and is represented by the JAR files activation.jar
and javax.mail.jar
.
Place these files in the folder $SPM_HOME/dockerfiles/Liberty/content/dependencies
(filenames must be exact, that is, have no version numbers).
If you do not have the jar files available, you can use the getJavaMail.xml
Ant file that is located in the $SPM_HOME/dockerfiles/Liberty/content
folder to download the files:
cd $SPM_HOME/dockerfiles/Liberty/content$ANT_HOME/bin/ant -f getJavaMail.xml
cd $env:ANT_HOME\bin.\ant.bat -f $env:SPM_HOME\dockerfiles\Liberty\content\getJavaMail.xml
Confirm the availability of the JAR files by running the following command:
ls $SPM_HOME/dockerfiles/Liberty/content/dependencies
Downloading IBM MQ Resource Adapter
IBM MQ is required for WebSphere Liberty JMS support, therefore you must install the MQ Resource Adapter.
Download the IBM MQ resource adapter from Fix Central.
Click this link: IBM MQ Resource Adapter
Find the resource adapter for your version of IBM MQ in the displayed list of available fixes. For example:
release level: 9.2.4.0-IBM-MQ-Java-InstallRAContinuous Delivery: 9.2.4 IBM MQ Resource Adapter for use with Application ServersThen click the resource adapter file name and follow the download process.
Copy the downloaded file (
V.R.M.F-IBM-MQ-Java-InstallRA.jar
) to$SPM_HOME/dockerfiles/Liberty/content/
.