-
Maintained by:
the Docker Community -
Where to get help:
the Docker Community Forums, the Docker Community Slack, or Stack Overflow
(See "What's the difference between 'Shared' and 'Simple' tags?" in the FAQ.)
17-ea-19-jdk-oraclelinux8
,17-ea-19-oraclelinux8
,17-ea-jdk-oraclelinux8
,17-ea-oraclelinux8
,17-jdk-oraclelinux8
,17-oraclelinux8
,17-ea-19-jdk-oracle
,17-ea-19-oracle
,17-ea-jdk-oracle
,17-ea-oracle
,17-jdk-oracle
,17-oracle
17-ea-19-jdk-oraclelinux7
,17-ea-19-oraclelinux7
,17-ea-jdk-oraclelinux7
,17-ea-oraclelinux7
,17-jdk-oraclelinux7
,17-oraclelinux7
17-ea-19-jdk-buster
,17-ea-19-buster
,17-ea-jdk-buster
,17-ea-buster
,17-jdk-buster
,17-buster
17-ea-19-jdk-slim-buster
,17-ea-19-slim-buster
,17-ea-jdk-slim-buster
,17-ea-slim-buster
,17-jdk-slim-buster
,17-slim-buster
,17-ea-19-jdk-slim
,17-ea-19-slim
,17-ea-jdk-slim
,17-ea-slim
,17-jdk-slim
,17-slim
17-ea-14-jdk-alpine3.13
,17-ea-14-alpine3.13
,17-ea-jdk-alpine3.13
,17-ea-alpine3.13
,17-jdk-alpine3.13
,17-alpine3.13
,17-ea-14-jdk-alpine
,17-ea-14-alpine
,17-ea-jdk-alpine
,17-ea-alpine
,17-jdk-alpine
,17-alpine
17-ea-14-jdk-alpine3.12
,17-ea-14-alpine3.12
,17-ea-jdk-alpine3.12
,17-ea-alpine3.12
,17-jdk-alpine3.12
,17-alpine3.12
17-ea-19-jdk-windowsservercore-1809
,17-ea-19-windowsservercore-1809
,17-ea-jdk-windowsservercore-1809
,17-ea-windowsservercore-1809
,17-jdk-windowsservercore-1809
,17-windowsservercore-1809
17-ea-19-jdk-windowsservercore-ltsc2016
,17-ea-19-windowsservercore-ltsc2016
,17-ea-jdk-windowsservercore-ltsc2016
,17-ea-windowsservercore-ltsc2016
,17-jdk-windowsservercore-ltsc2016
,17-windowsservercore-ltsc2016
17-ea-19-jdk-nanoserver-1809
,17-ea-19-nanoserver-1809
,17-ea-jdk-nanoserver-1809
,17-ea-nanoserver-1809
,17-jdk-nanoserver-1809
,17-nanoserver-1809
16.0.1-jdk-oraclelinux8
,16.0.1-oraclelinux8
,16.0-jdk-oraclelinux8
,16.0-oraclelinux8
,16-jdk-oraclelinux8
,16-oraclelinux8
,jdk-oraclelinux8
,oraclelinux8
,16.0.1-jdk-oracle
,16.0.1-oracle
,16.0-jdk-oracle
,16.0-oracle
,16-jdk-oracle
,16-oracle
,jdk-oracle
,oracle
16.0.1-jdk-oraclelinux7
,16.0.1-oraclelinux7
,16.0-jdk-oraclelinux7
,16.0-oraclelinux7
,16-jdk-oraclelinux7
,16-oraclelinux7
,jdk-oraclelinux7
,oraclelinux7
16.0.1-jdk-buster
,16.0.1-buster
,16.0-jdk-buster
,16.0-buster
,16-jdk-buster
,16-buster
,jdk-buster
,buster
16.0.1-jdk-slim-buster
,16.0.1-slim-buster
,16.0-jdk-slim-buster
,16.0-slim-buster
,16-jdk-slim-buster
,16-slim-buster
,jdk-slim-buster
,slim-buster
,16.0.1-jdk-slim
,16.0.1-slim
,16.0-jdk-slim
,16.0-slim
,16-jdk-slim
,16-slim
,jdk-slim
,slim
16.0.1-jdk-windowsservercore-1809
,16.0.1-windowsservercore-1809
,16.0-jdk-windowsservercore-1809
,16.0-windowsservercore-1809
,16-jdk-windowsservercore-1809
,16-windowsservercore-1809
,jdk-windowsservercore-1809
,windowsservercore-1809
16.0.1-jdk-windowsservercore-ltsc2016
,16.0.1-windowsservercore-ltsc2016
,16.0-jdk-windowsservercore-ltsc2016
,16.0-windowsservercore-ltsc2016
,16-jdk-windowsservercore-ltsc2016
,16-windowsservercore-ltsc2016
,jdk-windowsservercore-ltsc2016
,windowsservercore-ltsc2016
16.0.1-jdk-nanoserver-1809
,16.0.1-nanoserver-1809
,16.0-jdk-nanoserver-1809
,16.0-nanoserver-1809
,16-jdk-nanoserver-1809
,16-nanoserver-1809
,jdk-nanoserver-1809
,nanoserver-1809
11.0.11-9-jdk-oraclelinux8
,11.0.11-9-oraclelinux8
,11.0.11-jdk-oraclelinux8
,11.0.11-oraclelinux8
,11.0-jdk-oraclelinux8
,11.0-oraclelinux8
,11-jdk-oraclelinux8
,11-oraclelinux8
,11.0.11-9-jdk-oracle
,11.0.11-9-oracle
,11.0.11-jdk-oracle
,11.0.11-oracle
,11.0-jdk-oracle
,11.0-oracle
,11-jdk-oracle
,11-oracle
11.0.11-9-jdk-oraclelinux7
,11.0.11-9-oraclelinux7
,11.0.11-jdk-oraclelinux7
,11.0.11-oraclelinux7
,11.0-jdk-oraclelinux7
,11.0-oraclelinux7
,11-jdk-oraclelinux7
,11-oraclelinux7
11.0.11-9-jdk-buster
,11.0.11-9-buster
,11.0.11-jdk-buster
,11.0.11-buster
,11.0-jdk-buster
,11.0-buster
,11-jdk-buster
,11-buster
11.0.11-9-jdk-slim-buster
,11.0.11-9-slim-buster
,11.0.11-jdk-slim-buster
,11.0.11-slim-buster
,11.0-jdk-slim-buster
,11.0-slim-buster
,11-jdk-slim-buster
,11-slim-buster
,11.0.11-9-jdk-slim
,11.0.11-9-slim
,11.0.11-jdk-slim
,11.0.11-slim
,11.0-jdk-slim
,11.0-slim
,11-jdk-slim
,11-slim
11.0.11-9-jdk-windowsservercore-1809
,11.0.11-9-windowsservercore-1809
,11.0.11-jdk-windowsservercore-1809
,11.0.11-windowsservercore-1809
,11.0-jdk-windowsservercore-1809
,11.0-windowsservercore-1809
,11-jdk-windowsservercore-1809
,11-windowsservercore-1809
11.0.11-9-jdk-windowsservercore-ltsc2016
,11.0.11-9-windowsservercore-ltsc2016
,11.0.11-jdk-windowsservercore-ltsc2016
,11.0.11-windowsservercore-ltsc2016
,11.0-jdk-windowsservercore-ltsc2016
,11.0-windowsservercore-ltsc2016
,11-jdk-windowsservercore-ltsc2016
,11-windowsservercore-ltsc2016
11.0.11-9-jdk-nanoserver-1809
,11.0.11-9-nanoserver-1809
,11.0.11-jdk-nanoserver-1809
,11.0.11-nanoserver-1809
,11.0-jdk-nanoserver-1809
,11.0-nanoserver-1809
,11-jdk-nanoserver-1809
,11-nanoserver-1809
11.0.11-9-jre-buster
,11.0.11-jre-buster
,11.0-jre-buster
,11-jre-buster
11.0.11-9-jre-slim-buster
,11.0.11-jre-slim-buster
,11.0-jre-slim-buster
,11-jre-slim-buster
,11.0.11-9-jre-slim
,11.0.11-jre-slim
,11.0-jre-slim
,11-jre-slim
11.0.11-9-jre-windowsservercore-1809
,11.0.11-jre-windowsservercore-1809
,11.0-jre-windowsservercore-1809
,11-jre-windowsservercore-1809
11.0.11-9-jre-windowsservercore-ltsc2016
,11.0.11-jre-windowsservercore-ltsc2016
,11.0-jre-windowsservercore-ltsc2016
,11-jre-windowsservercore-ltsc2016
11.0.11-9-jre-nanoserver-1809
,11.0.11-jre-nanoserver-1809
,11.0-jre-nanoserver-1809
,11-jre-nanoserver-1809
8u292-jdk-oraclelinux8
,8u292-oraclelinux8
,8-jdk-oraclelinux8
,8-oraclelinux8
,8u292-jdk-oracle
,8u292-oracle
,8-jdk-oracle
,8-oracle
8u292-jdk-oraclelinux7
,8u292-oraclelinux7
,8-jdk-oraclelinux7
,8-oraclelinux7
8u292-jdk-buster
,8u292-buster
,8-jdk-buster
,8-buster
8u292-jdk-slim-buster
,8u292-slim-buster
,8-jdk-slim-buster
,8-slim-buster
,8u292-jdk-slim
,8u292-slim
,8-jdk-slim
,8-slim
8u292-jdk-windowsservercore-1809
,8u292-windowsservercore-1809
,8-jdk-windowsservercore-1809
,8-windowsservercore-1809
8u292-jdk-windowsservercore-ltsc2016
,8u292-windowsservercore-ltsc2016
,8-jdk-windowsservercore-ltsc2016
,8-windowsservercore-ltsc2016
8u292-jdk-nanoserver-1809
,8u292-nanoserver-1809
,8-jdk-nanoserver-1809
,8-nanoserver-1809
8u292-jre-buster
,8-jre-buster
8u292-jre-slim-buster
,8-jre-slim-buster
,8u292-jre-slim
,8-jre-slim
8u292-jre-windowsservercore-1809
,8-jre-windowsservercore-1809
8u292-jre-windowsservercore-ltsc2016
,8-jre-windowsservercore-ltsc2016
8u292-jre-nanoserver-1809
,8-jre-nanoserver-1809
17-ea-19-jdk
,17-ea-19
,17-ea-jdk
,17-ea
,17-jdk
,17
:17-ea-19-jdk-windowsservercore
,17-ea-19-windowsservercore
,17-ea-jdk-windowsservercore
,17-ea-windowsservercore
,17-jdk-windowsservercore
,17-windowsservercore
:17-ea-19-jdk-nanoserver
,17-ea-19-nanoserver
,17-ea-jdk-nanoserver
,17-ea-nanoserver
,17-jdk-nanoserver
,17-nanoserver
:16.0.1-jdk
,16.0.1
,16.0-jdk
,16.0
,16-jdk
,16
,jdk
,latest
:16.0.1-jdk-windowsservercore
,16.0.1-windowsservercore
,16.0-jdk-windowsservercore
,16.0-windowsservercore
,16-jdk-windowsservercore
,16-windowsservercore
,jdk-windowsservercore
,windowsservercore
:16.0.1-jdk-nanoserver
,16.0.1-nanoserver
,16.0-jdk-nanoserver
,16.0-nanoserver
,16-jdk-nanoserver
,16-nanoserver
,jdk-nanoserver
,nanoserver
:11.0.11-9-jdk
,11.0.11-9
,11.0.11-jdk
,11.0.11
,11.0-jdk
,11.0
,11-jdk
,11
:11.0.11-9-jdk-windowsservercore
,11.0.11-9-windowsservercore
,11.0.11-jdk-windowsservercore
,11.0.11-windowsservercore
,11.0-jdk-windowsservercore
,11.0-windowsservercore
,11-jdk-windowsservercore
,11-windowsservercore
:11.0.11-9-jdk-nanoserver
,11.0.11-9-nanoserver
,11.0.11-jdk-nanoserver
,11.0.11-nanoserver
,11.0-jdk-nanoserver
,11.0-nanoserver
,11-jdk-nanoserver
,11-nanoserver
:11.0.11-9-jre
,11.0.11-jre
,11.0-jre
,11-jre
:11.0.11-9-jre-windowsservercore
,11.0.11-jre-windowsservercore
,11.0-jre-windowsservercore
,11-jre-windowsservercore
:11.0.11-9-jre-nanoserver
,11.0.11-jre-nanoserver
,11.0-jre-nanoserver
,11-jre-nanoserver
:8u292-jdk
,8u292
,8-jdk
,8
:8u292-jdk-windowsservercore
,8u292-windowsservercore
,8-jdk-windowsservercore
,8-windowsservercore
:8u292-jdk-nanoserver
,8u292-nanoserver
,8-jdk-nanoserver
,8-nanoserver
:8u292-jre
,8-jre
:8u292-jre-windowsservercore
,8-jre-windowsservercore
:8u292-jre-nanoserver
,8-jre-nanoserver
:
-
Where to file issues:
https://github.com/docker-library/openjdk/issues -
Supported architectures: (more info)
amd64
,arm64v8
,windows-amd64
-
Published image artifact details:
repo-info repo'srepos/openjdk/
directory (history)
(image metadata, transfer size, etc) -
Image updates:
official-images repo'slibrary/openjdk
label
official-images repo'slibrary/openjdk
file (history) -
Source of this description:
docs repo'sopenjdk/
directory (history)
OpenJDK (Open Java Development Kit) is a free and open source implementation of the Java Platform, Standard Edition (Java SE). OpenJDK is the official reference implementation of Java SE since version 7.
Java is a registered trademark of Oracle and/or its affiliates.
The most straightforward way to use this image is to use a Java container as both the build and runtime environment. In your Dockerfile
, writing something along the lines of the following will compile and run your project:
FROM openjdk:7
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
RUN javac Main.java
CMD ["java", "Main"]
You can then run and build the Docker image:
$ docker build -t my-java-app .
$ docker run -it --rm --name my-running-app my-java-app
There may be occasions where it is not appropriate to run your app inside a container. To compile, but not run your app inside the Docker instance, you can write something like:
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp openjdk:7 javac Main.java
This will add your current directory as a volume to the container, set the working directory to the volume, and run the command javac Main.java
which will tell Java to compile the code in Main.java
and output the Java class file to Main.class
.
On startup the JVM tries to detect the number of available CPU cores and RAM to adjust its internal parameters (like the number of garbage collector threads to spawn) accordingly. When the container is ran with limited CPU/RAM then the standard system API used by the JVM for probing it will return host-wide values. This can cause excessive CPU usage and memory allocation errors with older versions of the JVM.
Inside Linux containers, OpenJDK versions 8 and later can correctly detect the container-limited number of CPU cores and available RAM. For all currently supported OpenJDK versions this is turned on by default.
Inside Windows Server (non-Hyper-V) containers, the limit for the number of available CPU cores doesn't work (it's ignored by Host Compute Service). To set the limit manually the JVM can be started as:
$ start /b /wait /affinity 0x3 path/to/java.exe ...
In this example CPU affinity hex mask 0x3
will limit the JVM to 2 CPU cores.
RAM limit is supported by Windows Server containers, but currently the JVM cannot detect it. To prevent excessive memory allocations, -XX:MaxRAM=...
option must be specified with the value that is not bigger than the containers RAM limit.
Some shells (notably, the BusyBox /bin/sh
included in Alpine Linux) do not support environment variables with periods in the names (which are technically not POSIX compliant), and thus strip them instead of passing them through (as Bash does). If your application requires environment variables of this form, either use CMD ["java", ...]
directly (no shell), or (install and) use Bash explicitly instead of /bin/sh
.
The openjdk
images come in many flavors, each designed for a specific use case.
This is the defacto image. If you are unsure about what your needs are, you probably want to use this one. It is designed to be used both as a throw away container (mount your source code and start the container to start your app), as well as the base to build other images off of.
Some of these tags may have names like buster in them. These are the suite code names for releases of Debian and indicate which release the image is based on. If your image needs to install any additional packages beyond what comes with the image, you'll likely want to specify one of these explicitly to minimize breakage when there are new releases of Debian.
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).
The OpenJDK binaries in the default image as well as the -oracle
and -oraclelinux7
variants are built by Oracle and are sourced from the OpenJDK community. These binaries are licensed under the GPLv2 with the Classpath Exception.
This image is based on the popular Alpine Linux project, available in the alpine
official image. Alpine Linux is much smaller than most distribution base images (~5MB), and thus leads to much slimmer images in general.
The OpenJDK port for Alpine is not in a supported release by OpenJDK, since it is not in the mainline code base. It is only available as early access builds of OpenJDK Project Portola. See also this comment. So this image follows what is available from the OpenJDK project's maintainers.
What this means is that Alpine based images are only released for early access release versions of OpenJDK. Once a particular release becomes a "General-Availability" release, the Alpine version is dropped from the "Supported Tags"; they are still available to pull, but will no longer be updated.
This image is based on Windows Server Core (microsoft/windowsservercore
). As such, it only works in places which that image does, such as Windows 10 Professional/Enterprise (Anniversary Edition) or Windows Server 2016.
For information about how to get Docker running on Windows, please see the relevant "Quick Start" guide provided by Microsoft:
View license information for the software contained in this image.
As with all Docker images, these likely also contain other software which may 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).
Some additional license information which was able to be auto-detected might be found in the repo-info
repository's openjdk/
directory.
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.