Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Docker image to use eclipse-temurin #111

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: temurin
java-version: '11'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 1.11
uses: actions/setup-java@v3
with:
java-version: 1.8
distribution: temurin
java-version: '11'

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
12 changes: 7 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
FROM openjdk:11-jre-slim-buster
FROM eclipse-temurin:11-jre-jammy

ARG EXPORTER_VERSION=2.3.8

RUN apt-get update && apt-get install -y --no-install-recommends \
netcat \
dumb-init \
netcat \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p /etc/cassandra_exporter /opt/cassandra_exporter
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 /sbin/dumb-init
ADD https://github.com/criteo/cassandra_exporter/releases/download/${EXPORTER_VERSION}/cassandra_exporter-${EXPORTER_VERSION}.jar /opt/cassandra_exporter/cassandra_exporter.jar
ADD config.yml /etc/cassandra_exporter/
ADD docker/run.sh /

RUN chmod +x /sbin/dumb-init && chmod g+wrX,o+rX -R /opt/cassandra_exporter && chmod g+wrX,o+rX -R /etc/cassandra_exporter
RUN chmod g+wrX,o+rX -R /opt/cassandra_exporter \
&& chmod g+wrX,o+rX -R /etc/cassandra_exporter

CMD ["/sbin/dumb-init", "/bin/bash", "/run.sh"]
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bash", "/run.sh"]
2 changes: 1 addition & 1 deletion docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ done < <(env)
host=$(grep -m1 'host:' /tmp/config.yml | cut -d ':' -f2)
port=$(grep -m1 'host:' /tmp/config.yml | cut -d ':' -f3)

while ! nc -z $host $port; do
while ! nc -z "$host" "$port"; do
echo "Waiting for Cassandra JMX to start on $host:$port"
sleep 1
done
Expand Down