who is the distributor of openjdk docker image

Viewed 1358

my understanding is you need to have a distributor to use openjdk someone like (oracle openjdk, adoptopenjdk) but on docker repo for openjdk how do I find out who is the distributor if I just use their reference documentation

{the code below in copied from openjdk official docker repo}

FROM openjdk:11
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN javac Main.java
CMD ["java", "Main"] 

moving from java 8 to java 11

1 Answers

It's all written there on the docker page: https://hub.docker.com/_/openjdk/

openjdk:<version>

This is the defacto image. [...] These are the suite code names for releases of Debian and indicate which release the image is based on. [...]

openjdk:<version> (from 12 onwards), [...]

Starting with openjdk:12 the default image as well as the -oracle and -oraclelinux7 variants are based on the official Oracle Linux 7 image which is provided under the GPLv2 as per the Oracle Linux End User Agreement (EULA). [...]

TL;DR: the images are maintained by the Docker community, versions < 12 ship the OpenJDK build from Debian or Alpine Linux, later versions ship the Oracle builds.

By the way, until Version including 8, the Oracle JDK was more freely available. Anyway, Linux distributions built their own binaries. The binary distributions by AdoptOpenJDK, Amazon Corretto, etc. are only there, because Oracle doesn't provide binary builds freely anymore. But you can download OpenJDK and build it yourself, if you like.

Edit: You could also ssh into the image and run java -version

Edit2: Java 7 and support

I want to address your comment on my answer. You specifically asked for Java version 7. This version is quite old (first release in 2011!) and you will not find any long term support for without paying for commercial support. Period. This version also predates the license changes to Oracle binaries, so the whole AdoptOpenJDK argument doesn't matter.

On the OpenJDK Docker Hub page, you can see different images shipping Java 7 builds, some with Alpine Linux and some with Debian Jessie. Those are - presumably, I've only verified that for Debian - builds of the open source OpenJDK project by that distribution. So the GPL with classpath exception should be the license that applies (read: you can use it commercially). Note that even the LTS-support for Debian Jessie ends next month: https://wiki.debian.org/LTS

That shouldn't be necessarily a problem, depending on where you want to run that image (i.e., facing the public internet vs. private intranet).

If you have to stick with such an old version of Java, you have few options (maybe taking a modern linux image and build OpenJDK yourself [that will be painful, I imagine]).

Edit3: Recent version 7 support and v8+ from AdoptOpenJdk

OK, so you clarified in your comment, that you are not actually looking for version 7 builds. I did, however, find an up-to-date and supported build of Java 7, by Azul: https://hub.docker.com/r/azul/zulu-openjdk

But you said you're running version 8, looking to go to 11. Then I would highly recommend AdoptOpenJDK, which is currently the most popular build. They offer Docker images as well (Note: they offer different JVMs: Hotspot is the default and highly recommended, OpenJ9 is based on a development by IBM)

Related