Skip to content

Commit 4242e49

Browse files
committed
Use MQ IPT from new location, and change base to UBI
1 parent d8f9e47 commit 4242e49

File tree

4 files changed

+35
-44
lines changed

4 files changed

+35
-44
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ test/messaging/target
88
build
99
coverage
1010
downloads
11-
incubating/mqipt/ms81*
11+
incubating/mqipt/*-IBM-MQIPT-*.tar*
1212
vendor/github.com/prometheus/client_model/bin/
1313
vendor/github.com/prometheus/client_model/.classpath
1414
vendor/github.com/prometheus/client_model/.project

incubating/mqipt/Dockerfile

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# © Copyright IBM Corporation 2018
1+
# © Copyright IBM Corporation 2018, 2023
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,21 +12,15 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM ibmcom/ibmjava:jre
16-
17-
ARG IPTFILE=ms81_2.1.0.4_amd64_linux_2.tar
18-
19-
COPY $IPTFILE /opt/
20-
21-
RUN rm -rf /var/lib/apt/lists/* \
22-
&& cd /opt/ \
23-
&& tar xvf ./$IPTFILE \
24-
&& chmod -R a-w /opt/mqipt
25-
26-
ENV MQIPT_PATH=/opt/mqipt
27-
15+
FROM registry.access.redhat.com/ubi8/ubi-minimal
16+
ARG MQIPT_ARCHIVE=./IBM-MQIPT-LinuxX64.tar
17+
RUN microdnf --disableplugin=subscription-manager install bash grep procps-ng sed which
18+
ADD $MQIPT_ARCHIVE /opt
2819
COPY startMQIPT.sh /usr/local/bin
29-
20+
ENV MQIPT_PATH=/opt/mqipt
21+
RUN chown -R 1001:0 $MQIPT_PATH \
22+
&& chown -R 1001:0 /usr/local/bin/startMQIPT.sh \
23+
&& chmod -R 550 /usr/local/bin/startMQIPT.sh
3024
VOLUME /var/mqipt
31-
32-
ENTRYPOINT ["startMQIPT.sh"]
25+
USER 1001
26+
ENTRYPOINT ["startMQIPT.sh"]

incubating/mqipt/README.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
1-
# IBM MQ Internet Pass-Thru (SupportPac MS81) on Docker
1+
# IBM MQ Internet Pass-Thru in a container
22

3-
IBM® MQ Internet Pass-Thru (MQIPT) is an extension to the base IBM MQ product. MQIPT runs as a stand-alone service that can receive and forward IBM MQ message flows, either between two IBM MQ queue managers or between an IBM MQ client and an IBM MQ queue manager.
3+
IBM® MQ Internet Pass-Thru (MQIPT) is an optional component of IBM MQ. MQIPT runs as a stand-alone service that can receive and forward IBM MQ message flows, either between two IBM MQ queue managers, or between an IBM MQ client and an IBM MQ queue manager.
44
MQIPT enables this connection when the client and server are not on the same physical network.
55

6-
This repository contains all of the resources you will need to create a Docker image containing MQIPT for use in your infrastructure.
6+
This repository contains all the resources that you will need to create a container image that contains MQIPT.
77

88
## How to build this image
99

10-
1. First download MQIPT from the [IBM MQ SupportPacs website](http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg27007198#3). MQIPT is a `Category 3 - Product Extensions SupportPacs` with the identifier `MS81`.
10+
1. Download MQIPT for Linux x86_64 from [Fix Central](https://ibm.biz/mq93ipt). The name of the download file is similar to `9.3.x.x-IBM-MQIPT-LinuxX64.tar.gz`.
1111
2. Ensure the MQIPT downloaded tar file is available in this directory.
12-
3. If the tar file is not called `ms81_2.1.0.4_amd64_linux_2.tar` you will need to either:
13-
* Rename the file.
14-
* Supply the new name as a `--build-arg IPTFILE=<new name>` when executing the docker build command in the next step.
15-
* Alter the Dockerfile `IPTFILE` ARG to specify the new file name.
16-
4. Run the following command in this directory to build the Docker image. `docker build -t mqipt .`
12+
3. Run the following command in this directory to build the container image:
13+
`docker build --build-arg MQIPT_ARCHIVE=<tar_file_name> -t mqipt .`
1714

18-
Once the Docker build has completed you will have a new Docker image called `mqipt:latest` available which contains MQIPT.
15+
Once the build has completed you will have a new container image called `mqipt:latest` which contains MQIPT.
1916

2017
## How to run this image
2118

22-
Before you run the MQIPT docker image you should understand how MQIPT operates, please ensure you have read the [MQIPT knowledgecenter](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ipt.doc/ipt0000_.htm) and any documentation supplied with the MQIPT installation tar.
19+
Before you run the MQIPT container image you should understand how MQIPT operates. You can read about MQIPT in the [IBM MQ documentation](https://www.ibm.com/docs/en/ibm-mq/9.3?topic=overview-mq-internet-pass-thru).
2320

24-
First you need to create your [MQIPT configuration file](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ipt.doc/ipt2540_.htm) and place this file in a directory that can be [mounted to a docker container](https://docs.docker.com/storage/). This file **must** be called `mqipt.conf`; there is a sample file available in the MQIPT installation tar.
21+
1. Create a MQIPT home directory that can be [mounted to a container](https://docs.docker.com/storage/). The MQIPT home directory contains configuration files and log files that are produced when MQIPT runs.
22+
2. Create your [MQIPT configuration file](https://www.ibm.com/docs/en/ibm-mq/9.3?topic=reference-mq-internet-pass-thru-configuration) in the MQIPT home directory. This file **must** be called `mqipt.conf`. A sample configuration file is supplied with MQIPT in `samples/mqiptSample.conf`.
23+
3. Run the following command to start a container with your built MQIPT image:
24+
`docker run -d --volume <mqiptHome>:/var/mqipt -p <hostPort>:<containerPort> mqipt`
25+
where `mqiptHome` is the MQIPT home directory you created in step 1, and `containerPort` is a port to be exposed that MQIPT is listening on, such as a route port.
2526

26-
Run the following command to start a container with your built MQIPT image:
27+
If you want the container ports to be accessible outside of the host you must expose the required ports. This maps the container port to a port on the host, so that you can connect to the port on the host and access MQIPT. You might need to provide more than one `-p` parameters to expose all the ports that are required by your MQIPT configuration. **Note:** These ports must be available on the host. If the ports are not available, the Docker container will not start.
2728

28-
`docker run -d --volume <path to config>:/var/mqipt -p 1414:1414 mqipt`
29-
30-
If you want the container ports to be accessible outside of the host you must expose the required ports, this will map the container port to a port on the host, meaning you can connect to that port on the host and access MQIPT. You will need to provide multiple `-p` parameters to expose all of the ports required by your MQIPT configuration. **Note:** these must be available otherwise the docker container will fail to start.
31-
32-
See [Docker Run reference](https://docs.docker.com/engine/reference/run/#expose-incoming-ports) for more information on how to expose container ports.
29+
For more information about how to expose container ports, see [Docker Run reference](https://docs.docker.com/engine/reference/run/#expose-incoming-ports).
3330

3431
## Further information
3532

36-
For further information on MQIPT please view the [MQIPT knowledgecenter](https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ipt.doc/ipt0000_.htm)
33+
For more information about MQIPT, see MQIPT documentation in the [IBM MQ documentation](https://www.ibm.com/docs/en/ibm-mq/9.3?topic=overview-mq-internet-pass-thru).
3734

3835
## License
3936

40-
The Dockerfiles and associated code and scripts are provided as-is and licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
37+
The Dockerfile and associated code and scripts are provided as-is and licensed under the [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
4138

4239
## Copyright
4340

44-
© Copyright IBM Corporation 2018
41+
© Copyright IBM Corporation 2018, 2023

incubating/mqipt/startMQIPT.sh

100755100644
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# -*- mode: sh -*-
3-
# © Copyright IBM Corporation 2018
3+
# © Copyright IBM Corporation 2018, 2023
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,13 +16,13 @@
1616

1717
stop()
1818
{
19-
/opt/mqipt/bin/mqiptAdmin -stop
19+
/opt/mqipt/bin/mqiptAdmin -stop -n ipt1
2020
}
2121

2222
trap stop SIGTERM SIGINT
2323

2424
# Run MQIPT and then wait on the process to end.
25-
/opt/mqipt/bin/mqipt /var/mqipt &
26-
MQIPTPROCESS=$!
25+
/opt/mqipt/bin/mqipt /var/mqipt -n ipt1 &
2726

28-
wait "$MQIPTPROCESS"
27+
MQIPTPROCESS=$!
28+
wait "$MQIPTPROCESS"

0 commit comments

Comments
 (0)