Skip to content

Commit

Permalink
Use openjdk 8 slim image (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay committed Nov 4, 2019
1 parent 71cb6f5 commit 5828af5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
# the License.
#

FROM openjdk:alpine

MAINTAINER Pavol Loffay <ploffay@redhat.com>
FROM openjdk:8-jdk-slim as builder

ENV APP_HOME /app/

Expand All @@ -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 <ploffay@redhat.com>
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
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5828af5

Please sign in to comment.