IBM Sterling B2B: Install on Docker for Development

Follow this documentation to install Sterling B2B on Docker.

This setup is for development/proof-of-concept and was tested on my MacOs. I will not provide how to install docker on your O.S.

Procedure :

= Important =

By Knowledge center, you expose container ports using "--net=host", but in MacOS this not working. So you need to find the network used by docker containers.

= Create my Docker volumes =

We need to persist data from container, so i create a directory to do this:

Create my volumes mkdir -p /opt/DockerVolumes/mydb2 mkdir -p /opt/DockerVolumes/b2bi/resources

= Install DB2 on Docker =

Install DB2 on a Docker Container
Run this command

docker pull ibmcom/db2 docker run -d --name mydb2 --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=db2inst1 -v /opt/DockerVolumes/mydb2:/database ibmcom/db2

you can check install

docker logs -f mydb2

Create B2B database on DB2
Create a file create_db_b2b62.sql with the following data:

-- ***************************************************************** -- -- -- -- ***************************************************************** -- CODESET UTF-8 is mandatory for B2B !db2set DB2_SKIPDELETED=ON@ !db2set DB2_SKIPINSERTED=ON@ CREATE DATABASE B2B62 AUTOMATIC STORAGE YES USING CODESET UTF-8 TERRITORY DEFAULT COLLATE USING SYSTEM PAGESIZE 32768@ CONNECT TO B2B62@ CREATE BUFFERPOOL B2B62_04KBP IMMEDIATE SIZE AUTOMATIC PAGESIZE 4K@ CREATE BUFFERPOOL B2B62_08KBP IMMEDIATE SIZE AUTOMATIC PAGESIZE 8K@ CREATE BUFFERPOOL B2B62_16KBP IMMEDIATE SIZE AUTOMATIC PAGESIZE 16K@ CONNECT RESET@ CONNECT TO B2B62@ CREATE USER TEMPORARY TABLESPACE SCCUSERTMP PAGESIZE 32K BUFFERPOOL IBMDEFAULTBP@ CREATE REGULAR TABLESPACE TS_REG04_B2B62 PAGESIZE 4K BUFFERPOOL B2B62_04KBP PREFETCHSIZE AUTOMATIC@ CREATE REGULAR TABLESPACE TS_REG08_B2B62 PAGESIZE 8K BUFFERPOOL B2B62_08KBP PREFETCHSIZE AUTOMATIC@ CREATE REGULAR TABLESPACE TS_REG16_B2B62 PAGESIZE 16K BUFFERPOOL B2B62_16KBP PREFETCHSIZE AUTOMATIC@ CONNECT RESET@

Save file

Copy file to containter

docker cp create_db_b2b62.sql mydb2:/tmp

Connect to Docker container and run db2 commands docker exec -it mydb2 bash -c "su - db2inst1" cd /tmp db2 -td@ -vf ./create_db_b2b62.sql -z ./create_db_b2b62.log

run exit to logoff from container.

Copy jdbc driver to host machine
cd ˜/DockerVolumes/b2bi/resources docker cp mydb2:/opt/ibm/db2/V11.5/java/db2jcc4.jar. docker cp mydb2:/opt/ibm/db2/V11.5/java/db2jcc_license_cu.jar.

Only on MacOS: Looking ip address of docker container
> docker ps CONTAINER ID       IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                                          NAMES 44db51ad3f59       ibmcom/db2            "/var/db2_setup/lib/…"   3 days ago          Up 18 minutes       22/tcp, 55000/tcp, 60006-60007/tcp, 0.0.0.0:50000->50000/tcp   mydb2

Run

docker inspect 44db51ad3f59

in my case "IPAddress": "172.17.0.3",

you must setup  later.

= Install Sterling B2B on Docker =

Create a setup.cfg file
Change directory

cd ˜/DockerVolumes/b2bi/resources

Create setup.cfg file

UPGRADE=false
 * 1) Upgrade

LICENSE_ACCEPT_ENABLE_SFG=true LICENSE_ACCEPT_ENABLE_EBICS=true LICENSE_ACCEPT_ENABLE_FINANCIAL_SERVICES=true
 * 1) License - Specify values as true/false

