Provide ubi-minimal with java installed
See original GitHub issueDescription
The current standard Quarkus JVM Dockerfile (as of provided by code.quarkus.io) is based on the registry.access.redhat.com/ubi8/ubi-minimal:8.1
image. Since this image does not include java and an updated microdnf, it always takes quite a while to build the first layers of this image. This is especially true for our CI builds, as they don’t always have the previous layers cached (mutliple machines) and thus we have longer build times than needed.
Therefore, I would like to propose to provide something like a ubi-minimal-java:8.1-java11
or even a ubi-minimal-quarkus:8.1-quarkus1.5.2
image that includes everything of the standard JVM Dockerfile up until the actual application libraries are copied into the container.
Implementation ideas Automatically build a regularly updated version with the main part of the standard quarkus jvm Dockerfile (see below) and publish it on a docker repository.
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1
ARG JAVA_PACKAGE=java-11-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
# Install java and the run-java script
# Also set up permissions for user `1001`
RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
&& microdnf update \
&& microdnf clean all \
&& mkdir /deployments \
&& chown 1001 /deployments \
&& chmod "g+rwX" /deployments \
&& chown 1001:root /deployments \
&& 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 1001 /deployments/run-java.sh \
&& chmod 540 /deployments/run-java.sh \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
# 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"
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:17 (11 by maintainers)
Not sure if this solves the initial issue, but we’re running Quarkus on Java 14 on a ubi-minimal (8.2) based image by Eclipse Adoptium (AdoptOpenJDK),
adoptopenjdk/openjdk14:jre-14.0.2_12-ubi-minimal
.Here’s our slightly modified Dockerfile
Furthermore, it would be interesting to have a Java 14 version as well. If I understand correctly, Quarkus should run on Java 14, am I right? Unfortunately, I wasn’t able to figure out how to install Java 14 with microdnf. Simply updating the
java-11-openjdk-headless
tojava-14-openjdk-headless
does not work.