Skip to content

Commit 2767af9

Browse files
David Loritezegelin
authored andcommitted
Add dockerfile and entrypoint
1 parent cb3e231 commit 2767af9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM openjdk:11-jre-slim-buster
2+
ARG EXPORTER_VERSION=0.9.10
3+
RUN mkdir -p /opt/cassandra_exporter
4+
ADD https://github.com/instaclustr/cassandra-exporter/releases/download/v${EXPORTER_VERSION}/cassandra-exporter-standalone-${EXPORTER_VERSION}.jar /opt/cassandra_exporter/cassandra_exporter.jar
5+
COPY ./entrypoint.sh /opt/cassandra_exporter/entrypoint.sh
6+
RUN chmod g+wrX,o+rX -R /opt/cassandra_exporter
7+
CMD sh /opt/cassandra_exporter/entrypoint.sh

entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#/bin/sh
2+
if [ -z ${CASSANDRA_EXPORTER_USER} ] && [ -z ${CASSANDRA_EXPORTER_PASSWORD} ]; then
3+
java -jar /opt/cassandra_exporter/cassandra_exporter.jar
4+
else
5+
java -jar /opt/cassandra_exporter/cassandra_exporter.jar --jmx-user=CASSANDRA_EXPORTER_USER --jmx-password=CASSANDRA_EXPORTER_PASSWORD --table-labels=TABLE_TYPE --global-labels=CLUSTER,NODE
6+
fi

0 commit comments

Comments
 (0)