From 02e3950b36bcbfeb20e0f4b736ab5c040336f7e6 Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Thu, 30 Jun 2022 08:57:41 +0200 Subject: [PATCH 1/2] fix: Docker image to use eclipse-temurin Signed-off-by: Yoan Blanc --- .github/workflows/build.yml | 9 +++++---- docker/Dockerfile | 12 +++++++----- docker/run.sh | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58e1c59..47e8fc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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.§§ + 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 diff --git a/docker/Dockerfile b/docker/Dockerfile index 60c2f3a..9729fbd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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"] diff --git a/docker/run.sh b/docker/run.sh index 4679323..f1954cb 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -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 From bca191f4a0aefa1094f67be3564225ca6bd3d06f Mon Sep 17 00:00:00 2001 From: Yoan Blanc Date: Wed, 14 Sep 2022 06:21:50 +0200 Subject: [PATCH 2/2] fixup! fix: Docker image to use eclipse-temurin Signed-off-by: Yoan Blanc --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47e8fc2..0197a8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up JDK 1.§§ + - name: Set up JDK 1.11 uses: actions/setup-java@v3 with: distribution: temurin diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 206fdb3..f561c02 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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