• This repository has been archived on 06/May/2020
  • Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    Shell
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[DEPRECATED] Sample Docker image for IBM® MQ

DEPRECATED.  Please use ibm-messaging/mq-container instead

Build Status

Deprecated sample - contents

Important

This repository is deprecated. There is a new code base for running MQ in containers. It is highly recommended that you use this new code base if possible. The new code base is where active development is happening, and is more robust, with better tests.

Overview

Run IBM® MQ in a Docker container. By default, the supplied Dockerfile runs IBM MQ for Developers, but also works for IBM MQ. The source can be found on the ibm-messaging GitHub. There's also a short demo video available.

Docker Hub

A pre-built version of this image is available on Docker Hub as ibmcom/mq with the following tags:

Docker Store

A pre-built version of this image is available on Docker Store.

IBM Cloud Container Service

A pre-built version of this image is available on the IBM Cloud Container Registry, as an IBM Public Repository.

Build

After extracting the code from this repository, you can build an image with the latest version of MQ using the following command:

docker build --tag mq .

Usage

In order to use the image, it is necessary to accept the terms of the IBM MQ license. This is achieved by specifying the environment variable LICENSE equal to accept when running the image. You can also view the license terms by setting this variable to view. Failure to set the variable will result in the termination of the container with a usage statement. You can view the license in a different language by also setting the LANG environment variable.

Running with the default configuration

You can run a queue manager with the default configuration and a listener on port 1414 using the following command. 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:

docker run \
  --env LICENSE=accept \
  --env MQ_QMGR_NAME=QM1 \
  --publish 1414:1414 \
  --publish 9443:9443 \
  --detach \
  ibmcom/mq

Running with the default configuration and a volume

The above example will not persist any configuration data or messages across container runs. In order to do this, you need to use a volume. For example, you can create a volume with the following command:

docker volume create qm1data

You can then run a queue manager using this volume as follows:

docker run \
  --env LICENSE=accept \
  --env MQ_QMGR_NAME=QM1 \
  --publish 1414:1414 \
  --publish 9443:9443 \
  --detach \
  --volume qm1data:/mnt/mqm \
  ibmcom/mq

The Docker image always uses /mnt/mqm for MQ data, which is correctly linked for you under /var/mqm at runtime. This is to handle problems with file permissions on some platforms.

Customizing the queue manager configuration

You can customize the configuration in several ways:

  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.
  2. By using remote MQ administration, via an MQ command server, the MQ HTTP APIs, or using a tool such as the MQ web console or MQ Explorer.

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.

The following is an example Dockerfile for creating your own pre-configured image, which adds a custom config.mqsc and an administrative user alice. Note that it is not normally recommended to include passwords in this way:

FROM ibmcom/mq
RUN useradd alice -G mqm && \
    echo alice:passw0rd | chpasswd
COPY 20-config.mqsc /etc/mqm/

Here is an example corresponding 20-config.mqsc script from the mqdev blog, which allows users with passwords to connect on the PASSWORD.SVRCONN channel:

DEFINE CHANNEL(PASSWORD.SVRCONN) CHLTYPE(SVRCONN) REPLACE
SET CHLAUTH(PASSWORD.SVRCONN) TYPE(BLOCKUSER) USERLIST('nobody') DESCR('Allow privileged users on this channel')
SET CHLAUTH('*') TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(NOACCESS) DESCR('BackStop rule')
SET CHLAUTH(PASSWORD.SVRCONN) TYPE(ADDRESSMAP) ADDRESS('*') USERSRC(CHANNEL) CHCKCLNT(REQUIRED)
ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) ADOPTCTX(YES)
REFRESH SECURITY TYPE(CONNAUTH)

Running MQ commands

It is recommended that you configure MQ in your own custom image. However, you may need to run MQ commands directly inside the process space of the container. To run a command against a running queue manager, you can use docker exec, for example:

docker exec \
  --tty \
  --interactive \
  ${CONTAINER_ID} \
  dspmq

Using this technique, you can have full control over all aspects of the MQ installation. Note that if you use this technique to make changes to the filesystem, then those changes would be lost if you re-created your container unless you make those changes in volumes.

Installed components

This image includes the core MQ server, Java, language packs, and GSKit. This can be configured by setting the MQ_PACKAGES Docker build argument.

MQ Developer Defaults

This image includes the MQ Developer defaults scripts which are automatically run 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.

Users

Userid: admin Groups: mqm Password: passw0rd

Userid: app Groups: mqclient Password:

Queues

  • DEV.QUEUE.1
  • DEV.QUEUE.2
  • DEV.QUEUE.3
  • DEV.DEAD.LETTER.QUEUE - Set as the Queue Manager's Dead Letter Queue.

