Public repository for ragedunicorn docker java images
1.4K

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 (see the Tags tab for the available versions)
docker pull ragedunicorn/java:<java-version>-jdk-alpine<alpine-version>-<build>
# 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
On Windows, use the PowerShell form - ${PWD} with braces and the colon
inside the quotes (without braces PowerShell parses $PWD: as a
scope-qualified variable, as in $env:PATH, and rejects the argument):
# 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
PowerShell:
docker run -v "${PWD}:/app" ragedunicorn/java:latest Hello.java
docker run -v $(pwd):/app ragedunicorn/java:latest-jre -jar app.jar
PowerShell:
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
PowerShell:
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
PowerShell:
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}
X.Y.Z is the Temurin version, A.B.C the Alpine version:
X.Y.Z-jdk-alpineA.B.C-1 - Temurin X.Y.Z JDK on Alpine A.B.C, build 1X.Y.Z-jre-alpineA.B.C-1 - Temurin X.Y.Z JRE on Alpine A.B.C, build 1latest - Most recent stable JDK releaselatest-jre - Most recent stable JRE releaseThe available versions are listed in the Tags tab.
Both 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
PowerShell:
docker run -v "${PWD}:/app" ragedunicorn/java:latest YourProgram.java
MIT License - See GitHub repository for details.
Content type
Image
Digest
sha256:ce5fb6c76…
Size
164.4 MB
Last updated
18 days ago
docker pull ragedunicorn/java