Introducing our new CEO Don Johnson - Read More

adoptopenjdk/openjdk11-openj9

By adoptopenjdk

Updated 4 days ago

Docker Images for Eclipse OpenJ9 Version 11 binaries built by AdoptOpenJDK.

Image
Languages & Frameworks
Integration & Delivery
Internet of Things
57

10M+

Official vs Non-Official Docker images

AdoptOpenJDK provides docker images in two different DockerHub repos

  1. DockerHub maintained images (aka official DockerHub images) at this link.
  2. AdoptOpenJDK maintained images (this repo).

Both images use the same underlying Java binaries from AdoptOpenJDK, but they support different OS flavours as below. Also the official DockerHub images are updated for underlying OS updates as and when the OS fixes are available. The AdoptOpenJDK maintained images are rebuilt everyday.

  • See Official Docker Images for the regular jdk and jre images based on Ubuntu and Windows.
  • Use this repo for Alpine, CentOS, ClefOS, Debian, Debian-Slim, UBI and UBI-Minimal based images as well as Slim images for all supported OSes.
Supported tags and respective Dockerfile links

Release Builds

Nightly Builds

Quick reference

Overview

The images in this repository contain OpenJDK binaries that are built with Eclipse OpenJ9.

Eclipse OpenJ9 is a high performance, scalable, Java™ virtual machine (JVM) implementation that has a proven track record of running Java applications in production environments. Contributed to the Eclipse project by IBM, the OpenJ9 JVM underpins the IBM SDK, Java Technology Edition product that is a core component of many IBM Enterprise software products. Continued development of OpenJ9 at the Eclipse foundation ensures wider collaboration, fresh innovation, and the opportunity to influence the development of OpenJ9 for the next generation of Java applications.

OpenJDK binaries that include Eclipse OpenJ9 are available through AdoptOpenJDK.

Java and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates.

Multi-arch image

OpenJ9 has multi-arch support so the same commands work on all supported architectures.

How to use this Image

To run a pre-built jar file with the latest Java 11 OpenJDK image, use the following commands:

FROM adoptopenjdk/openjdk11-openj9:latest
RUN mkdir /opt/app
COPY japp.jar /opt/app
CMD ["java", "-jar", "/opt/app/japp.jar"]

You can build and run the Docker image as shown in the following example:

$ docker build -t japp .
$ docker run -it --rm japp

To get a specific version of a docker image, add the build number as shown in the following example:

$ docker run --rm -it adoptopenjdk/openjdk11-openj9:jre-11.0.9_11_openj9-0.23.0 java -version
openjdk version "11.0.9" 2020-10-20
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9+11)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.23.0, JRE 11 Linux amd64-64-Bit Compressed References 20201022_810 (JIT enabled, AOT enabled)
OpenJ9   - 0394ef754
OMR      - 582366ae5
JCL      - 3b09cfd7e9 based on jdk-11.0.9+11)
Using the Class Data Sharing feature

Eclipse OpenJ9 provides a feature called Class data sharing. This mechanism offers transparent and dynamic sharing of data between multiple Java virtual machines (JVMs) running on the same host, which reduces the amount of physical memory consumed by each JVM instance. By providing partially verified classes and possibly pre-loaded classes in memory, this mechanism also improves the start up time of the JVM.

To enable class data sharing between JVMs that are running in different containers on the same host, a common location must be shared between containers. This requirement can be satisfied through the host or a data volume container. When enabled, class data sharing creates a named "class cache", which is a memory-mapped file, at the common location. This feature is enabled by passing the -Xshareclasses option to the JVM as shown in the following Dockerfile example:

FROM adoptopenjdk/openjdk11-openj9:nightly
RUN mkdir /opt/shareclasses
RUN mkdir /opt/app
COPY japp.jar /opt/app
CMD ["java", "-Xshareclasses:cacheDir=/opt/shareclasses", "-jar", "/opt/app/japp.jar"]

The cacheDir sub-option specifies the location of the class cache. For example /opt/sharedclasses. When sharing through the host, a host path must be mounted onto the container at the location the JVM expects to find the class cache. For example:

docker build -t japp .
docker run -it -v /path/on/host/shareclasses/dir:/opt/shareclasses japp

When sharing through a data volume container, create a named data volume container that shares a volume. For example:

docker create -v /opt/shareclasses --name classcache japp /bin/true

Then, start your JVM container by using the --volumes-from flag to mount the shared volume, as shown in the following example:

docker run -it --volumes-from classcache japp

License

The Dockerfiles and associated scripts are licensed under the Apache License, Version 2.0.

Licenses for the products installed within the images:

As with all Docker images, other software is likely to be included, which might be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Docker Pull Command

docker pull adoptopenjdk/openjdk11-openj9