JRE ready image
100K+
jready is a set of minimalist Docker images that are ready to execute a JRE.
More than a small size, the goal of minimal Docker image is to enhance security by reducing the attack surface.
Note than these images don't include a JRE:
An example below shows how a JRE can be integrated on top of these images.
Based on the official BusyBox glibc image
Based on the official Alpine image and Alpine GLIBC package
This example is using AdoptOpenJDK 15. It's based from the busybox based image but alpine can be used instead with no other changes in the Dockerfile.
Dockerfile
Create a minimal JRE image. If needed the JLINK_MODULES list (comma-separated) can be completed to fit other needs.
FROM xfournet/jready:busybox
ARG JDK_URL=https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15%2B36/OpenJDK15U-jdk_x64_linux_hotspot_15_36.tar.gz
ARG JLINK_OPTIONS="--vm=server --compress=2 --no-header-files --no-man-pages"
ARG JLINK_MODULES="java.base"
ARG JRE_DIR="/opt/jre"
RUN \
# Download and extract JDK
wget ${JDK_URL} -O - | tar xz -C /tmp && \
# Build customized JRE
/tmp/jdk-*/bin/jlink --output ${JRE_DIR} --add-modules ${JLINK_MODULES} ${JLINK_OPTIONS} && \
# Remove JDK
rm -r /tmp/jdk-*
ENV PATH="${JRE_DIR}/bin:${PATH}"
Image build and test
docker build -t myjre .
docker run --rm -ti myjre
# in container
java --version
Content type
Image
Digest
Size
8 MB
Last updated
about 4 years ago
docker pull xfournet/jready:alpine