AdoptOpenJDK provides docker images in two different DockerHub repos
DockerHub maintained images (aka official DockerHub images) at this link.
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.
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
RUNmkdir /opt/appCOPY japp.jar /opt/appCMD ["java", "-jar", "/opt/app/japp.jar"]
You can build and run the Docker image as shown in the following example:
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:
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:
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.
By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.
Privacy Preference Center
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
Manage Consent Preferences
Functional Cookies
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
Strictly Necessary Cookies
Always Active
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.
Performance Cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
Targeting Cookies
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.