Huny's Dev Blog
huny.dev

Choosing Eclipse Temurin Docker Images: JDK vs JRE and ARM64 Support

Choose a Temurin JDK or JRE, separate build and runtime stages, and check ARM64 support and image digests.

Hun Jang
Hun Jang Nov 22, 2026

When packaging a Java application in Docker, eclipse-temurin is an official image containing OpenJDK builds. A JDK is needed to build the application, while a JRE image can be an option for running an already-built JAR. Choose the base OS and CPU architecture as well as the Java version, and understand what can change behind a tag.

AI-generated conceptual illustration of containers with development tools and a compact runtime.

This guide is based on the Adoptium container guide and Docker Official Image description, checked on November 22, 2026. The Docker commands and Dockerfile are documentation-based examples; no container build or execution was verified during this run.

How do Temurin and OpenJDK relate?

OpenJDK is an open-source implementation project for the Java platform. Eclipse Temurin is an OpenJDK binary built and distributed by Adoptium. The eclipse-temurin Docker Official Image contains those binaries. The same Java version does not imply that different distributions and base operating systems have identical packages, update schedules, or support policies. Adoptium container guide

Tags generally follow eclipse-temurin:<Java version>-<jdk or jre>-<OS variant>. For example, 21-jdk includes Java 21 development tools, while 21-jre provides a runtime. Available tags and platforms vary by combination, so check the Docker Hub tags.

Choice
Suitable stage
Check
JDK
Compilation, tests, and development tools such as jlink
Does the final image need a compiler?
JRE
Running an already-built application
Are the diagnostic tools and native dependencies sufficient?
Alpine variant
Environments where it has been tested
It uses musl; check JNI and native-library compatibility
Default Ubuntu base
General starting point
Watch base OS changes and security updates

Adoptium recommends the default Ubuntu-based image for most users. Do not assume Alpine is always smaller or safer: check the size of the actual tag and your application's compatibility. Adoptium guide

Separate the build and runtime stages

The following illustrative example is for a Spring Boot project using the Gradle Wrapper and the bootJar task. First configure the project to produce an executable JAR named build/libs/app.jar. Change the COPY path if the output has a different name.

The first stage builds with the JDK; the second copies only the JAR. Separately check that the project's Gradle version supports Java 21 and whether private repository credentials or native libraries are needed. Add a .dockerignore to keep secrets and unnecessary files out of the build context. Docker multi-stage builds

A JRE image may lack development tools such as javac. A JDK may still be needed if operations depend on JDK diagnostics or the application compiles code at runtime. Docker Hub also describes building a custom runtime with jlink; missing modules can cause runtime failures, so test the actual features and diagnostic paths. Official image guide

Check ARM64 support and image changes

If an image built on an ARM laptop must also run on an x86 server, do not decide from the tag name alone. The following example inspects the platforms in the registry's image index. It requires Docker Buildx and registry access.

Check the output for linux/amd64 and linux/arm64. Even when the base image supports both, that does not prove that the application's JNI libraries and build artifacts do. Test startup and key functionality on each deployment platform. Docker multi-platform documentation

A tag such as 21-jre can point to a different image after a security update or base-image change. For reproducibility, pin the digest of the multi-platform index you verified, then regularly review updates and replace the digest. A forgotten pin will not automatically receive security fixes. Docker guidance on pinning images

Before deployment, check java -version in the final image, the target architecture, certificates, time zones, native dependencies, graceful shutdown, and the security update process. If adding a startup script raises signal-delivery concerns, see Fix Docker SIGTERM Delivery with an Exec-Form ENTRYPOINT and Shell execFix Docker SIGTERM Delivery with an Exec-Form ENTRYPOINT and Shell exec.

한국어 버전: Docker에서 Eclipse Temurin 선택하기: JDK·JRE와 ARM64 이미지 확인Docker에서 Eclipse Temurin 선택하기: JDK·JRE와 ARM64 이미지 확인

추천 글