Skip to content

Commit

Permalink
Add dockerfile and entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
David Lorite authored and zegelin committed Jul 20, 2020
1 parent cb3e231 commit 2767af9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM openjdk:11-jre-slim-buster
ARG EXPORTER_VERSION=0.9.10
RUN mkdir -p /opt/cassandra_exporter
ADD https://github.com/instaclustr/cassandra-exporter/releases/download/v${EXPORTER_VERSION}/cassandra-exporter-standalone-${EXPORTER_VERSION}.jar /opt/cassandra_exporter/cassandra_exporter.jar
COPY ./entrypoint.sh /opt/cassandra_exporter/entrypoint.sh
RUN chmod g+wrX,o+rX -R /opt/cassandra_exporter
CMD sh /opt/cassandra_exporter/entrypoint.sh
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#/bin/sh
if [ -z ${CASSANDRA_EXPORTER_USER} ] && [ -z ${CASSANDRA_EXPORTER_PASSWORD} ]; then
java -jar /opt/cassandra_exporter/cassandra_exporter.jar
else
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
fi

0 comments on commit 2767af9

Please sign in to comment.