Channels

  • DEV.ADMIN.SVRCONN - Set to only allow the admin user to connect into it and a Userid + Password must be supplied.
  • DEV.APP.SVRCONN - Does not allow Administrator users to connect.

Listener

  • DEV.LISTENER.TCP - Listening on Port 1414.

Topic

DEV.BASE.TOPIC - With a topic string of dev/.

Authentication information

  • DEV.AUTHINFO - Set to use OS as the user repository and adopt supplied users for authorization checks

Authority records

  • 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.

Customizing MQ Developer Defaults

The MQ Developer Defaults supports some customization options, these are all controlled using environment variables:

  • MQ_DEV - Set this to false to stop the Default objects being created.
  • MQ_ADMIN_PASSWORD - Changes the password of the admin user. Must be at least 8 characters long.
  • 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.
  • 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.
  • MQ_TLS_PASSPHRASE - Passphrase for the keystore referenced in MQ_TLS_KEYSTORE.

Web Console

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://:9443/ibmmq/console. Where is replaced by the IP address of your running container.

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.

If you choose 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:

  • User: admin
  • Password: passw0rd

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.

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.

List of all Environment variables supported by this image

  • 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.
  • LANG - Set this to the language you would like the license to be printed in.
  • MQ_QMGR_NAME - Set this to the name you want your Queue Manager to be created with.
  • MQ_QMGR_CMDLEVEL - Set this to the CMDLEVEL you wish your Queue Manager to be started with.
  • MQ_DEV - Set this to false to stop the Default objects being created.
  • MQ_ADMIN_PASSWORD - Changes the password of the admin user. Must be at least 8 characters long.
  • 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.
  • 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.
  • MQ_TLS_PASSPHRASE - Passphrase for the keystore referenced in MQ_TLS_KEYSTORE.
  • MQ_DISABLE_WEB_CONSOLE - Set this to true if you want to disable the Web Console from being started.

Troubleshooting

Container command not found or does not exist

This message also appears as "System error: no such file or directory" in some versions of Docker. This can happen using Docker Toolbox on Windows, and is related to line-ending characters. When you clone the Git repository on Windows, Git is often configured to convert any UNIX-style LF line-endings to Windows-style CRLF line-endings. Files with these line-endings end up in the built Docker image, and cause the container to fail at start-up. One solution to this problem is to stop Git from converting the line-ending characters, with the following command:

git config --global core.autocrlf input

AMQ7017: Log not available

If you see this message in the container logs, it means that the directory being used for the container's volume doesn't use a filesystem supported by IBM MQ. This often happens when using Docker Toolbox or boot2docker, which use tmpfs for the /var directory. To solve this, you need to make sure the container's /var/mqm volume is put on a supported filesystem. For example, with Docker Toolbox try using a directory under /mnt/sda1. You can list filesystem types using the command df -T

Older Linux kernel versions

MQ works best if you have a Linux kernel version of V3.16 or higher (run uname -r to check).

If you have an older version, you might need to add the --ipc host 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 to Linux kernel V3.16, the hard-coded limit is greatly increased. This kernel version is available in Ubuntu 14.04.2 onwards, Fedora V20 onwards, and boot2docker V1.2 onwards. Some Linux distributions, like Red Hat Enterprise Linux, patch older kernel versions, so you might find that the patch has been applied already, even if you see a lower kernel version number. If you are using a host with an older kernel version, then you can still run MQ, but you have to give it access to the host's IPC namespace using the --ipc host option on docker run. Note that this reduces the security isolation of your container.

Issues and contributions

For issues relating specifically to this Docker image, please use the GitHub issue tracker. For more general issues relating to IBM MQ or to discuss the Docker technical preview, please use the messaging community. If you do submit a Pull Request related to this Docker image, please indicate in the Pull Request that you accept and agree to be bound by the terms of the IBM Contributor License Agreement.

License

The Dockerfiles and associated scripts are licensed under the Apache License 2.0. Licenses for the products installed within the images are as follows:

  • IBM MQ Advanced for Developers (International License Agreement for Non-Warranted Programs). This license may be viewed from the image using the LICENSE=view environment variable as described above or by following the link above.
  • License information for Ubuntu packages may be found in /usr/share/doc/${package}/copyright

Note: The IBM MQ Advanced for Developers license does not permit further distribution and the terms restrict usage to a developer machine.

More Repositories

1

mq-container

Container images for IBM® MQ
Go
212
star
2

mq-dev-patterns

Code samples and messaging patterns for IBM MQ developers
JavaScript
181
star
3

mq-jms-spring

Components to assist MQ JMS integration with Spring frameworks
Java
177
star
4

mq-golang

Calling IBM MQ from Go applications
Go
157
star
5

event-streams-samples

Java
91
star
6

kafka-connect-mq-source

This repository contains a Kafka Connect source connector for copying data from IBM MQ into Apache Kafka.
Java
86
star
7

