The official Docker image for Gradle. Maintained by the Gradle team as an Official Image. Thanks to @keeganwitt for his years of stewardship.
Gradle is a fast, dependable, and adaptable open-source build automation tool with an elegant and extensible declarative build language.
- JDK 8 →
jdk8,jdk8-jammy,jdk8-corretto,jdk8-ubi9 - JDK 11 →
jdk11,jdk11-noble,jdk11-jammy,jdk11-alpine,jdk11-corretto,jdk11-ubi9 - JDK 17 →
jdk17,jdk17-resolute,jdk17-noble,jdk17-jammy,jdk17-alpine,jdk17-corretto,jdk17-ubi10,jdk17-ubi9,jdk17-resolute-graal,jdk17-noble-graal - JDK 21 →
jdk21,jdk21-resolute,jdk21-noble,jdk21-jammy,jdk21-alpine,jdk21-corretto,jdk21-ubi10,jdk21-ubi9,jdk21-graal - JDK 25 (LTS) →
jdk25,jdk25-resolute,jdk25-noble,jdk25-alpine,jdk25-corretto,jdk25-ubi10,jdk25-graal,graal - JDK 27 →
jdk27,jdk27-resolute,latest,jdk27-alpine,alpine,jdk27-corretto,corretto,jdk27-ubi10,ubi
See all tags on Docker Hub.
The -graal variants use BellSoft Liberica Native Image Kit (NIK), an open-source distribution of OpenJDK and GraalVM with the native-image compiler included. The existing image tags and /opt/java/graalvm installation paths are retained for compatibility. These images use the standard Linux bundle for AMD64 and ARM64.
Liberica NIK provides maintained Java 17 and 21 distributions, replacing the discontinued upstream GraalVM Community Edition binaries for those Java versions. NIK's OpenJDK and GraalVM components use GPLv2 with the Classpath Exception, together with applicable component licenses; see the NIK license.
The jdk-lts-and-current-graal combo image is retired. Use the Java-specific -graal images instead; the current Native Image distribution uses Java 25 for both LTS and current.
Combo images are images where two different JDK versions are made available to Gradle: the latest LTS JDK and the latest (LTS or non-LTS) JDK. Gradle runs on the LTS JDK, while toolchains can target the latest JDK.
- Combo Images →
jdk-lts-and-current,jdk-lts-and-current-alpine,jdk-lts-and-current-corretto
To achieve this, the following appears in the /home/gradle/.gradle/gradle.properties file of the image:
org.gradle.java.installations.auto-detect=false
org.gradle.java.installations.auto-download=false
org.gradle.java.installations.fromEnv=JAVA_LTS_HOME,JAVA_CURRENT_HOMEAvailable environment variables:
JAVA_LTS_HOME→ path to the latest LTS JDKJAVA_CURRENT_HOME→ path to the latest current JDK
These may point to the same path if the latest JDK is an LTS release.
docker run --rm -u gradle \
-v "$PWD":/home/gradle/project \
-w /home/gradle/project \
gradle:latest gradle <task>Replace <task> with your desired Gradle task, e.g., build.
To persist the Gradle User Home (including Gradle caches) between runs:
docker volume create --name gradle-cache
docker run --rm -u gradle \
-v gradle-cache:/home/gradle/.gradle \
-v "$PWD":/home/gradle/project \
-w /home/gradle/project gradle:latest gradle buildNote that sharing between concurrently running containers doesn't work currently (see #851).
Currently, it is not possible to override the volume declaration of the parent.
If you are using this image as a base image and want the Gradle cache to be written into the next layer, you will need to use a new user (or use the --gradle-user-home/-g argument) so that a new cache is created that isn't mounted to a volume.
© Gradle Inc. 2025