From ae39cfbdae303218858689809c3e27560a9e3a34 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Wed, 8 May 2024 09:48:09 -0400 Subject: [PATCH] Add jolokia2 to Kafka container for collecting JMX metrics Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com> --- so-kafka/Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/so-kafka/Dockerfile b/so-kafka/Dockerfile index 81ac6ca..d889ffe 100644 --- a/so-kafka/Dockerfile +++ b/so-kafka/Dockerfile @@ -1,5 +1,5 @@ # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one -# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at +# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at # https://securityonion.net/license; you may not use this file except in compliance with the # Elastic License 2.0. @@ -11,6 +11,9 @@ LABEL description="Kafka running in a docker container for use with Security Oni ARG KAFKA_DOWNLOAD=https://downloads.apache.org/kafka/3.7.0/ ARG KAFKA_TARNAME=kafka_2.13-3.7.0 +ARG JOLOKIA_VERSION=2.0.2 +ARG JOLOKIA_DOWNLOAD=https://github.com/jolokia/jolokia/releases/download/v${JOLOKIA_VERSION}/jolokia-${JOLOKIA_VERSION}-bin.tar.gz + RUN dnf update -y && \ dnf install -y java-11-openjdk java-11-openjdk-devel curl && \ dnf clean all @@ -21,10 +24,14 @@ RUN groupadd --gid 960 kafka && \ adduser --uid 960 --gid 960 kafka RUN curl -O ${KAFKA_DOWNLOAD}${KAFKA_TARNAME}.tgz && \ - tar -xzf ${KAFKA_TARNAME}.tgz + tar -xzf ${KAFKA_TARNAME}.tgz && \ + curl -LO ${JOLOKIA_DOWNLOAD} && \ + tar -xzf jolokia-${JOLOKIA_VERSION}-bin.tar.gz RUN rm -f ${KAFKA_TARNAME}.tgz && \ mv ${KAFKA_TARNAME} kafka && \ + rm -f jolokia-${JOLOKIA_VERSION}-bin.tar.gz && \ + mv jolokia-${JOLOKIA_VERSION} jolokia && \ chown -R 960:960 kafka -ENTRYPOINT ["/kafka/bin/kafka-server-start.sh", "/kafka/config/kraft/server.properties"] +ENTRYPOINT ["/kafka/bin/kafka-server-start.sh", "/kafka/config/kraft/server.properties"] \ No newline at end of file