Public repository for ragedunicorn docker java images
98

A minimal Java image on Alpine Linux, shipping Eclipse Temurin 21 (LTS) from the Adoptium apk repository in two variants: a full JDK with Apache Maven and a runtime-only JRE.
# Pull the JDK (latest)
docker pull ragedunicorn/java:latest
# Pull the JRE
docker pull ragedunicorn/java:latest-jre
# Or pull a specific version
docker pull ragedunicorn/java:21.0.11-jdk-alpine3.24.1-1
# Print the Java version (default command)
docker run --rm ragedunicorn/java:latest
# Run a Java source file (JDK only)
docker run -v $(pwd):/app ragedunicorn/java:latest Hello.java
latest) and runtime-only JRE (latest-jre)docker run -v $(pwd):/app ragedunicorn/java:latest Hello.java
docker run -v $(pwd):/app ragedunicorn/java:latest-jre -jar app.jar
docker run -it --rm --entrypoint jshell ragedunicorn/java:latest
docker run -v $(pwd):/app --entrypoint javac ragedunicorn/java:latest Hello.java
# The named volume keeps the local repository (~/.m2) between runs; a fresh
# volume is initialized owned by the java user (the image pre-creates ~/.m2)
docker run -v $(pwd):/app -v m2cache:/home/java/.m2 --entrypoint mvn ragedunicorn/java:latest package
On Docker Desktop for Windows, overwriting existing files on a bind mount can fail with Operation not permitted for the non-root java user — if your build writes into the mounted workspace, run with -u root and use -v m2cache-root:/root/.m2 for the cache instead.
FROM ragedunicorn/java:latest-jre
COPY app.jar /app/app.jar
CMD ["-jar", "/app/app.jar"]
This image uses semantic versioning that includes all component versions:
Format: {java_version}-{jdk|jre}-alpine{alpine_version}-{build_number}
21.0.11-jdk-alpine3.24.1-1 - Temurin 21.0.11 JDK on Alpine 3.24.1, build 121.0.11-jre-alpine3.24.1-1 - Temurin 21.0.11 JRE on Alpine 3.24.1, build 1latest - Most recent stable JDK releaselatest-jre - Most recent stable JRE releaseBoth variants are published together from a single release. When updates are available through automated dependency management, new releases are created with appropriate version tags.
JAVA_HOME - Points at the Temurin installation (/usr/lib/jvm/java-21-temurin in the JDK, /usr/lib/jvm/java-21-temurin-jre in the JRE)MAVEN_HOME - Points at the Maven installation (/opt/maven, JDK only)LANG=C.UTF-8 - UTF-8 default encodingThe default working directory is /app. Mount your code here:
docker run -v $(pwd):/app ragedunicorn/java:latest YourProgram.java
MIT License - See GitHub repository for details.
Content type
Image
Digest
sha256:fae35aa0c…
Size
163.5 MB
Last updated
1 day ago
docker pull ragedunicorn/java