77FROM stackable/image/java-devel AS builder
88
99ARG PRODUCT
10+ ARG JMX_EXPORTER
1011ARG STACKABLE_USER_UID
1112
1213# Copy patches into the builder
1314COPY --chown=${STACKABLE_USER_UID}:0 zookeeper/stackable/patches/patchable.toml /stackable/src/zookeeper/stackable/patches/patchable.toml
1415COPY --chown=${STACKABLE_USER_UID}:0 zookeeper/stackable/patches/${PRODUCT} /stackable/src/zookeeper/stackable/patches/${PRODUCT}
16+ # Copy JMX config into the builder
17+ COPY --chown=${STACKABLE_USER_UID}:0 zookeeper/stackable/jmx /stackable/jmx
1518
1619USER ${STACKABLE_USER_UID}
1720WORKDIR /stackable
@@ -35,6 +38,12 @@ mv zookeeper-assembly/target/bom.json /stackable/apache-zookeeper-${PRODUCT}-bin
3538rm -rf /stackable/apache-zookeeper-${PRODUCT}-bin/docs
3639rm /stackable/apache-zookeeper-${PRODUCT}-bin/README_packaging.md
3740
41+ # Download the JMX exporter jar from our own repo
42+ curl "https://repo.stackable.tech/repository/packages/jmx-exporter/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" \
43+ -o "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar"
44+ chmod +x "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar"
45+ ln -s "/stackable/jmx/jmx_prometheus_javaagent-${JMX_EXPORTER}.jar" /stackable/jmx/jmx_prometheus_javaagent.jar
46+
3847# set correct groups
3948chmod -R g=u /stackable
4049EOF
@@ -63,6 +72,7 @@ LABEL \
6372# Copy over the ZooKeeper binary folder
6473COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/apache-zookeeper-${PRODUCT}-bin /stackable/apache-zookeeper-${PRODUCT}-bin/
6574COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/zookeeper-${PRODUCT}-src.tar.gz /stackable
75+ COPY --chown=${STACKABLE_USER_UID}:0 --from=builder /stackable/jmx /stackable/jmx/
6676COPY zookeeper/licenses /licenses
6777
6878RUN <<EOF
@@ -79,6 +89,7 @@ ln -s /stackable/apache-zookeeper-${PRODUCT}-bin/ /stackable/zookeeper
7989chown -h ${STACKABLE_USER_UID}:0 /stackable/zookeeper
8090
8191# fix missing permissions
92+ chmod g=u /stackable/jmx
8293chmod g=u /stackable/apache-zookeeper-${PRODUCT}-bin/
8394EOF
8495
0 commit comments