-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.jvm
38 lines (31 loc) · 1.59 KB
/
Dockerfile.jvm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM registry.access.redhat.com/ubi9/openjdk-21-runtime:latest
ARG build_url=default
ARG git_commit=default
ARG git_url=default
LABEL labs.build.url="${build_url}" \
labs.git.tag="${git_commit}" \
labs.git.url="${git_url}"
ARG RUN_JAVA_VERSION=1.3.8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
USER root
# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf -y install ca-certificates \
&& microdnf -y update \
&& microdnf clean all \
&& 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 \
&& chown 185 /deployments/run-java.sh \
&& chmod 755 /deployments/run-java.sh \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
# Remove package managers
RUN rpm -e --nodeps $(rpm -qa '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*' 'microdnf*')
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dquarkus.http.ssl.certificate.key-store-file=keystore.jks"
# We make four distinct layers so if there are application changes the library layers can be re-used
COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/
COPY --chown=1001 target/quarkus-app/*.jar /deployments/
COPY --chown=1001 target/quarkus-app/app/ /deployments/app/
COPY --chown=1001 target/quarkus-app/quarkus/ /deployments/quarkus/
EXPOSE 8080
USER 185
ENTRYPOINT [ "/deployments/run-java.sh" ]