commit 730de588fd22843ec452819c3cb897564dbd8431 Author: Rasmus Lauritsen Date: Fri Oct 11 23:22:25 2024 +0200 first commit diff --git a/20-config.mqsc b/20-config.mqsc new file mode 100644 index 0000000..544e631 --- /dev/null +++ b/20-config.mqsc @@ -0,0 +1,3 @@ +DEFINE QLOCAL(FRY.QUEUE) REPLACE +DEFINE QLOCAL(PLANET.EXPRESS.QUEUE) REPLACE +DEFINE CHANNEL(PANET.EXPRESS.SHIP) CHLTYPE(SVRCONN) DESCR('Old Bessie - electric mucus spacecraft') \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..841bdfd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM icr.io/ibm-messaging/mq:9.4.0.5-r2 +USER 1001 +COPY 20-config.mqsc /etc/mqm/ \ No newline at end of file diff --git a/readne.md b/readne.md new file mode 100644 index 0000000..ea5e996 --- /dev/null +++ b/readne.md @@ -0,0 +1,81 @@ +# MQ configurations +## Building own image +```bash +docker stop QM1 +docker rm QM1 + +docker buildx build -t mqtest:latest . + +docker run \ + --name QM1 \ + --env LICENSE=accept \ + --env MQ_QMGR_NAME=QM1 \ + --env MQ_APP_USER=app \ + --env MQ_APP_PASSWORD=passw0rd \ + --env MQ_ADMIN_USER=admin \ + --env MQ_ADMIN_PASSWORD=passw0rd \ + --env MQ_ENABLE_METRICS=true \ + --publish 1414:1414 \ + --publish 9443:9443 \ + --publish 9157:9157 \ + --detach \ + mqtest:latest +``` +### 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_LOG_FILE_PAGES - Set this to control the value for LogFilePages passed to the "crtmqm" command. Cannot be changed after queue manager creation. +* MQ_LOGGING_CONSOLE_SOURCE - Specifies a comma-separated list of sources for logs which are mirrored to the container's stdout. The valid values are "qmgr", "web" and "mqsc". Defaults to "qmgr,web". +* MQ_LOGGING_CONSOLE_FORMAT - Changes the format of the logs which are printed on the container's stdout. Set to "json" to use JSON format (JSON object per line); set to "basic" to use a simple human-readable format. Defaults to "basic". +* MQ_LOGGING_CONSOLE_EXCLUDE_ID - Excludes log messages with the specified ID. The log messages still appear in the log file on disk, but are excluded from the container's stdout. Defaults to "AMQ5041I,AMQ5052I,AMQ5051I,AMQ5037I,AMQ5975I". +* MQ_ENABLE_METRICS - Set this to `true` to generate Prometheus metrics for your Queue Manager. + + +## Running with the default configuration +```bash +docker run \ + --env LICENSE=accept \ + --env MQ_QMGR_NAME=QM1 \ + --env MQ_ENABLE_METRICS=true \ + --publish 1414:1414 \ + --publish 9443:9443 \ + --publish 9157:9157 \ + --detach \ + icr.io/ibm-messaging/mq +``` + +## Running with the default configuration and a volume +```bash +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 \ + icr.io/ibm-messaging/mq +``` + +## Running with a read-only root filesystem +```bash +docker volume create qm1data +docker volume create run +docker volume create tmp + +docker run \ + --env LICENSE=accept \ + --env MQ\_QMGR\_NAME=QM1 \ + --mount type=volume,source=run,destination=/run \ + --mount type=volume,source=tmp,destination=/tmp \ + --mount type=volume,source=qm1data,destination=/mnt/mqm \ + --read-only \ + --publish 1414:1414 \ + --detach \ + icr.io/ibm-messaging/mq +```