Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.

Commit bbe8838

Browse files
authored
Merge pull request #52 from ibm-messaging/v2
Merge v2 feature branch
2 parents 0b2ed8c + dac4efa commit bbe8838

16 files changed

+735
-136
lines changed

server/listener.mqsc renamed to 10-listener.mqsc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* © Copyright IBM Corporation 2015, 2016
1+
* © Copyright IBM Corporation 2015, 2017
22
*
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change log
22

3+
## 2.0.0 (2017-03-11)
4+
### Action required
5+
* Ensure that you use the `REPLACE` keyword in all of your `DEFINE` MQSC statements. With this change, any supplied MQSC files are run *every* time the queue manager runs. This allows you to update the MQSC file, re-build the image, and then have the changes applied when you start a container based on that new image.
6+
* Code has been re-structured to use git branches for older versions of MQ.
7+
8+
### Other notable changes
9+
* Updated to MQ V9.0.1, adding the web console on port 9443.
10+
* Updated base image to Ubuntu 16.04
11+
* Set version number in command prompt dynamically
12+
* NFS and Bluemix Volume support added. (See: `setup-var-mqm.sh`). Note that it is now recommended to mount volumes into `/mnt/mqm` instead of `/var/mqm`.
13+
* Added MQ Developer Defaults, to provide better defaults for security, as well as queues and topics useful for development
14+
315
## 1.0.2 (2016-11-02)
416
* Add MQ V9
517
* Don't apply CMDLEVEL unless specifically requested

server/Dockerfile renamed to Dockerfile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# © Copyright IBM Corporation 2015, 2016
1+
# © Copyright IBM Corporation 2015, 2017
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,19 +12,17 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM ubuntu:14.04
15+
FROM ubuntu:16.04
1616

17-
MAINTAINER Arthur Barr <[email protected]>
17+
LABEL maintainer "Arthur Barr <[email protected]>"
1818

1919
# The URL to download the MQ installer from in tar.gz format
20-
ARG MQ_URL=http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev90_linux_x86-64.tar.gz
20+
ARG MQ_URL=http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev901_linux_x86-64.tar.gz
2121

2222
# The MQ packages to install
23-
ARG MQ_PACKAGES="MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm MQSeriesMsg*.rpm MQSeriesJava*.rpm MQSeriesJRE*.rpm MQSeriesGSKit*.rpm"
23+
ARG MQ_PACKAGES="MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm MQSeriesMsg*.rpm MQSeriesJava*.rpm MQSeriesJRE*.rpm MQSeriesGSKit*.rpm MQSeriesWeb*.rpm"
2424

