Skip to content
Josh Graham edited this page Jun 7, 2017 · 8 revisions

World's smallest JVM containers™

Introduction

We use an Alpine Linux with glibc base Docker image to build a minimal container for Java tasks and applications, running the best OpenJDK: Azul's Zulu.

Image Size

  • Docker image for JDK is ~58 MB compressed
  • Docker image for JRE CP3 is ~26 MB compressed

Note: These change depending on the Alpine distribution, glibc, and the OpenJDK.

JDK and JRE

Two variants are supplied. One is the full Zulu OpenJDK and the other is Zulu JRE compact3 profile.

The compact3 profile is the heaviest of the three profiles for subsetted JRE and provides everything that most JVM components need. In future, the smaller profiles may also be provided, but the intention is to use Jigsaw from Java 9 to elimate anything that isn't required by each specific component.

If you have a reasonable JVM component that only needs the Java runtime provided by compact3, use the "jre" Dockerfile. If you need more than that, use the "jdk" Dockerfile which comes with everything. You can use jdeps to determine if you only need more than the compact3 profile, or add the -profile compact3 option to your javac command.

A huge thanks to the Zulu team at Azul Systems who have supplied the Zulu Embedded JRE compact3 profile build for Alpine Linux so everyone can benefit. If you use these images for production, I strongly encourage you to get a world-class support subscription.

NB: Even with a support subscription, Azul Systems does not support this Docker image, just the JVM within it running on Alpine Linux.

Who

Project owner: Josh Graham (@delitescere)

Acknowledgements

Azul Systems, Inc for Zulu, their OpenJDK implementation and the gratis extra effort providing an embedded CP3 JRE.

Vlad Frolov (@frol) for the Alpine image with glibc.

The team at Gliderlabs (@gliderlabs) for the initial inspiration, tireless efforts in the Docker ecosystem, and their Alpine Docker image.

Clone this wiki locally