diff --git a/bitnami/activemq/6.2/debian-12/Dockerfile b/bitnami/activemq/6.2/debian-12/Dockerfile index 24d5dc16e07e..564eb56f6534 100644 --- a/bitnami/activemq/6.2/debian-12/Dockerfile +++ b/bitnami/activemq/6.2/debian-12/Dockerfile @@ -8,7 +8,7 @@ ARG JAVA_EXTRA_SECURITY_DIR="/bitnami/java/extra-security" ARG TARGETARCH LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2025-12-03T13:23:10Z" \ + org.opencontainers.image.created="2025-12-03T17:28:38Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/activemq/README.md" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/activemq" \ @@ -24,14 +24,14 @@ ENV HOME="/" \ COPY prebuildfs / SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c"] # Install required system packages and dependencies -RUN install_packages acl ca-certificates curl procps zlib1g +RUN install_packages ca-certificates curl procps zlib1g RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \ DOWNLOADS_URL=${SECRET_DOWNLOADS_URL:-${DOWNLOADS_URL}} ; \ mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \ COMPONENTS=( \ "render-template-1.0.9-160-linux-${OS_ARCH}-debian-12" \ "java-21.0.9-15-0-linux-${OS_ARCH}-debian-12" \ - "activemq-6.2.0-0-linux-${OS_ARCH}-debian-12" \ + "activemq-6.2.0-1-linux-${OS_ARCH}-debian-12" \ ) ; \ for COMPONENT in "${COMPONENTS[@]}"; do \ if [ ! -f "${COMPONENT}.tar.gz" ]; then \ @@ -52,7 +52,7 @@ RUN /opt/bitnami/scripts/activemq/postunpack.sh RUN /opt/bitnami/scripts/java/postunpack.sh ENV APP_VERSION="6.2.0" \ BITNAMI_APP_NAME="activemq" \ - IMAGE_REVISION="0" \ + IMAGE_REVISION="1" \ JAVA_HOME="/opt/bitnami/java" \ PATH="/opt/bitnami/common/bin:/opt/bitnami/java/bin:/opt/bitnami/activemq/bin:$PATH" diff --git a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq-env.sh b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq-env.sh index 592e7b8439cb..23bfd347fade 100644 --- a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq-env.sh +++ b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq-env.sh @@ -24,6 +24,7 @@ export BITNAMI_DEBUG="${BITNAMI_DEBUG:-false}" # By setting an environment variable matching *_FILE to a file path, the prefixed environment # variable will be overridden with the value specified in that file activemq_env_vars=( + ACTIVEMQ_MOUNTED_CONF_DIR ACTIVEMQ_MQTT_PORT_NUMBER ACTIVEMQ_AQMQ_PORT_NUMBER ACTIVEMQ_HTTP_PORT_NUMBER @@ -50,8 +51,11 @@ unset activemq_env_vars # Paths export ACTIVEMQ_BASE_DIR="${BITNAMI_ROOT_DIR}/activemq" export ACTIVEMQ_BIN_DIR="${ACTIVEMQ_BASE_DIR}/bin" -export ACTIVEMQ_DATA_DIR="${ACTIVEMQ_BASE_DIR}/data" +export ACTIVEMQ_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/activemq" +export ACTIVEMQ_DATA_DIR="${ACTIVEMQ_VOLUME_DIR}/data" export ACTIVEMQ_CONF_DIR="${ACTIVEMQ_BASE_DIR}/conf" +export ACTIVEMQ_DEFAULT_CONF_DIR="${ACTIVEMQ_BASE_DIR}/conf.default" +export ACTIVEMQ_MOUNTED_CONF_DIR="${ACTIVEMQ_MOUNTED_CONF_DIR:-${ACTIVEMQ_VOLUME_DIR}/conf}" export ACTIVEMQ_LOGS_DIR="${ACTIVEMQ_BASE_DIR}/logs" export ACTIVEMQ_TMP_DIR="${ACTIVEMQ_BASE_DIR}/tmp" export ACTIVEMQ_CONF_FILE="${ACTIVEMQ_CONF_DIR}/activemq.xml" @@ -74,10 +78,6 @@ export ACTIVEMQ_USERNAME="${ACTIVEMQ_USERNAME:-admin}" export ACTIVEMQ_PASSWORD="${ACTIVEMQ_PASSWORD:-password}" export ACTIVEMQ_SECRET="${ACTIVEMQ_SECRET:-bitnami}" -# ActiveMQ persistence configuration -export ACTIVEMQ_DATA_TO_PERSIST="data conf" -export ACTIVEMQ_VOLUME_DIR="${BITNAMI_VOLUME_DIR}/activemq" - # Default JVM configuration export JAVA_HOME="${BITNAMI_ROOT_DIR}/java" diff --git a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/entrypoint.sh b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/entrypoint.sh index fea3b36d6288..52948887b497 100755 --- a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/entrypoint.sh +++ b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/entrypoint.sh @@ -17,6 +17,12 @@ set -o pipefail print_welcome_page +# We add the copy from default config in the entrypoint to not break users +# bypassing the setup.sh logic. If the file already exists do not overwrite (in +# case someone mounts a configuration file in /opt/bitnami/activemq/conf) +debug "Copying files from $ACTIVEMQ_DEFAULT_CONF_DIR to $ACTIVEMQ_CONF_DIR" +cp -nr "$ACTIVEMQ_DEFAULT_CONF_DIR"/. "$ACTIVEMQ_CONF_DIR" + if [[ "$1" = "/opt/bitnami/scripts/activemq/run.sh" ]]; then info "** Starting ActiveMQ setup **" /opt/bitnami/scripts/activemq/setup.sh diff --git a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/postunpack.sh b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/postunpack.sh index dbe2b225e6c3..692675f356e3 100755 --- a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/postunpack.sh +++ b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/activemq/postunpack.sh @@ -34,10 +34,14 @@ replace_in_file "${ACTIVEMQ_CONF_DIR}/credentials-enc.properties" "activemq.user replace_in_file "${ACTIVEMQ_CONF_DIR}/credentials-enc.properties" "guest.*" " " # Configuring permissions for tmp and logs folders -for dir in "$ACTIVEMQ_TMP_DIR" "$ACTIVEMQ_LOGS_DIR"; do +for dir in "$ACTIVEMQ_TMP_DIR" "$ACTIVEMQ_LOGS_DIR" "$ACTIVEMQ_DEFAULT_CONF_DIR"; do ensure_dir_exists "$dir" chmod -R g+rwX "$dir" done # Set correct owner in installation directory -chown -R "1001:root" "$ACTIVEMQ_BASE_DIR" \ No newline at end of file +chown -R "1001:root" "$ACTIVEMQ_BASE_DIR" + +# Copy all initially generated configuration files to the default directory +# (this is to avoid breaking when entrypoint is being overridden) +cp -r "${ACTIVEMQ_CONF_DIR}/"* "$ACTIVEMQ_DEFAULT_CONF_DIR" \ No newline at end of file diff --git a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/libactivemq.sh b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/libactivemq.sh index 7ff1b14cc36a..fcfd237c0f3b 100644 --- a/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/libactivemq.sh +++ b/bitnami/activemq/6.2/debian-12/rootfs/opt/bitnami/scripts/libactivemq.sh @@ -10,7 +10,6 @@ . /opt/bitnami/scripts/libfile.sh . /opt/bitnami/scripts/liblog.sh . /opt/bitnami/scripts/libos.sh -. /opt/bitnami/scripts/libpersistence.sh . /opt/bitnami/scripts/libservice.sh . /opt/bitnami/scripts/libvalidations.sh @@ -139,21 +138,19 @@ activemq_initialize() { # Configuring permissions for data folder am_i_root && configure_permissions_ownership "$ACTIVEMQ_DATA_DIR" -u "$ACTIVEMQ_DAEMON_USER" -g "$ACTIVEMQ_DAEMON_GROUP" -d "755" -f "644" - # Check if ActiveMQ has already been initialized and persisted in a previous run - local -r app_name="activemq" - if ! is_app_initialized "$app_name"; then + if ! is_mounted_dir_empty "$ACTIVEMQ_MOUNTED_CONF_DIR"; then + cp -Lr "$ACTIVEMQ_MOUNTED_CONF_DIR"/* "$ACTIVEMQ_CONF_DIR" + fi + + if [[ -f "${ACTIVEMQ_MOUNTED_CONF_DIR}/activemq.xml" ]]; then + info "ActiveMQ configuration ${ACTIVEMQ_MOUNTED_CONF_DIR}/activemq.xml detected!" + info "Deploying ActiveMQ with persisted data" + else info "Creating config file" # File obtained from http://svn.apache.org/repos/asf/activemq/trunk/assembly/src/release/conf/activemq.xml render-template "${BITNAMI_ROOT_DIR}/scripts/activemq/files/activemq.xml.tpl" > "$ACTIVEMQ_CONF_FILE" info "Configuring the admin password" activemq_set_password "$ACTIVEMQ_PASSWORD" "$ACTIVEMQ_SECRET" - - # Ensure the ActiveMQ base directory exists and has proper permissions - info "Persisting ActiveMQ installation" - persist_app "$app_name" "$ACTIVEMQ_DATA_TO_PERSIST" - else - info "Restoring persisted ActiveMQ installation" - restore_persisted_app "$app_name" "$ACTIVEMQ_DATA_TO_PERSIST" fi } \ No newline at end of file diff --git a/bitnami/activemq/README.md b/bitnami/activemq/README.md index 29172f4e4d14..94f45ab68b01 100644 --- a/bitnami/activemq/README.md +++ b/bitnami/activemq/README.md @@ -79,39 +79,40 @@ Check the [official ActiveMQ documentation](https://activemq.apache.org/ for mor #### Customizable environment variables -| Name | Description | Default Value | -|----------------------------------|---------------------------------|---------------| -| `ACTIVEMQ_MQTT_PORT_NUMBER` | ActiveMQ MQTT port number. | `1883` | -| `ACTIVEMQ_AQMQ_PORT_NUMBER` | ActiveMQ AQMQ port number. | `5672` | -| `ACTIVEMQ_HTTP_PORT_NUMBER` | ActiveMQ HTTP port number. | `8161` | -| `ACTIVEMQ_STOMP_PORT_NUMBER` | ActiveMQ STOMP port number. | `61613` | -| `ACTIVEMQ_WEBSOCKET_PORT_NUMBER` | ActiveMQ WebSocket port number. | `61614` | -| `ACTIVEMQ_OPENWIRE_PORT_NUMBER` | ActiveMQ OpenWire port number. | `61616` | -| `ACTIVEMQ_USERNAME` | ActiveMQ username. | `admin` | -| `ACTIVEMQ_PASSWORD` | ActiveMQ password. | `password` | -| `ACTIVEMQ_SECRET` | ActiveMQ secret for encryption. | `bitnami` | +| Name | Description | Default Value | +|----------------------------------|-----------------------------------------------------------------------------------------------|-------------------------------| +| `ACTIVEMQ_MOUNTED_CONF_DIR` | Directory for including custom configuration files (that override the default generated ones) | `${ACTIVEMQ_VOLUME_DIR}/conf` | +| `ACTIVEMQ_MQTT_PORT_NUMBER` | ActiveMQ MQTT port number. | `1883` | +| `ACTIVEMQ_AQMQ_PORT_NUMBER` | ActiveMQ AQMQ port number. | `5672` | +| `ACTIVEMQ_HTTP_PORT_NUMBER` | ActiveMQ HTTP port number. | `8161` | +| `ACTIVEMQ_STOMP_PORT_NUMBER` | ActiveMQ STOMP port number. | `61613` | +| `ACTIVEMQ_WEBSOCKET_PORT_NUMBER` | ActiveMQ WebSocket port number. | `61614` | +| `ACTIVEMQ_OPENWIRE_PORT_NUMBER` | ActiveMQ OpenWire port number. | `61616` | +| `ACTIVEMQ_USERNAME` | ActiveMQ username. | `admin` | +| `ACTIVEMQ_PASSWORD` | ActiveMQ password. | `password` | +| `ACTIVEMQ_SECRET` | ActiveMQ secret for encryption. | `bitnami` | #### Read-only environment variables -| Name | Description | Value | -|----------------------------|---------------------------------------------------------------|-------------------------------------| -| `ACTIVEMQ_BASE_DIR` | ActiveMQ installation directory. | `${BITNAMI_ROOT_DIR}/activemq` | -| `ACTIVEMQ_BIN_DIR` | ActiveMQ directory for binary files. | `${ACTIVEMQ_BASE_DIR}/bin` | -| `ACTIVEMQ_DATA_DIR` | ActiveMQ configuration directory. | `${ACTIVEMQ_BASE_DIR}/data` | -| `ACTIVEMQ_CONF_DIR` | ActiveMQ configuration directory. | `${ACTIVEMQ_BASE_DIR}/conf` | -| `ACTIVEMQ_LOGS_DIR` | Directory where ActiveMQ logs are stored. | `${ACTIVEMQ_BASE_DIR}/logs` | -| `ACTIVEMQ_TMP_DIR` | Directory where ActiveMQ temporary files are stored. | `${ACTIVEMQ_BASE_DIR}/tmp` | -| `ACTIVEMQ_CONF_FILE` | ActiveMQ configuration file. | `${ACTIVEMQ_CONF_DIR}/activemq.xml` | -| `ACTIVEMQ_LOG_FILE` | Path to the log file for ActiveMQ. | `${ACTIVEMQ_LOGS_DIR}/activemq.log` | -| `ACTIVEMQ_PID_FILE` | Path to the PID file for ActiveMQ. | `${ACTIVEMQ_TMP_DIR}/activemq.pid` | -| `ACTIVEMQ_HOME` | ActiveMQ home directory. | `$ACTIVEMQ_BASE_DIR` | -| `ACTIVEMQ_DAEMON_USER` | ActiveMQ system user. | `activemq` | -| `ACTIVEMQ_DAEMON_GROUP` | ActiveMQ system group. | `activemq` | -| `ACTIVEMQ_DATA_TO_PERSIST` | Files to persist relatives to ActiveMQ installation directory | `data conf` | -| `ACTIVEMQ_VOLUME_DIR` | Persistence base directory. | `${BITNAMI_VOLUME_DIR}/activemq` | -| `JAVA_HOME` | Java installation folder. | `${BITNAMI_ROOT_DIR}/java` | -| `ACTIVEMQ_PIDFILE` | ActiveMQ output destination | `${ACTIVEMQ_PID_FILE}` | -| `ACTIVEMQ_OUT` | ActiveMQ output destination | `${ACTIVEMQ_LOG_FILE}` | +| Name | Description | Value | +|-----------------------------|------------------------------------------------------|-------------------------------------| +| `ACTIVEMQ_BASE_DIR` | ActiveMQ installation directory. | `${BITNAMI_ROOT_DIR}/activemq` | +| `ACTIVEMQ_BIN_DIR` | ActiveMQ directory for binary files. | `${ACTIVEMQ_BASE_DIR}/bin` | +| `ACTIVEMQ_VOLUME_DIR` | Persistence base directory. | `${BITNAMI_VOLUME_DIR}/activemq` | +| `ACTIVEMQ_DATA_DIR` | ActiveMQ configuration directory. | `${ACTIVEMQ_VOLUME_DIR}/data` | +| `ACTIVEMQ_CONF_DIR` | ActiveMQ configuration directory. | `${ACTIVEMQ_BASE_DIR}/conf` | +| `ACTIVEMQ_DEFAULT_CONF_DIR` | ActiveMQ default configuration directory. | `${ACTIVEMQ_BASE_DIR}/conf.default` | +| `ACTIVEMQ_LOGS_DIR` | Directory where ActiveMQ logs are stored. | `${ACTIVEMQ_BASE_DIR}/logs` | +| `ACTIVEMQ_TMP_DIR` | Directory where ActiveMQ temporary files are stored. | `${ACTIVEMQ_BASE_DIR}/tmp` | +| `ACTIVEMQ_CONF_FILE` | ActiveMQ configuration file. | `${ACTIVEMQ_CONF_DIR}/activemq.xml` | +| `ACTIVEMQ_LOG_FILE` | Path to the log file for ActiveMQ. | `${ACTIVEMQ_LOGS_DIR}/activemq.log` | +| `ACTIVEMQ_PID_FILE` | Path to the PID file for ActiveMQ. | `${ACTIVEMQ_TMP_DIR}/activemq.pid` | +| `ACTIVEMQ_HOME` | ActiveMQ home directory. | `$ACTIVEMQ_BASE_DIR` | +| `ACTIVEMQ_DAEMON_USER` | ActiveMQ system user. | `activemq` | +| `ACTIVEMQ_DAEMON_GROUP` | ActiveMQ system group. | `activemq` | +| `JAVA_HOME` | Java installation folder. | `${BITNAMI_ROOT_DIR}/java` | +| `ACTIVEMQ_PIDFILE` | ActiveMQ output destination | `${ACTIVEMQ_PID_FILE}` | +| `ACTIVEMQ_OUT` | ActiveMQ output destination | `${ACTIVEMQ_LOG_FILE}` | ## Contributing