2525
RUN export DEBIAN_FRONTEND=noninteractive \
26-
# Optional: Update the command prompt
27-
&& echo "mq:9.0" > /etc/debian_chroot \
2826
# Install additional packages required by MQ, this install process and the runtime scripts
2927
&& apt-get update -y \
3028
&& apt-get install -y --no-install-recommends \
@@ -37,6 +35,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
3735
gawk \
3836
grep \
3937
libc-bin \
38+
lsb-release \
4039
mount \
4140
passwd \
4241
procps \
@@ -51,7 +50,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
5150
&& tar -zxvf ./*.tar.gz \
5251
# Recommended: Create the mqm user ID with a fixed UID and group, so that the file permissions work between different images
5352
&& groupadd --gid 1000 mqm \
54-
&& useradd --uid 1000 --gid mqm --home-dir /var/mqm mqm \
53+
&& useradd --uid 1000 --gid mqm mqm \
5554
&& usermod -G mqm root \
5655
&& cd /tmp/mq/MQServer \
5756
# Accept the MQ license
@@ -62,17 +61,27 @@ RUN export DEBIAN_FRONTEND=noninteractive \
6261
&& /opt/mqm/bin/setmqinst -p /opt/mqm -i \
6362
# Clean up all the downloaded files
6463
&& rm -rf /tmp/mq \
65-
&& rm -rf /var/lib/apt/lists/*
64+
&& rm -rf /var/lib/apt/lists/* \
65+
# Optional: Update the command prompt with the MQ version
66+
&& echo "mq:$(dspmqver -b -f 2)" > /etc/debian_chroot \
67+
&& rm -rf /var/mqm \
68+
# Optional: Set these values for the Bluemix Vulnerability Report
69+
&& sed -i 's/PASS_MAX_DAYS\t99999/PASS_MAX_DAYS\t90/' /etc/login.defs \
70+
&& sed -i 's/PASS_MIN_DAYS\t0/PASS_MIN_DAYS\t1/' /etc/login.defs \
71+
&& sed -i 's/password\t\[success=1 default=ignore\]\tpam_unix\.so obscure sha512/password\t[success=1 default=ignore]\tpam_unix.so obscure sha512 minlen=8/' /etc/pam.d/common-password
6672

6773
COPY *.sh /usr/local/bin/
6874
COPY *.mqsc /etc/mqm/
75+
COPY admin.json /etc/mqm/
76+
77+
COPY mq-dev-config /etc/mqm/mq-dev-config
6978

7079
RUN chmod +x /usr/local/bin/*.sh
7180

7281
# Always use port 1414 (the Docker administrator can re-map ports at runtime)
73-
EXPOSE 1414
82+
# Expose port 9443 for the web console
83+
EXPOSE 1414 9443
7484

75-
# Always put the MQ data directory in a Docker volume
76-
VOLUME /var/mqm
85+
ENV LANG=en_US.UTF-8
7786

7887
ENTRYPOINT ["mq.sh"]

README.md

Lines changed: 119 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,34 @@
1+
# Contents
2+
* [Overview](#overview)
3+
* [Docker Hub](#docker-hub)
4+
* [Preparing your Docker host](#preparing-your-docker-host)
5+
* [Build](#build)
6+
* [Usage](#usage)
7+
* [Running with the default configuration](#running-with-the-default-configuration)
8+
* [Running on Bluemix with volumes](#running-on-bluemix-with-volumes)
9+
* [Customizing the queue manager configuration](#customizing-the-queue-manager-configuration)
10+
* [Running MQ commands](#running-mq-commands)
11+
* [Installed components](#installed-components)
12+
* [MQ developer defaults](#mq-developer-defaults)
13+
* [Customizing MQ developer defaults](#customizing-mq-developer-defaults)
14+
* [Web console](#web-console)
15+
* [List of all environment variables supported by this image](#list-of-all-environment-variables supported by this image)
16+
* [Troubleshooting](#troubleshooting)
17+
* [Container command not found or does not exist](#container-command-not-found-or-does-not-exist)
18+
* [AMQ7017: Log not available](#amq7017-log-not-available)
19+
* [Issues and contributions](#issues-and-contributions)
20+
* [License](#license)
21+
122
# Overview
223

324
Run [IBM® MQ](http://www-03.ibm.com/software/products/en/ibm-mq) in a Docker container. By default, the supplied Dockerfile runs [IBM MQ for Developers](http://www-03.ibm.com/software/products/en/ibm-mq-advanced-for-developers), but also works for IBM MQ. The source can be found on the [ibm-messaging GitHub](http://github.com/ibm-messaging/mq-docker). There's also a short [demo video](https://www.youtube.com/watch?v=BoomAVqk0cI) available.
425

526
# Docker Hub
627
The image is available on Docker Hub as [`ibmcom/mq`](https://hub.docker.com/r/ibmcom/mq/) with the following tags:
728

8-
* `9`, `latest` ([Dockerfile](https://github.com/ibm-messaging/mq-docker/blob/master/server/Dockerfile))
9-
* `8` ([Dockerfile](https://github.com/ibm-messaging/mq-docker/blob/master/server/Dockerfile-mq8))
29+
* `cd`, `9-cd`, `9`, `latest` ([Dockerfile](https://github.com/ibm-messaging/mq-docker/blob/master/server/Dockerfile))
30+
* `lts`, `9-lts` ([Dockerfile](https://github.com/ibm-messaging/mq-docker/blob/mq-9-lts/Dockerfile))
31+
* `8` ([Dockerfile](https://github.com/ibm-messaging/mq-docker/blob/mq-8/Dockerfile))
1032

1133
# Preparing your Docker host
1234
You need to make sure that you either have a Linux kernel version of V3.16, or else you need to add the [`--ipc host`](http://docs.docker.com/reference/run/#ipc-settings) option when you run an MQ container. The reason for this is that IBM MQ uses shared memory, and on Linux kernels prior to V3.16, containers are usually limited to 32 MB of shared memory. In a [change](https://git.kernel.org/cgit/linux/kernel/git/mhocko/mm.git/commit/include/uapi/linux/shm.h?id=060028bac94bf60a65415d1d55a359c3a17d5c31
@@ -16,13 +38,7 @@ You need to make sure that you either have a Linux kernel version of V3.16, or e
1638
After extracting the code from this repository, you can build an image with the latest version of MQ using the following command:
1739

1840
```
19-
sudo docker build --tag mq ./server/
20-
```
21-
22-
To build alternative versions, you can use commands similar to the following:
23-
24-
```
25-
sudo docker build --tag mq:8 --file ./server/Dockerfile-mq8 ./server/
41+
sudo docker build --tag mq .
2642
```
2743

2844
# Usage
@@ -31,27 +47,39 @@ In order to use the image, it is necessary to accept the terms of the IBM MQ lic
3147
This image is primarily intended to be used as an example base image for your own MQ images.
3248

3349
## Running with the default configuration
34-
You can run a queue manager with the default configuration and a listener on port 1414 using the following command. Note that the default configuration is locked-down from a security perspective, so you will need to customize the configuration in order to effectively use the queue manager. For example, the following command creates and starts a queue manager called `QM1`, and maps port 1414 on the host to the MQ listener on port 1414 inside the container:
50+
You can run a queue manager with the default configuration and a listener on port 1414 using the following command. Note that the default configuration is locked-down from a security perspective, so you will need to customize the configuration in order to effectively use the queue manager. For example, the following command creates and starts a queue manager called `QM1`, and maps port 1414 on the host to the MQ listener on port 1414 inside the container, as well as port 9443 on the host to the web console on port 9443 inside the container:
3551

3652
```
3753
sudo docker run \
3854
--env LICENSE=accept \
3955
--env MQ_QMGR_NAME=QM1 \
40-
--volume /var/example:/var/mqm \
56+
--volume /var/example:/mnt/mqm \
4157
--publish 1414:1414 \
58+
--publish 9443:9443 \
4259
--detach \
4360
mq
4461
```
4562

4663
Note that in this example, the name "mq" is the image tag you used in the previous build step.
4764

48-
Also note that the filesystem for the mounted volume directory (`/var/example` in the above example) must be [supported](http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.pla.doc/q005820_.htm?lang=en).
65+
Also note that the filesystem for the mounted volume directory (`/var/example` in the above example) must be [supported](http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.pla.doc/q005820_.htm?lang=en).
66+
67+
## Running on IBM Bluemix with volumes
68+
If you wish to run a queue manager with default configuration and a listener on port 1414, but using an IBM Bluemix volume to store your data you will need to mount the volume in a different directory than `/var/mqm`. When using a volume in Bluemix, special actions need to be taken in order to mount the IBM MQ data directory with the correct permissions on the volume. These actions are performed in the `setup-var-mqm.sh` script. The script is configured to look for a directory called `/mnt/mqm`, if it finds this then it will perform the special actions to create the IBM MQ data directory. When using mounting a volume to a Bluemix container you should mount the volume to the `/mnt/mqm` directory:
69+
70+
```
71+
bx ic run \
72+
--env LICENSE=accept \
73+
--env MQ_QMGR_NAME=QM1 \
74+
--volume /var/example:/mnt/mqm \
75+
mq
76+
```
4977

5078
## Customizing the queue manager configuration
5179
You can customize the configuration in several ways:
5280

53-
1. By creating your own image and adding your an MQSC file called `/etc/mqm/config.mqsc`. This file will be run when your queue manager is created.
54-
2. By using [remote MQ administration](http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q021090_.htm). Note that this will require additional configuration as remote administration is not enabled by default.
81+
1. By creating your own image and adding your own MQSC file into the `/etc/mqm` directory on the image. This file will be run when your queue manager is created.
82+
2. By using [remote MQ administration](http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_9.0.0/com.ibm.mq.adm.doc/q021090_.htm). Note that this will require additional configuration as remote administration is not enabled by default.
5583

5684
Note that a listener is always created on port 1414 inside the container. This port can be mapped to any port on the Docker host.
5785

@@ -61,13 +89,13 @@ The following is an *example* `Dockerfile` for creating your own pre-configured
6189
FROM mq
6290
RUN useradd alice -G mqm && \
6391
echo alice:passw0rd | chpasswd
64-
COPY config.mqsc /etc/mqm/
92+
COPY 20-config.mqsc /etc/mqm/
6593
```
6694

67-
Here is an example corresponding `config.mqsc` script from the [mqdev blog](https://www.ibm.com/developerworks/community/blogs/messaging/entry/getting_going_without_turning_off_mq_security?lang=en), which allows users with passwords to connect on the `PASSWORD.SVRCONN` channel:
95+
Here is an example corresponding `20-config.mqsc` script from the [mqdev blog](https://www.ibm.com/developerworks/community/blogs/messaging/entry/getting_going_without_turning_off_mq_security?lang=en), which allows users with passwords to connect on the `PASSWORD.SVRCONN` channel:
6896

6997
```
70-
DEFINE CHANNEL(PASSWORD.SVRCONN) CHLTYPE(SVRCONN)
98+
DEFINE CHANNEL(PASSWORD.SVRCONN) CHLTYPE(SVRCONN) REPLACE
7199
SET CHLAUTH(PASSWORD.SVRCONN) TYPE(BLOCKUSER) USERLIST('nobody') DESCR('Allow privileged users on this channel')
72100
SET CHLAUTH('*') TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(NOACCESS) DESCR('BackStop rule')
73101
SET CHLAUTH(PASSWORD.SVRCONN) TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(CHANNEL) CHCKCLNT(REQUIRED)
@@ -93,6 +121,80 @@ Using this technique, you can have full control over all aspects of the MQ insta
93121

94122
This image includes the core MQ server, Java, language packs, and GSKit. Other features (except the client) are not currently supported running in Docker. See the [MQ documentation](http://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.ins.doc/q008350_.htm) for details of which RPMs to choose.
95123

124+
## MQ Developer Defaults
125+
126+
This image includes the MQ Developer defaults scripts which are automatically ran during Queue Manager startup. This configures your Queue Manager with a set of default objects that you can use to quickly get started developing with IBM MQ. If you do not want the default objects to be created you can set the `MQ_DEV` environment variable to `false`.
127+
128+
#### Users
129+
**Userid:** admin
130+
**Groups:** mqm
131+
**Password:** passw0rd
132+
133+
**Userid:** app
134+
**Groups:** mqclient
135+
**Password:**
136+
137+
#### Queues
138+
* DEV.QUEUE.1
139+
* DEV.QUEUE.2
140+
* DEV.QUEUE.3
141+
* DEV.DEAD.LETTER.QUEUE - Set as the Queue Manager's Dead Letter Queue.
142+
143+
#### Channels
144+
* DEV.ADMIN.SVRCONN - Set to only allow the `admin` user to connect into it and a Userid + Password must be supplied.
145+
* DEV.APP.SVRCONN - Does not allow Administrator users to connect.
146+
147+
#### Listener
148+
* DEV.LISTENER.TCP - Listening on Port 1414.
149+
150+
#### Topic
151+
DEV.BASE.TOPIC - With a topic string of `dev/`.
152+
153+
#### Authentication information
154+
* DEV.AUTHINFO - Set to use OS as the user repository and adopt supplied users for authorization checks
155+
156+
#### Authority records
157+
* Users in `mqclient` group have been given access connect to all Queues and topics starting with `DEV.**` and have `put` `get` `pub` and `sub` permissions.
158+
159+
## Customizing MQ Developer Defaults
160+
161+
The MQ Developer Defaults supports some customization options, these are all controlled using environment variables:
162+
163+
* **MQ_DEV** - Set this to `false` to stop the Default objects being created.
164+
* **MQ_ADMIN_PASSWORD** - Changes the password of the `admin` user. Must be at least 8 characters long.
165+
* **MQ_APP_PASSWORD** - Changes the password of the app user. If set, this will cause the `DEV.APP.SVRCONN` channel to become secured and only allow connections that supply a valid userid and password. Must be at least 8 characters long.
166+
* **MQ_TLS_KEYSTORE** - Allows you to supply the location of a PKCS#12 keystore containing a single certificate which you want to use in both the web console and the queue manager. Requires `MQ_TLS_PASSPHRASE`. When enabled the channels created will be secured using the `TLS_RSA_WITH_AES_256_GCM_SHA384` CipherSpec. *Note*: you will need to make the keystore available inside your container, this can be done by mounting a volume to your container.
167+
* **MQ_TLS_PASSPHRASE** - Passphrase for the keystore referenced in `MQ_TLS_KEYSTORE`.
168+
169+
## Web Console
170+
171+
By default the image will start the IBM MQ Web Console that allows you to administer your Queue Manager running on your container. When the web console has been started, you can access it by opening a web browser and navigating to https://<Container IP>:9443/ibmmq/console. Where <Container IP> is replaced by the IP address of your running container.
172+
173+
When you navigate to this page you may be presented with a security exception warning. This happens because, by default, the web console creates a self-signed certificate to use for the HTTPS operations. This certificate is not trusted by your browser and has an incorrect distinguished name.
174+
175+
If you chose to accept the security warning, you will be presented with the login menu for the IBM MQ Web Console. The default login for the console is:
176+
177+
* **User:** admin
178+
* **Password:** passw0rd
179+
180+
If you wish to change the password for the admin user, this can be done using the `MQ_ADMIN_PASSWORD` environment variable. If you supply a PKCS#12 keystore using the `MQ_TLS_KEYSTORE` environment variable, then the web console will be configured to use the certificate inside the keystore for HTTPS operations.
181+
182+
If you do not wish the web console to run, you can disable it by setting the environment variable `MQ_DISABLE_WEB_CONSOLE` to `true`.
183+
184+
## List of all Environment variables supported by this image
185+
186+
* **LICENSE** - Set this to `accept` to agree to the MQ Advanced for Developers license. If you wish to see the license you can set this to `view`.
187+
* **LANG** - Set this to the language you would like the license to be printed in.
188+
* **MQ_QMGR_NAME** - Set this to the name you want your Queue Manager to be created with.
189+
* **MQ_QMGR_CMDLEVEL** - Set this to the `CMDLEVEL` you wish your Queue Manager to be started with.
190+
* **MQ_DEV** - Set this to `false` to stop the Default objects being created.
191+
* **MQ_ADMIN_PASSWORD** - Changes the password of the `admin` user. Must be at least 8 characters long.
192+
* **MQ_APP_PASSWORD** - Changes the password of the app user. If set, this will cause the `DEV.APP.SVRCONN` channel to become secured and only allow connections that supply a valid userid and password. Must be at least 8 characters long.
193+
* **MQ_TLS_KEYSTORE** - Allows you to supply the location of a PKCS#12 keystore containing a single certificate which you want to use in both the web console and the queue manager. Requires `MQ_TLS_PASSPHRASE`. When enabled the channels created will be secured using the `TLS_RSA_WITH_AES_256_GCM_SHA384` CipherSpec. *Note*: you will need to make the keystore available inside your container, this can be done by mounting a volume to your container.
194+
* **MQ_TLS_PASSPHRASE** - Passphrase for the keystore referenced in `MQ_TLS_KEYSTORE`.
195+
* **MQ_DISABLE_WEB_CONSOLE** - Set this to `true` if you want to disable the Web Console from being started.
196+
197+
96198
# Troubleshooting
97199

98200
## Container command not found or does not exist

admin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":0.1,"tabs":[{"title":"IBM MQ Container","numColumns":2,"model":{"title":"","rows":[{"columns":[{"widgets":[{"type":"channel","config":{"selectedQM":"<QM>","showSysObjs":false,"sizex":1,"sizey":1,"subType":"all"},"title":"Channels on <QM>","titleTemplateUrl":"adf/templates/widget-title.html","gridsterrow":0,"gridstercol":1},{"type":"topic","config":{"selectedQM":"<QM>","showSysObjs":false,"sizex":1,"sizey":1},"title":"Topics on <QM>","titleTemplateUrl":"adf/templates/widget-title.html","gridsterrow":1,"gridstercol":1},{"type":"queue","config":{"selectedQM":"<QM>","showSysObjs":false,"sizex":1,"sizey":1,"subType":"all"},"title":"Queues on <QM>","titleTemplateUrl":"adf/templates/widget-title.html","gridsterrow":1,"gridstercol":0},{"type":"queuemanager","gridstercol":0,"gridsterrow":0,"config":{"type":"local","sizex":1,"sizey":1,"customTitle":"Queue Manager"},"title":"Queue Manager","titleTemplateUrl":"adf/templates/widget-title.html"}]}]}],"titleTemplateUrl":"adf/templates/dashboard-title.html"},"isMobile":false}]}

0 commit comments

Comments
 (0)