Skip to content

Commit 09f86c0

Browse files
committed
Converts run_sample_httpserver.sh to entrypoint + command
1 parent 251a57e commit 09f86c0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
FROM openjdk:8u131-jre-alpine
22

33
ENV EXPORTER_VERSION=8ded2c5e112f8c458e60398c528799ca763c78ac
4+
ENV EXPORTER_REPO=github.com/prometheus/jmx_exporter
45

5-
RUN set -e; cd /usr/local; \
6+
WORKDIR /usr/local/
7+
8+
RUN set -e; \
69
MAVEN_VERSION=3.5.0 PATH=$PATH:$(pwd)/maven/bin; \
710
apk add --no-cache --virtual .build-deps \
811
curl \
@@ -12,14 +15,18 @@ RUN set -e; cd /usr/local; \
1215
mvn --version; \
1316
\
1417
mkdir ./jmx_exporter; \
15-
curl -SLs https://github.com/prometheus/jmx_exporter/archive/$EXPORTER_VERSION.tar.gz | tar -xzf - --strip-components=1 -C ./jmx_exporter; \
18+
curl -SLs https://$EXPORTER_REPO/archive/$EXPORTER_VERSION.tar.gz | tar -xzf - --strip-components=1 -C ./jmx_exporter; \
1619
cd ./jmx_exporter; \
1720
mvn package; \
21+
find jmx_prometheus_httpserver/ -name *-jar-with-dependencies.jar -exec mv -v '{}' ../jmx_prometheus_httpserver.jar \;; \
22+
mv example_configs ../; \
23+
cd ..; \
1824
\
19-
rm /root/.m2 -Rf; \
25+
rm -Rf ./jmx_exporter ./maven /root/.m2; \
2026
apk del .build-deps;
2127

2228
RUN apk add --no-cache bash
2329

24-
WORKDIR /usr/local/jmx_exporter
25-
ENTRYPOINT ["run_sample_httpserver.sh"]
30+
ENTRYPOINT ["java", "-Dcom.sun.management.jmxremote.ssl=false", "-Dcom.sun.management.jmxremote.authenticate=false", "-Dcom.sun.management.jmxremote.port=5555", "-jar", "jmx_prometheus_httpserver.jar"]
31+
# https://github.com/prometheus/jmx_exporter/tree/master/example_configs
32+
CMD ["5556", "example_configs/kafka-0-8-2.yml"]

0 commit comments

Comments
 (0)