From f7bf7c44664a9f48a8839a961680f17314dcae6e Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 28 Jan 2020 22:31:12 +0100 Subject: Maven, Gradle: Build Docker image. Change-Id: Ibf90cd31af67f847d67bd34fe1a8d73d49550088 --- src/main/docker/Dockerfile.jvm | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/main/docker') diff --git a/src/main/docker/Dockerfile.jvm b/src/main/docker/Dockerfile.jvm index c7ff48c..5c726c5 100644 --- a/src/main/docker/Dockerfile.jvm +++ b/src/main/docker/Dockerfile.jvm @@ -7,28 +7,25 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/mulkcms2-jvm . +# docker build -f src/main/docker/Dockerfile.jvm -t docker.benkard.de/mulk/mulkcms2 . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/mulkcms2-jvm +# docker run -i --rm -p 8080:8080 docker.benkard.de/mulk/mulkcms2 # ### -FROM fabric8/java-alpine-openjdk8-jre:1.6.5 -ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" -ENV AB_ENABLED=jmx_exporter +FROM adoptopenjdk:13-jre-hotspot -# Be prepared for running in OpenShift too -RUN adduser -G root --no-create-home --disabled-password 1001 \ - && chown -R 1001 /deployments \ +RUN mkdir -p /deployments + +RUN useradd --user-group --uid 1200 java \ + && chown -R java /deployments \ && chmod -R "g+rwX" /deployments \ - && chown -R 1001:root /deployments + && chown -R java:java /deployments COPY build/lib/* /deployments/lib/ COPY build/*-runner.jar /deployments/app.jar EXPOSE 8080 -# run with user 1001 -USER 1001 - -ENTRYPOINT [ "/deployments/run-java.sh" ] \ No newline at end of file +USER java +ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-XX:ShenandoahGCHeuristics=compact", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager", "-jar", "/deployments/app.jar"] -- cgit v1.2.3