mq-mqi-nodejs

Calling IBM MQ from Node.js - a JavaScript MQI wrapper
JavaScript
74
star
8

mq-dev-samples

Samples for getting started with IBM MQ
Java
62
star
9

mq-metric-samples

IBM® MQ metric gathering client samples
Go
58
star
10

kafka-java-vertx-starter

Starter Java app for testing connection to Apache Kafka with Vert.x
JavaScript
44
star
11

mq-rfhutil

Message creation, editing and replay to help test MQ and IIB/ACE applications. Previously released as IH03 RFHUTIL SupportPac
C++
42
star
12

kafka-connect-jdbc-sink

This repository contains a Kafka Connect sink connector for copying data from Apache Kafka into databases using JDBC.
Java
34
star
13

mqtt-ios-sample

Sample iOS app using MQTT
Objective-C
34
star
14

mq-ansible

Ansible roles for IBM MQ
Python
30
star
15

mq-helm

Smarty
28
star
16

kafka-connect-mq-sink

This repository contains a Kafka Connect sink connector for copying data from Apache Kafka into IBM MQ.
Java
28
star
17

mq-golang-jms20

JMS style messaging interface for Golang applications connecting to IBM MQ
Go
26
star
18

mqperf

Repository for MQ related performance documents
22
star
19

mqlight-docker

Docker image for IBM MQ Light
Shell
22
star
20

mq-aws

Sample code for running IBM® MQ on Amazon Web Services (AWS)
Shell
21
star
21

kafka-connect-rabbitmq-source

This repository contains a Kafka Connect source connector for copying data from RabbitMQ into Apache Kafka.
Java
19
star
22

message-hub-rest

JavaScript
17
star
23

mq-q-qload

This repository contains the code from IBM MQ SupportPacs MA01 (q) and MO03 (qload)
C
17
star
24

mqtt-PickMeUp

Objective-C
16
star
25

mq-dev-badge-sample

Sample code of the MQ developer essentials badge
HTML
13
star
26

mq-chef

Chef cookbook for installing and configuring IBM® MQ
Ruby
13
star
27

mq-container-mft

Samples for integrating MQ MFT in Cloud scenarios
Go
13
star
28

mq-azure

This repository contains information and samples etc. relating to using IBM MQ on Microsoft Azure
Shell
12
star
29

mq-rdqm

Repository for the Replicated Data Queue Manager feature of IBM MQ
PowerShell
11
star
30

mq-tls-ssl-wizard

A wizard to help configure your MQ SSL/TLS connections
Java
11
star
31

mq-cph

The IBM MQ C Performance Harness
C++
10
star
32

mq-rexx-api

A REXX interface to issue MQ API calls - previously known as Supportpac MA95
C
9
star
33

mq-mqsc-editor-plugin

A plug-in for the MQ Explorer to help edit and execute MQSC scripts
HTML
8
star
34

mq-exits

A collection of sample IBM MQ exits
C
8
star
35

mqldt

IBM MQ Log Disk Tester
C
8
star
36

mq-appliance

This repository contains information and samples relating to the IBM MQ Appliance
Perl
7
star
37

mq-camel

A place for samples that describes IBM MQ and Apache Camel integration
Java
7
star
38

mq-openstack

Sample code for running IBM® MQ on OpenStack
Shell
6
star
39

kafka-connect-ibmcos-sink

This repository contains a Kafka Connect sink connector for copying data from Apache Kafka into IBM Cloud Object Storage
Java
6
star
40

mqlight-fishalive-node

Node.js MQ Light fishalive sample
JavaScript
6
star
41

jmstestp

Environment for creating a docker image running jms performance tests for Persistent and Non Persistent messaging.
Shell
6
star
42

mq-mft

Repository for IBM MQ Managed File Transfer documents, samples etc
Java
6
star
43

mq-event-display

Java
6
star
44

mq-cloud-demo

Sample scenario and applications for demonstrating the IBM MQ on Cloud service
JavaScript
6
star
45

mq-dotnet-administration-with-mqrestapi

This repository provides .NET samples which help in doing basic IBM MQ Queue/Channel Administration using IBM MQ REST API's
C#
6
star
46

cphtestp

Environment for creating a docker image running cph performance tests for Persistent and Non-Persistent messaging against an MQ Queue Manager.
Shell
6
star
47

mq-smf-csv

Simple formatter for MQ's SMF records to assist with import to spreadsheets and databases
C
6
star
48

mq-dotnet-samples

C#
5
star
49

cp4i-mq-samples

Samples to showcase connecting to a queue manager running as part of IBM Cloud Pak for Integration
Shell
5
star
50

macaque

Flask style library for microservices with MQ Light
Python
5
star
51

mq-cluster-tool

A tool to query and visualize your IBM MQ Clusters using a graph
Java
5
star
52

