This repository has been archived by the owner on May 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from ibm-messaging/v3
V3
- Loading branch information
Showing
15 changed files
with
363 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,23 +14,25 @@ | |
|
||
FROM ubuntu:16.04 | ||
|
||
LABEL maintainer "Arthur Barr <[email protected]>" | ||
LABEL maintainer "Arthur Barr <[email protected]>, Rob Parker <[email protected]>" | ||
|
||
# The URL to download the MQ installer from in tar.gz format | ||
ARG MQ_URL=http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev901_linux_x86-64.tar.gz | ||
ARG MQ_URL=https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqadv/mqadv_dev903_ubuntu_x86-64.tar.gz | ||
|
||
# The MQ packages to install | ||
ARG MQ_PACKAGES="MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm MQSeriesMsg*.rpm MQSeriesJava*.rpm MQSeriesJRE*.rpm MQSeriesGSKit*.rpm MQSeriesWeb*.rpm" | ||
ARG MQ_PACKAGES="ibmmq-server ibmmq-java ibmmq-jre ibmmq-gskit ibmmq-web ibmmq-msg-.*" | ||
|
||
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 \ | ||
ca-certificates \ | ||
coreutils \ | ||
curl \ | ||
debianutils \ | ||
file \ | ||
findutils \ | ||
gawk \ | ||
grep \ | ||
|
@@ -39,7 +41,6 @@ RUN export DEBIAN_FRONTEND=noninteractive \ | |
mount \ | ||
passwd \ | ||
procps \ | ||
rpm \ | ||
sed \ | ||
tar \ | ||
util-linux \ | ||
|
@@ -52,14 +53,22 @@ RUN export DEBIAN_FRONTEND=noninteractive \ | |
&& groupadd --gid 1000 mqm \ | ||
&& useradd --uid 1000 --gid mqm mqm \ | ||
&& usermod -G mqm root \ | ||
&& cd /tmp/mq/MQServer \ | ||
&& cd /tmp/mq/DebianMQServer \ | ||
# Accept the MQ license | ||
&& ./mqlicense.sh -text_only -accept \ | ||
# Install MQ using the RPM packages | ||
&& rpm -ivh --force-debian $MQ_PACKAGES \ | ||
&& echo "deb [trusted=yes] file:/tmp/mq/DebianMQServer ./" > /etc/apt/sources.list.d/IBM_MQ.list \ | ||
# Install MQ using the DEB packages | ||
&& apt-get update \ | ||
&& apt-get install -y $MQ_PACKAGES \ | ||
# Remove 32-bit libraries from 64-bit container | ||
&& find /opt/mqm /var/mqm -type f -exec file {} \; \ | ||
| awk -F: '/ELF 32-bit/{print $1}' | xargs --no-run-if-empty rm -f \ | ||
# Remove tar.gz files unpacked by RPM postinst scripts | ||
&& find /opt/mqm -name '*.tar.gz' -delete \ | ||
# Recommended: Set the default MQ installation (makes the MQ commands available on the PATH) | ||
&& /opt/mqm/bin/setmqinst -p /opt/mqm -i \ | ||
# Clean up all the downloaded files | ||
&& rm -f /etc/apt/sources.list.d/IBM_MQ.list \ | ||
&& rm -rf /tmp/mq \ | ||
# Apply any bug fixes not included in base Ubuntu or MQ image. | ||
# Don't upgrade everything based on Docker best practices https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#run | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# -*- mode: sh -*- | ||
# © Copyright IBM Corporation 2015, 2017 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Turn off script failing here because of listeners failing the script | ||
|
||
for MQSC_FILE in $(ls -v /etc/mqm/*.mqsc); do | ||
runmqsc ${MQ_QMGR_NAME} < ${MQSC_FILE} | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
# -*- mode: sh -*- | ||
# © Copyright IBM Corporation 2015, 2017 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
|
||
if [ -z ${MQ_QMGR_NAME+x} ]; then | ||
# no ${MQ_QMGR_NAME} supplied so set Queue Manager name as the hostname | ||
# However make sure we remove any characters that are not valid. | ||
echo "Hostname is: $(hostname)" | ||
MQ_QMGR_NAME=`echo $(hostname) | sed 's/[^a-zA-Z0-9._%/]//g'` | ||
fi | ||
echo "Setting Queue Manager name to ${MQ_QMGR_NAME}" | ||
|
||
QMGR_EXISTS=`dspmq | grep ${MQ_QMGR_NAME} > /dev/null ; echo $?` | ||
|
||
if [ ${QMGR_EXISTS} -ne 0 ]; then | ||
MQ_DEV=${MQ_DEV:-"true"} | ||
if [ "${MQ_DEV}" == "true" ]; then | ||
# Turns on early adopt if we're using Developer defaults | ||
export AMQ_EXTRA_QM_STANZAS=Channels:ChlauthEarlyAdopt=Y | ||
fi | ||
crtmqm -q ${MQ_QMGR_NAME} || true | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
# -*- mode: sh -*- | ||
# © Copyright IBM Corporation 2015, 2017 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
|
||
MQ_QMGR_NAME=$1 | ||
|
||
state() | ||
{ | ||
dspmq -n -m ${MQ_QMGR_NAME} | awk -F '[()]' '{ print $4 }' | ||
} | ||
|
||
trap "source mq-stop-container.sh" SIGTERM SIGINT | ||
|
||
echo "Monitoring Queue Manager ${MQ_QMGR_NAME}" | ||
|
||
# Loop until "dspmq" says the queue manager is running | ||
until [ "`state`" == "RUNNING" ]; do | ||
sleep 1 | ||
done | ||
dspmq | ||
|
||
echo "IBM MQ Queue Manager ${MQ_QMGR_NAME} is now fully running" | ||
|
||
# Loop until "dspmq" says the queue manager is not running any more | ||
until [ "`state`" != "RUNNING" ]; do | ||
sleep 5 | ||
done | ||
|
||
# Wait until queue manager has ended before exiting | ||
while true; do | ||
STATE=`state` | ||
case "$STATE" in | ||
ENDED*) break;; | ||
*) ;; | ||
esac | ||
sleep 1 | ||
done | ||
dspmq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
# -*- mode: sh -*- | ||
# © Copyright IBM Corporation 2015, 2017 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
|
||
# We want to do parameter checking early as then we can stop and error early before it looks | ||
# like everything is going to be ok (when it won't) | ||
if [ ! -z ${MQ_TLS_KEYSTORE+x} ]; then | ||
: ${MQ_TLS_PASSPHRASE?"Error: If you supply MQ_TLS_KEYSTORE, you must supply MQ_TLS_PASSPHRASE"} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# -*- mode: sh -*- | ||
# © Copyright IBM Corporation 2015, 2017 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -e | ||
|
||
source /opt/mqm/bin/setmqenv -s | ||
dspmqver | ||
echo "Checking filesystem..." | ||
amqmfsck /var/mqm |
Oops, something went wrong.