Then I would highly recommend AdoptOpenJDK, which is currently the most popular build. I did, however, find an up-to-date and supported build of Java 7, by Azul: īut you said you're running version 8, looking to go to 11. OK, so you clarified in your comment, that you are not actually looking for version 7 builds. 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 ).Įdit3: Recent version 7 support and v8+ from AdoptOpenJdk That shouldn't be necessarily a problem, depending on where you want to run that image (i.e., facing the public internet vs. Note that even the LTS-support for Debian Jessie ends next month:
So the GPL with classpath exception should be the license that applies (read: you can use it commercially). Those are - presumably, I've only verified that for Debian - builds of the open source OpenJDK project by that distribution.
On the OpenJDK Docker Hub page, you can see different images shipping Java 7 builds, some with Alpine Linux and some with Debian Jessie. This version also predates the license changes to Oracle binaries, so the whole AdoptOpenJDK argument doesn't matter.
This version is quite old (first release in 2011!) and you will not find any long term support for without paying for commercial support. You specifically asked for Java version 7. I want to address your comment on my answer.
But you can download OpenJDK and build it yourself, if you like.Įdit: You could also ssh into the image and run java -version are only there, because Oracle doesn't provide binary builds freely anymore. The binary distributions by AdoptOpenJDK, Amazon Corretto, etc. Anyway, Linux distributions built their own binaries. 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.īy the way, until Version including 8, the Oracle JDK was more freely available. The GPLv2 as per the Oracle Linux End User Agreement (EULA). The default image as well as the -oracle and -oraclelinux7 variantsĪre based on the official Oracle Linux 7 image which is provided under These are the suiteĬode names for releases of Debian and indicate which release the image
See the Docker Hub page for the full readme on how to use this Docker image and for information regarding contributing and issues.
Let’s run an example.It's all written there on the docker page: Maintained by: the Docker Community This is the Git repo of the Docker 'Official Image' for openjdk (not to be confused with any official openjdk image provided by openjdk upstream). It sets - by default - the maximum heap size to 1/4 of system memory and sets some thread pools size (for example for GC) to the number of physical cores. The JVM “sees” the whole memory and all CPU cores available on the system and aligns its resources to it. It’s especially important when running containers on an orchestration system, like Kubernetes or DC/OS. Unfortunately, containers like Docker don't provide container specific information in /proc.
It also allows to plan for the hardware capacity. The JVM historically looked in /proc to figure out how much memory was available and then set its heap size based on that value. Hack on the JDK itself, right here in the OpenJDK Community: Browse the code on the web, clone a repository to make a local copy, and contribute a patch to fix a bug, enhance an existing component, or define a new feature. Limiting resources improves reliability and stability of applications. 4.1 Review the commands in the Dockerfile, it creates a docker image base on openjdk:8-jdk-alpine, an alpine linux with openjdk-8 installed, changed the working directory with WORKDIR and copy the executable jar and its dependencies to this path /usr/local/runme/, and run the jar file with ENTRYPOINT. It’s definitely a good idea to limit memory and CPU while running applications in containers - it prevents an application from using the whole available memory and/or CPU, which makes other containers running on the same system unresponsive.
Have you ever experienced “random” failures of JVM based applications running in the docker? Or maybe some strange freezes? Both could be caused by poor docker support in Java 8 (which is still widely used).ĭocker uses control groups (cgroups) to limit resources.