These Dockerfiles along with their images are officially deprecated in favor of the eclipse-temurin
image, and will receive no further updates after 2021-08-25 (Aug 01, 2021). Please adjust your usage accordingly.
Dockerfiles and build scripts for generating Docker Images based on various AdoptOpenJDK binaries. We support both Hotspot and Eclipse OpenJ9 VMs.
armv7l
, aarch64
, ppc64le
, s390x
and x86_64
.ppc64le
, s390x
and x86_64
.Alpine | centos | clefos | debian | debianslim | leap | tumbleweed | ubi | ubi-minimal | ubuntu(*) |
---|---|---|---|---|---|---|---|---|---|
3.14 | 7 | 7 | buster | buster-slim | 15.3 | latest | 8.4 | 8.4 | 20.04 |
Note: Hotspot is not supported on Ubuntu 20.04 for s390x arch.
Starting from Java 16, hotspot builds are available natively built on musl libc instead of the regular glibc as part of the AdoptOpenJDK project. Currently these are available only for the x86_64 architecture. Accordingly we now have both regular and slim Docker Images for alpine musl based hotspot on x86_64.
AdoptOpenJDK Docker Images are available as both Official Images (Maintained by Docker) and Non-official Images (Maintained by AdoptOpenJDK). Please choose based on your requirements.
Here is a listing of the image sizes for the various build images and types for JDK Version 8
VMs | latest | slim | nightly | nightly-slim | alpine | alpine-slim | alpine-nightly | alpine-nightly-slim |
---|---|---|---|---|---|---|---|---|
OpenJ9 | 339MB | 251MB | 344MB | 250MB | 208MB | 120MB | 213MB | 118MB |
Hotspot | 324MB | 238MB | 324MB | 238MB | 193MB | 106MB | 193MB | 106MB |
Notes:
# Steps 1-2 needs to be run on all supported arches.
# i.e aarch64, ppc64le, s390x and x86_64.
# 1. Clone this github repo
$ git clone https://github.com/AdoptOpenJDK/openjdk-docker
# 2. Build images and tag them appropriately
$ cd openjdk-docker
$ ./build_all.sh
# Steps 3 needs to be run only on x86_64
# 3. build_all.sh should be run on all supported architectures to build and push images to the
# docker registry. The images should now be available on hub.docker.com but without multi-arch
# support. To add multi-arch support, we need to generate the right manifest lists and push them
# to hub.docker.com. The script generate_manifest_script.sh can be used to
# generate the right manifest commands. This needs to be run only on x86_64 after docker images
# for all architecures have been built and made available on hub.docker.com
$ ./update_manifest_all.sh
# We should now have the proper manifest lists pushed to hub.docker.com to support multi-arch pulls.
update_all.sh: Script to generate all Dockerfiles.
$ ./update_multiarch.sh $version
build_all.sh: Script to build all supported unofficial docker images on a particular architecture.
update_manifest_all.sh: Script that generates the multi-arch manifest for all unofficial docker images for supported/released architectures at any given time.
linter.sh: Linting dockerfiles (via hadolint).
To lint generated dockerfiles run
$ ./linter.sh
Run generate_latest_sums.sh to get the shasums for the latest binaries on adoptopenjdk.net
$ ./generate_latest_sums.sh $version
You should now have two files, hotspot_shasums_latest.sh
and openj9_shasums_latest.sh
. These will have the shasums for the latest version for each of the supported arches for hotspot and Eclipse OpenJ9 respectively.
slim-java.sh: Script that is used to generate the slim docker images. This script strips out various aspects of the JDK that are typically not needed in a server side containerized application. This includes debug info, symbols, classes related to audio, desktop etc
slim-java.ps1: Script that is used to generate slim docker images on Windows. This script provides the same function as the slim-java.sh script mentioned above.
dockerhub_doc_config_update.sh: Script that generates the tag documentation for each of the unofficial AdoptOpenJDK pages on hub.docker.com and the config file for raising a PR at the Official AdoptOpenJDK git repo.
The config dir consists of configuration files used by the scripts to determine the supported combinations of Version / OS / VM / Package / Build types and Architectures for both Official/Unofficial images as well as the corresponding tags.
Please note you'll need to upgrade bash shell on Mac OS X if you're to use our Docker images on there.
The Dockerfiles and associated scripts found in this project are licensed under the Apache License 2.0..