SYSTEM_PASSPHRASE=passw0rd ENABLE_FIPS_MODE= NIST_COMPLIANCE_MODE=
 * 1) Security configurations
 * 1) FIPS compliance mode. Specify values as true/false
 * 1) NIST 800-131a compliance mode. Enter one of these values - strict/transition/off

INITIAL_PORT=5800
 * 1) Initial or base port

DB_VENDOR=db2 DB_USER=db2inst1 DB_PASSWORD=db2inst1 DB_HOST= DB_PORT=50000 DB_DATA=B2B62 DB_DRIVERS=db2jcc4.jar DB_CREATE_SCHEMA=true ORACLE_USE_SERVICE_NAME=false
 * 1) DB attributes

ADMIN_EMAIL_ADDRESS=demo@examplo.com SMTP_HOST=2525
 * 1) Email

SOFT_STOP_TIMEOUT=
 * 1) Miscellaneous

JMS_VENDOR= JMS_CONNECTION_FACTORY= JMS_CONNECTION_FACTORY_INSTANTIATOR= JMS_QUEUE_NAME= JMS_USERNAME= JMS_PASSWORD= JMS_CONNECTION_NAME_LIST= JMS_CHANNEL= JMS_ENABLE_SSL=false JMS_KEYSTORE_PATH= JMS_KEYSTORE_PASSWORD= JMS_TRUSTSTORE_PATH= JMS_TRUSTSTORE_PASSWORD= JMS_CIPHERSUITE= JMS_PROTOCOL=TLSv1.2
 * WMQ
 * 1) JMS properties are optional if JMS_VENDOR is empty
 * 2) To use IBMMQ for communication between ASI & AC, change property to JMS_VENDOR=IBMMQ
 * 3) and provide other connection details

LIBERTY_KEYSTORE_PASSWORD= LIBERTY_KEYSTORE_LOCATION= LIBERTY_PROTOCOL=TLSv1.2
 * 1) Liberty Profile SSL Config

LIBERTY_JVM_OPTIONS=
 * 1) jvm options. Example: LIBERTY_JVM_OPTIONS=-Xms256m;-Xmx512m

UPDATE_JCE_POLICY_FILE=false JCE_POLICY_FILE=
 * 1) JCE update parameters
 * 2) Set value true to update JCE
 * 1) Name of JCE file. This file should be present in mapped folder


 * 1) End of Configuration

Encrypting passwords
In this example i not encrypted password.

You can encrypt the following variables: SYSTEM_PASSPHRASE, DB_PASSWORD, JMS_PASSWORD, JMS_KEYSTORE_PASSWORD, JMS_TRUSTSTORE_PASSWORD, LIBERTY_KEYSTORE_PASSWORD

To do run the following command. Example:

echo passw0rd | openssl enc -aes-256-ecb -e -a -K 4254514F6C6C2B594650496373422B764D66584E54673D3D

After change

SYSTEM_PASSPHRASE=passw0rd

to the following

SYSTEM_PASSPHRASE=ENCRYPTED:SV/xIqkXTmUZ9byaBlKlIw==

Load docker images locally
You must download container images from Password Advantage site. After you must load Sterling B2B container image to local registry using the following command:

docker load -i STR_B2BI_6.0.2_CONTAINER_MP_ML.tar

you can check with the command:

docker images

take note of image-id

Run setup
Let's run b2bi setup using command:

docker run -e LICENSE="accept" -e TZ="America/Sao_Paulo" -d --name=b2bi -p 5800:5800 -p 9443:9443 -v /opt/DockerVolumes/b2bi/resources:/ibm/resources  b2bi_setup deploy_db

You can check the status using command:

> docker logs -f 

In my case: ... Total B2biSetup time: 01:04:14 Total B2biInDockerTotal time: 01:05:47

Run node1
docker run -e LICENSE="accept" -e TZ="America/Sao_Paulo" -d --name=b2bii -p 5800:5800 -p 9443:9443 -v /opt/DockerVolumes/b2bi/resources:/ibm/resources  b2bi_run all 1

= Ver também =


 * Artigos sobre IBM Sterling
 * Mais Artigos sobre Cloud / WebDev / Tecnologias