2 # This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
4 # Before building the container image run:
8 # Then, build the image with:
10 # docker build -f src/main/docker/Dockerfile.jvm -t quarkus/beige0-jvm .
12 # Then run the container using:
14 # docker run -i --rm -p 8080:8080 quarkus/beige0-jvm
16 # If you want to include the debug port into your docker image
17 # you will have to expose the debug port (default 5005) like this : EXPOSE 8080 5050
19 # Then run the container using :
21 # docker run -i --rm -p 8080:8080 -p 5005:5005 -e JAVA_ENABLE_DEBUG="true" quarkus/beige0-jvm
24 FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3
26 ARG JAVA_PACKAGE=java-11-openjdk-headless
27 ARG RUN_JAVA_VERSION=1.3.8
28 ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
29 # Install java and the run-java script
30 # Also set up permissions for user `1001`
31 RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
33 && microdnf clean all \
34 && mkdir /deployments \
35 && chown 1001 /deployments \
36 && chmod "g+rwX" /deployments \
37 && chown 1001:root /deployments \
38 && curl https://repo1.maven.org/maven2/io/fabric8/run-java-sh/${RUN_JAVA_VERSION}/run-java-sh-${RUN_JAVA_VERSION}-sh.sh -o /deployments/run-java.sh \
39 && chown 1001 /deployments/run-java.sh \
40 && chmod 540 /deployments/run-java.sh \
41 && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
43 # Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
44 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
45 COPY build/lib/* /deployments/lib/
46 COPY build/*-runner.jar /deployments/app.jar
51 ENTRYPOINT [ "/deployments/run-java.sh" ]