Running IBM ACE in Docker container on Ubuntu
Table of Contents
- Introduction
- Why should I care?
- Download IBM ACE
- Standalone IBM ACE Dockerfile
- IBM ACE with MQ
- Build Dockerfile
- Test it
Introduction
IBM ACE is a powerful integration framework. Prior to version 11, in order to run message broker, you needed IBM MQ on your system. Now it comes in two flavors. Either you use it together with IBM MQ or standalone.
Why should I care?
In my experience, most of the integrations are still running on Integration Node that has dependency on MQ. Either because it’s still running on an older version of message broker (IIB 10), or the change in existing infrastructure is not a priority.
In addition to this, the existing integrations belong to various protocols, SOAP, REST, MQ, HTTP…
What happens when for some reason your MQ is down? Well, since there is tight dependency between Integration Node and MQ, it means that the entire Integration Node is down. As a consequence, the integration services that don’t require MQ to run, are not available.
Why would you limit and risk your environment to a single point of failure?
In this tutorial, I’ll provide you with both versions. Which one you’ll choose, depends solely on your requirements.
In case you are not interested in preparing Docker image yourself, you can run either image version from my Dockerhub.
docker run -dt --name ace ivansla/my-repo:my-ace
# or
docker run -dt --name ace ivansla/my-repo:my-ace-with-mq
Download IBM ACE
As a first step to prepare your Docker container with IBM ACE, download the installation archive from here. As we are installing IBM ACE on Ubuntu, make sure that you download Linux version. eg. 12.0.8.0-ACE-LINUX64-DEVELOPER.tar.gz
Once downloaded, navigate to your download folder and execute this command in order to run the local http server on port 9000, that the Dockerfile will use to install IBM ACE.
python3 -m http.server 9000
As this command will lock your terminal window, please open another terminal window and run the following command to obtain your IP address.
ivansla@BloodRayne:~/$ hostname -I
192.168.15.8 172.17.0.1 172.18.0.1
It’s possible you’ll get multiple addresses after executing the command, however you should note only the one starting with 192.
Standalone IBM ACE Dockerfile
Copy the lines below to your local Dockerfile. There are two variables to pay attention to, ACE_FILE and ACE_URL. Make sure that ACE_FILE variable has exactly the same name as the ACE installation file (in my case 12.0.8.0-ACE-LINUX64-DEVELOPER.tar.gz) you have downloaded. In addition, check that ACE_URL variable has the IP address that the command hostname -I, provided you (in my case 192.168.15.8).
FROM ubuntu:20.04
VOLUME /home
RUN groupadd --gid 1001 aceadmin
RUN useradd --uid 1001 --gid aceadmin -s /bin/bash --create-home --home-dir /home/aceadmin aceadmin
ARG ACE_FILE=12.0.8.0-ACE-LINUX64-DEVELOPER.tar.gz
ARG ACE_URL=http://192.168.15.8:9000/$ACE_FILE
RUN export DEBIAN_FRONTEND=noninteractive \
# Install additional packages required by MQ, this install process and the runtime scripts
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
bash \
bc \
coreutils \
curl \
debianutils \
findutils \
gawk \
grep \
libc-bin \
mount \
passwd \
procps \
rpm \
sed \
tar \
vim \
telnet \
iputils-ping \
rsyslog \
less \
util-linux \
ca-certificates \
# Setting default shell to bash for new users \
&& sed -i 's/SHELL=\/bin\/sh/SHELL=\/bin\/bash/g' /etc/default/useradd \
# Download and extract the ACE installation files \
&& mkdir -p /tmp/ace \
&& mkdir -p /opt/ibm \
&& cd /tmp/ace \
&& curl -LO $ACE_URL \
&& tar -zxvf ./*.tar.gz -C /opt/ibm \
&& cd /opt/ibm/ace* \
&& ./ace make registry global accept license silently \
&& rm -rf /tmp/ace \
&& echo "source /opt/ibm/ace-*/server/bin/mqsiprofile" >> /home/aceadmin/.profile
RUN usermod -a -G mqbrkrs aceadmin
RUN usermod -a -G mqbrkrs root
COPY --chmod=500 ace-setup.sh /home/aceadmin/ace-setup.sh
COPY --chmod=500 --chown=aceadmin ace-start.sh /home/aceadmin/ace-start.sh
COPY --chmod=500 start.sh /home/aceadmin/start.sh
COPY --chmod=544 icc-shift.sh /etc/profile.d/icc-shift.sh
RUN ["/home/aceadmin/ace-setup.sh", "INode01"]
ENTRYPOINT ["/home/aceadmin/start.sh", "INode01"]
This Dockerfile requires additional script files in order to be executed successfully. Please create them in the same folder where you created the Dockerfile.
ace-setup.sh
This script will create an Integration Node as well as Integration Server attached to it with the name default.
#!/bin/bash
setup() {
local integrationNodeName=$1
su - aceadmin -c "mqsicreatebroker --integration-node ${integrationNodeName} --workpath /home/aceadmin/mqsi"
su - aceadmin -c "mqsistart ${integrationNodeName}"
su - aceadmin -c "mqsicreateexecutiongroup ${integrationNodeName} -e default"
}
setup $1
ace-start.sh
This script is responsible to keep container running as long as Integration Node is running.
#!/bin/bash
RUNNING="BIP1325I"
SLEEP_FOR_SECONDS=15
isRunningACE() {
local integrationNodeName=$1
local integrationNodeStatus="$(mqsilist | grep ${integrationNodeName} | grep ${RUNNING})"
# Keep container live while Integration Node is Running
while [[ "${integrationNodeStatus}" == *"${RUNNING}"* ]]
do
sleep $SLEEP_FOR_SECONDS
integrationNodeStatus="$(mqsilist | grep ${integrationNodeName} | grep ${RUNNING})"
echo "Checking Integration Node Status: ${integrationNodeStatus}" >> /home/aceadmin/heartbeat.log
done
}
start() {
local integrationNodeName=$1
mqsistart ${integrationNodeName}
isRunningACE ${integrationNodeName}
}
start $1
icc-shift.sh
An environment variable required on AMD processors to run IBM ACE and IBM MQ without problems.
# can solve problem for creating keystore on AMD processors. https://github.com/ibm-messaging/mq-container/issues/462
export ICC_SHIFT=3
start.sh
A script responsible to start IBM ACE Integration Node at Docker entrypoint.
#!/bin/bash
start() {
su - aceadmin -c ". ace-start.sh $1"
}
start $1
IBM ACE with MQ
This Dockerfile uses MQ Docker image as a base. If you don’t have one, you can either let Docker download from my Dockerhub repository, or you can follow my guide and create it yourself.
What’s important to note here, is to pay attention to variables ACE_FILE and ACE_URL, as it was the case with standalone version.
FROM ivansla/my-repo:my-mq
VOLUME /home
RUN groupadd --gid 1001 aceadmin
RUN useradd --uid 1001 --gid aceadmin -s /bin/bash --create-home --home-dir /home/aceadmin aceadmin
ARG ACE_FILE=12.0.8.0-ACE-LINUX64-DEVELOPER.tar.gz
ARG ACE_URL=http://192.168.15.8:9000/$ACE_FILE
RUN export DEBIAN_FRONTEND=noninteractive \
# Download and extract the ACE installation files \
&& mkdir -p /tmp/ace \
&& mkdir -p /opt/ibm \
&& cd /tmp/ace \
&& curl -LO $ACE_URL \
&& tar -zxvf ./*.tar.gz -C /opt/ibm \
&& cd /opt/ibm/ace* \
&& ./ace make registry global accept license silently \
&& rm -rf /tmp/ace \
&& echo "source /opt/ibm/ace-*/server/bin/mqsiprofile" >> /home/aceadmin/.profile
RUN usermod -a -G mqbrkrs,mqm aceadmin
RUN usermod -a -G mqbrkrs root
COPY --chmod=500 ace-setup.sh /home/aceadmin/ace-setup.sh
COPY --chmod=500 init.sh /var/scripts/init.sh
RUN ["/home/aceadmin/ace-setup.sh", "QMgr01"]
ENTRYPOINT ["/home/mqm/mq-start.sh", "QMgr01"]
This Dockerfile depends only on ace-setup.sh and init.sh.
init.sh
This script simply starts Integration Node. It is called from mq-start.sh (already included in base container) as a part of startup sequence.
#!/bin/bash
init() {
local queueManagerName=$1
su - aceadmin -c "mqsistart ${queueManagerName}" > /home/aceadmin/init.log
}
init $1
Build Dockerfile
Once you have all the scripts in one place. Run the following commands to build and start your Docker container.
docker build --tag={your dockerhub username}/{your dockerhub repository}:my-ace .
docker run -dt --name ace {your dockerhub username}/{your dockerhub repository}:my-ace
docker network create my-network
docker network connect my-network ace
docker network inspect my-network
docker exec -ti ace bash
These commands will also create your local docker network and provide you with the IP address of the running container.
Your output should look similar to this:
"ConfigOnly": false,
"Containers": {
"d612447d9f066b013afd5265dae2e31f7082feaa7ba0547842bc4c46110f3ee9": {
"Name": "ace",
"EndpointID": "8a4eafa254cd78ac9186fdd83b59c9177dc730ab9cb6c236bbc50d0f5e796efc",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
root@d612447d9f06:/#
Make a note of IPv4Address, as that is the address, we’ll use to connect to the Administration Console.
Test it
Now that you have running container, it’s time to test it by opening IBM ACE Web Administration Console in your browser. Open your favorite web browser and navigate to: http://{your IP address}:4414 (in my case http://172.18.0.2:4414). Your Administration Console should show Integration Node INode01, and Integration Server default.
Well that’s all folks, now you are ready to start doing some serious application development.