diff --git a/Dockerfile b/Dockerfile index 5d4e57b..6a91d6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,19 @@ -FROM adoptopenjdk/openjdk11:latest +FROM adoptopenjdk/openjdk11-openj9:jdk-11.0.5_10_openj9-0.17.0-alpine-slim ARG BMRG_TAG -VOLUME /tmp -EXPOSE 7716 -ADD target/service-repository-$BMRG_TAG.jar service.jar -RUN sh -c 'touch /service.jar' ENV JAVA_OPTS="" -ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /service.jar" ] +ENV BMRG_HOME=/opt/boomerang +ENV BMRG_SVC=service-repository-$BMRG_TAG + +WORKDIR $BMRG_HOME +ADD target/$BMRG_SVC.jar service.jar +RUN sh -c 'touch /service.jar' + +# Create user, chown, and chmod. +# OpenShift requires that a numeric user is used in the USER declaration instead of the user name +RUN chmod -R u+x $BMRG_HOME \ + && chgrp -R 0 $BMRG_HOME \ + && chmod -R g=u $BMRG_HOME +USER 2000 + +EXPOSE 8080 +ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar ./service.jar" ]