From 5828af5d7ec8804c67b2291a6d3db28b716316c7 Mon Sep 17 00:00:00 2001 From: Pavol Loffay Date: Mon, 4 Nov 2019 19:03:53 +0100 Subject: [PATCH] Use openjdk 8 slim image (#81) Signed-off-by: Pavol Loffay --- Dockerfile | 13 +++++++++---- entrypoint.sh | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index a65f291..3246592 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,7 @@ # the License. # -FROM openjdk:alpine - -MAINTAINER Pavol Loffay +FROM openjdk:8-jdk-slim as builder ENV APP_HOME /app/ @@ -30,10 +28,17 @@ COPY mvnw $APP_HOME WORKDIR $APP_HOME RUN ./mvnw package -Dlicense.skip=true -DskipTests && rm -rf ~/.m2 +FROM openjdk:8-jre-slim +MAINTAINER Pavol Loffay +ENV APP_HOME /app/ +COPY --from=builder $APP_HOME/jaeger-spark-dependencies/target/jaeger-spark-dependencies-0.0.1-SNAPSHOT.jar $APP_HOME/ + +WORKDIR $APP_HOME + COPY entrypoint.sh / RUN chgrp root /etc/passwd && chmod g+rw /etc/passwd USER 185 ENTRYPOINT ["/entrypoint.sh"] -CMD java ${JAVA_OPTS} -jar jaeger-spark-dependencies/target/jaeger-spark-dependencies-0.0.1-SNAPSHOT.jar +CMD java ${JAVA_OPTS} -jar $APP_HOME/jaeger-spark-dependencies-0.0.1-SNAPSHOT.jar diff --git a/entrypoint.sh b/entrypoint.sh index 8f77b2f..322d2c2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,7 +16,7 @@ # Taken from https://github.com/radanalyticsio/openshift-spark/blob/2.4/modules/common/added/scripts/entrypoint#L50 # OpenShift passes random UID and spark requires it to be present in /etc/passwd -function patch_uid { +patch_uid() { # Check whether there is a passwd entry for the container UID myuid=$(id -u) mygid=$(id -g)