Java J9 in Containers
IBM and Semeru Java in Containers
Recipe
- In general, tune
-XX:MaxRAMPercentage
and-XX:InitialRAMPercentage
instead of-Xmx
and-Xms
, respectively, to allow for more flexibility with sizing of containers at the host level. Default values depend on any container memory limit. - Consider using
-XX:+ClassRelationshipVerifier
to improve start-up time. - If using Semeru Java >= 11 and memory in the pod is limited, consider using the remote JITServer on available platforms to avoid potential throughput issues.
Container Images
- IBM Semeru Runtimes common images:
- IBM Semeru Runtimes Java Certified Edition most recent LTS release
on UBI:
FROM icr.io/appcafe/ibm-semeru-runtimes
- IBM Semeru Runtimes Java 21 Certified Edition on UBI:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-21-jdk-ubi
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-21-jre-ubi
- IBM Semeru Runtimes Java 21 Certified Edition on Ubuntu:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-21-jdk-jammy
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-21-jre-jammy
- IBM Semeru Runtimes Java 17 Certified Edition on UBI:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-17-jdk-ubi
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-17-jre-ubi
- IBM Semeru Runtimes Java 17 Certified Edition on Ubuntu:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-17-jdk-jammy
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-17-jre-jammy
- IBM Semeru Runtimes Java 11 Certified Edition on UBI:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-11-jdk-ubi
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-11-jre-ubi
- IBM Semeru Runtimes Java 11 Certified Edition on Ubuntu:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-11-jdk-jammy
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-11-jre-jammy
- IBM Semeru Runtimes Java 8 Certified Edition on UBI:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-8-jdk-ubi
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-8-jre-ubi
- IBM Semeru Runtimes Java 8 Certified Edition on Ubuntu:
FROM icr.io/appcafe/ibm-semeru-runtimes:certified-8-jdk-jammy
orFROM icr.io/appcafe/ibm-semeru-runtimes:certified-8-jre-jammy
- See all tags:
curl -s https://icr.io/v2/appcafe/ibm-semeru-runtimes/tags/list | jq .tags
- IBM Semeru Runtimes Java Certified Edition most recent LTS release
on UBI:
- IBM Java 8 common images:
- IBM Java 8 on UBI:
FROM icr.io/appcafe/ibmjava
- IBM Java 8 on UBI:
FROM icr.io/appcafe/ibmjava:8-sdk-ubi8
orFROM icr.io/appcafe/ibmjava:8-jre-ubi8
- IBM Java 8 on Ubuntu:
FROM icr.io/appcafe/ibmjava:8-sdk-ubuntu
orFROM icr.io/appcafe/ibmjava:8-jre-ubuntu
- IBM
Java 8 for z/OS:
FROM icr.io/zoscp/ibmjava:8
- See all tags:
curl -s https://icr.io/v2/appcafe/ibmjava/tags/list | jq .tags
- IBM Java 8 on UBI:
Run Examples
Compile and run a simple Java program:
podman run --rm icr.io/appcafe/ibm-semeru-runtimes:certified-21-jdk-ubi sh -c "cd /tmp; printf 'public class main { public static void main(String... args) throws Throwable { System.out.println(\"Hello World\"); } }' > main.java && javac main.java && java -showversion main"
Run a program in the background and do something on it:
podman run --rm icr.io/appcafe/ibm-semeru-runtimes:certified-21-jdk-ubi sh -c "cd /tmp; printf 'public class main { public static void main(String... args) throws Throwable { System.out.println(\"Hello World\"); Object o = new Object(); synchronized (o) { o.wait(); } } }' > main.java && javac main.java && (java main &); sleep 1; jcmd \$(jps | grep -v Jps | sed 's/ main//g') Dump.java; sleep 1; head javacore*txt"
To start an interactive session, add -it
after
--rm
. For example:
podman run --rm -it icr.io/appcafe/ibm-semeru-runtimes:certified-17-jdk-ubi bash