mq-atom-mqsc

Repository for the MQSC syntax hightlighting code used in the Atom text editor
5
star
53

kafka-connect-xml-converter

A Kafka Connect plugin to make it easier to work with XML data in Kafka Connect pipelines
Java
5
star
54

kafka-connect-elastic-sink

Kafka Connector to deliver events into Elasticsearch
Java
4
star
55

mq-wlm-client

Java
4
star
56

seneca-mqlight-transport

DEPRECATED: Implementation of a transport layer for using MQ Light with the Seneca microservices framework
JavaScript
4
star
57

mft-sample-web-ui

IBM MQ Managed File Transfer REST API
JavaScript
4
star
58

mq-python-json

Repo showing example(s) of how to consume and parse MQ event messages in Python
Python
4
star
59

mqlight-worker-thread

This repository contains a lab based on the worker thread use case for MQ Light
JavaScript
4
star
60

mq-sample-web-ui

A sample web page that uses the MQ administrative REST API
JavaScript
4
star
61

event-streams-docs

4
star
62

mq-asyncapi-java-template

This repository is no longer used and the project is now hosted within the ASyncAPI organisation.
JavaScript
4
star
63

ms03.saveqmgr

ms03-saveqmgr
C
3
star
64

mqlight-sentiment-sample

Files for MQ Light Lab at Impact
PHP
3
star
65

mqtt-smartboard

Java
3
star
66

mq-rexx-utils

This tool provides rexx execs to take output from CSQUTIL or runmqsc and create HTML pages so you can compare and contrast the differences on MQ object and their attributes. Differences are highlighted. You can display all attributes, or just different attributes.
HTML
3
star
67

mqlight-python-bluemix

MQ Light Python sample for Bluemix
HTML
3
star
68

mq-ansible-yaml-commands

IBM MQ Ansible Collection to issue YAML form commands to MQ queue managers
2
star
69

mq-ssl

This repository will contain a Wiki describing how to configure SSL with MQ in a couple of scenarios.
2
star
70

mq-pvc-tool

A tool for inspecting the Persistent Volume Claims associated with Queue Manager pods on OpenShift
Shell
2
star
71

mq-mi

Repository for information, samples etc. relating to IBM MQ Multi Instance queue manager support
C
2
star
72

mq-sfbridge-demo

IBM MQ Salesforce bridge demo in Docker
Shell
2
star
73

mqlight-fishalive-ruby

Ruby MQ Light fishalive sample
HTML
2
star
74

mqldt-c

Containerized version of mqldt
Dockerfile
2
star
75

mqtt-home-automation

This repository will contain an example of using MQTT to publish information about a house and controlling some aspects by publishing MQTT messages
2
star
76

iperf3-client

Configuration to build and run iperf3 client images
Dockerfile
2
star
77

ibm-messaging.github.io

WebSite for IBM Messaging
CSS
2
star
78

mq-ibmcloud

Sample code for running IBM® MQ on IBM Cloud (e.g. Bluemix / SoftLayer)
Java
2
star
79

mq-scratch-extension

Repo hosting the ScratchX.org extension for IBM MQ using the IBM MQ REST API
JavaScript
2
star
80

mq-mqfts

IBM MQ Managed File Transfer Log Capture Utility
Go
2
star
81

mqtt-status-pattern

This repository contains an example showing a pattern of usage of MQTT that makes available the status of MQTT clients.
C
2
star
82

kafka-connect-weather-source

This repository contains a Kafka Connect source connector for importing data from the IBM Weather Service into Apache Kafka.
Java
2
star
83

MFT-REST-java-sample

Java
2
star
84

homebrew-ibmmq

Homebrew tap for IBM MQ formulae and casks
Ruby
2
star
85

mq-mft-file-ordering

File Ordering MQMFT Exit
Java
1
star
86

mq-mft-REST-Samples

Go
1
star
87

iperf3-server

Configuration to build iperf3 images
Dockerfile
1
star
88

mq-raspberry-pi-developers

1
star
89

event-streams-operator-resources

1
star
90

mqtt-android-helper

Java
1
star
91

mqlight-fishalive-java

Java MQ Light fishalive sample
Java
1
star
92

mqlight-interconnect-2015-lab

Materials for the MQ Light Interconnect 2015 lab
HTML
1
star
93

messagesight-oauth-sample

Java
1
star
94

mqlight-conference-lab

Materials for demonstrating the use of the MQ Light API at conferences
HTML
1
star
95

mq-uniform-clusters

MQ Uniform Clusters bring a set of queue managers together to work as a single unit to intelligently distribute the applications across them. This repository provides simple scripts and setup to get going quickly
C
1
star
96

messagesight-message-expiry

This repository contains an example of using JMS to publish a message to MessageSight with a time to live and seeing that applied when there is an MQTT subscriber.
Java
1
star