Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ENV CONFD_PREFIX_KEY="/activemq" \
S6_BEHAVIOUR_IF_STAGE2_FAILS=2 \
LANG="en_US.utf8" \
APP_HOME="/opt/activemq" \
APP_VERSION="5.15.2" \
APP_VERSION="5.15.7" \
SCHEDULER_VOLUME="/opt/scheduler" \
USER=activemq \
GROUP=activemq \
Expand Down Expand Up @@ -39,7 +39,7 @@ RUN curl -sL https://github.com/just-containers/s6-overlay/releases/download/v1.
# Install ActiveMQ software
RUN \
mkdir -p ${APP_HOME} /data /var/log/activemq && \
curl http://apache.mirrors.ovh.net/ftp.apache.org/dist/activemq/${APP_VERSION}/apache-activemq-${APP_VERSION}-bin.tar.gz -o /tmp/activemq.tar.gz &&\
curl http://archive.apache.org/dist/activemq/${APP_VERSION}/apache-activemq-${APP_VERSION}-bin.tar.gz -o /tmp/activemq.tar.gz &&\
tar -xzf /tmp/activemq.tar.gz -C /tmp &&\
mv /tmp/apache-activemq-${APP_VERSION}/* ${APP_HOME} &&\
rm -rf /tmp/activemq.tar.gz &&\
Expand All @@ -63,4 +63,4 @@ EXPOSE 61614

VOLUME ["/data", "/var/log/activemq"]
WORKDIR ${APP_HOME}
CMD ["/init"]
CMD ["/init"]
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ docker run --name='activemq' -it --rm \
-P
webcenter/activemq:latest
```
This sample lauch ActiveMQ in docker with 512 MB of memory, and then ACtiveMQ can take 2048 MB of max memory
This sample lauch ActiveMQ in docker with 512 MB of memory, and then ActiveMQ can take 2048 MB of max memory

## Storage

Expand Down Expand Up @@ -189,7 +189,7 @@ You can use the following variables to limit the disk usage:

## JMX
You can control JMX access with the following variables:
- `ACTIVEMQ_JMX_X_ROLE`: Where X is the username and the value is the role (read or readwrite)
- `ACTIVEMQ_JMX_X_ROLE`: Where X is the username and the value is the role (readonly or readwrite)
- `ACTIVEMQ_JMX_X_PASSWORD`: Where X is the username and the value is the password

## Avaible Configuration Parameters
Expand Down Expand Up @@ -226,9 +226,12 @@ Below is the complete list of available options that can be used to customize yo
- **ACTIVEMQ_GROUPS_X**: Where X is the group and list user separated by a comma is the value.
- **ACTIVEMQ_JMX_X_ROLE**: Where X is the username and role is the value.
- **ACTIVEMQ_JMX_X_PASSWORD**: Where X is the username and password is the value.

- **ACTIVEMQ_CONFIG_TOPICS_X**: Where X is the logical topics name (wihtout special char) and real topic name is the value.
- **ACTIVEMQ_CONFIG_QUEUES_X**: Where X is the logical queue name (wihtout special char) and real queue name is the value.
- **ACTIVEMQ_CONFIG_JMX_REMOTE_PORT**: Enable remote jmx through this port.
- **ACTIVEMQ_CONFIG_JMX_REMOTE_SSL**: Set if jmx port should use ssl. Default is `false`.
- **ACTIVEMQ_CONFIG_JMX_REMOTE_RMIPORT**: Set a static rmi port for jmx, which is needed to be able to expose the port. Default is `1617`.
- **ACTIVEMQ_CONFIG_RMI_HOSTNAME**: Set hostname to associate with remote stubs. Default is `localhost`.
- **ACTIVEMQ_CONFIG_TOPICS_X**: Where X is the logical topics name (without special char) and real topic name is the value.
- **ACTIVEMQ_CONFIG_QUEUES_X**: Where X is the logical queue name (without special char) and real queue name is the value.


## Advance configuration
Expand All @@ -237,4 +240,4 @@ For advance configuration, the best way is to read ActiveMQ documentation and cr
Next, you can mount it when you run this image or you can create your own image (base on this image) and include your specifics config file.

The home of ActiveMQ is in /opt/activemq, so if you want to override all the setting, you can launch docker with ` -v /your_path/conf:/opt/activemq/conf`.
If you overload the config, don't forget to disable confd or change the template instead to change activemq config `/opt/confd/etc/templates`.
If you overload the config, don't forget to disable confd or change the template instead to change activemq config `/opt/confd/etc/templates`.
8 changes: 4 additions & 4 deletions root/etc/cont-init.d/101-gen-confd-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ keys = [
]
EOF

cat << EOF > ${CONFD_HOME}/etc/conf.d/wrapper.conf.toml
cat << EOF > ${CONFD_HOME}/etc/conf.d/env.toml
[template]
prefix = "${CONFD_PREFIX_KEY}"
src = "wrapper.conf.tmpl"
dest = "${APP_HOME}/bin/linux-x86-64/wrapper.conf"
mode = "0744"
src = "env.tmpl"
dest = "${APP_HOME}/bin/env"
mode = "0644"
gid = $GID
uid = $UID
keys = [
Expand Down
6 changes: 3 additions & 3 deletions root/opt/confd/etc/templates/activemq.xml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
{{- if or (ge (len (ls "/config/topics")) 1) (ge (len (ls "/config/queues")) 1)}}
<destinations>
{{- range $i, $key := ls "/config/topics"}}
<topic physicalName="{{getv (printf "/config/topics/%s" $key)}}"
<topic physicalName="{{getv (printf "/config/topics/%s" $key)}}" />
{{- end}}
{{- range $i, $key := ls "/config/queues"}}
<queue physicalName="{{getv (printf "/config/queues/%s" $key)}}"
<queue physicalName="{{getv (printf "/config/queues/%s" $key)}}" />
{{- end}}
</destinations>
{{- end}}
Expand All @@ -164,4 +164,4 @@
<import resource="jetty.xml"/>

</beans>
<!-- END SNIPPET: example -->
<!-- END SNIPPET: example -->
120 changes: 120 additions & 0 deletions root/opt/confd/etc/templates/env.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/sh
# ------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
# ------------------------------------------------------------------------
#
# Configuration file for running Apache Active MQ as standalone provider.
#
# This file overwrites the predefined settings of the sysv init-script.
# You can also use alternate location for default settings -
# invoke the init-script without a argument an review help section "Configuration of this script"
# /etc/default/activemq <activemq user home>/.activemqrc <activemq installation dir>/bin/env

# Active MQ installation dirs
# ACTIVEMQ_HOME="<Installationdir>/"
# ACTIVEMQ_BASE="$ACTIVEMQ_HOME"
# ACTIVEMQ_CONF="$ACTIVEMQ_BASE/conf"
# ACTIVEMQ_DATA="$ACTIVEMQ_BASE/data"
# ACTIVEMQ_TMP="$ACTIVEMQ_BASE/tmp"

# Set jvm memory configuration (minimal/maximum amount of memory)
ACTIVEMQ_OPTS_MEMORY="-Xms{{getv "/config/minmemory" "128"}}M -Xmx{{getv "/config/maxmemory" "1024"}}M"

if [ -z "$ACTIVEMQ_OPTS" ] ; then
ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=$ACTIVEMQ_CONF/login.config"
fi

if [ -z "$ACTIVEMQ_OUT" ]; then
ACTIVEMQ_OUT="/dev/null"
fi

# Uncomment to enable audit logging
#ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS -Dorg.apache.activemq.audit=true"

# Set jvm jmx configuration
# This enables jmx access over a configured jmx-tcp-port.
# You have to configure the first four settings if you run a ibm jvm, caused by the
# fact that IBM's jvm does not support VirtualMachine.attach(PID).
# JMX access is needed for quering a running activemq instance to gain data or to
# trigger management operations.
#
# Example for ${ACTIVEMQ_CONF}/jmx.access:
# ---
# # The "monitorRole" role has readonly access.
# # The "controlRole" role has readwrite access.
# monitorRole readonly
# controlRole readwrite
# ---
#
# Example for ${ACTIVEMQ_CONF}/jmx.password:
# ---
# # The "monitorRole" role has password "abc123".
# # # The "controlRole" role has password "abcd1234".
# monitorRole abc123
# controlRole abcd1234
# ---
#
{{ if (exists "/config/jmx/remote/port") }}
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port={{getv "/config/jmx/remote/port"}}"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl={{getv "/config/jmx/remote/ssl" "false"}}"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.rmi.port={{getv "/config/jmx/remote/rmiport" "1617"}}"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname={{getv "/config/rmi/hostname" "localhost"}}"
{{else}}
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
{{end}}

# Set jvm jmx configuration for controlling the broker process
# You only have to configure the first four settings if you run a ibm jvm, caused by the
# fact that IBM's jvm does not support VirtualMachine.attach(PID)
# (see also com.sun.management.jmxremote.port, .jmx.password.file and .jmx.access.file )
#ACTIVEMQ_SUNJMX_CONTROL="--jmxurl service:jmx:rmi:///jndi/rmi://127.0.0.1:1099/jmxrmi --jmxuser controlRole --jmxpassword abcd1234"
ACTIVEMQ_SUNJMX_CONTROL=""

# Specify the queue manager URL for using "browse" option of sysv initscript
if [ -z "$ACTIVEMQ_QUEUEMANAGERURL" ]; then
ACTIVEMQ_QUEUEMANAGERURL="--amqurl tcp://localhost:61616"
fi

# Set additional JSE arguments
if [ -z "$ACTIVEMQ_SSL_OPTS" ] ; then
#ACTIVEMQ_SSL_OPTS="-Djava.security.properties=$ACTIVEMQ_CONF/java.security"
ACTIVEMQ_SSL_OPTS=""
fi

# Uncomment to enable remote debugging
#ACTIVEMQ_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

# ActiveMQ tries to shutdown the broker by jmx,
# after a specified number of seconds send SIGKILL
if [ -z "$ACTIVEMQ_KILL_MAXSECONDS" ]; then
ACTIVEMQ_KILL_MAXSECONDS=30
fi

# Configure a user with non root privileges, if no user is specified do not change user
# (the entire activemq installation should be owned by this user)
ACTIVEMQ_USER=""

# location of the pidfile
# ACTIVEMQ_PIDFILE="$ACTIVEMQ_DATA/activemq.pid"

# Location of the java installation
# Specify the location of your java installation using JAVA_HOME, or specify the
# path to the "java" binary using JAVACMD
# (set JAVACMD to "auto" for automatic detection)
#JAVA_HOME=""
JAVACMD="auto"
148 changes: 0 additions & 148 deletions root/opt/confd/etc/templates/wrapper.conf.tmpl

This file was deleted.