bellsoft/liberica-openjre-alpine
Liberica is a 100% open-source Java implementation by BellSoft
1M+
Liberica JDK is free and 100% open-source Progressive Java Runtime for modern Java deployments. It is developed and supported by BellSoft, a major OpenJDK contributor. Application development with Liberica JDK is
Liberica JDK is recommended and used by Spring as the end-to-end solution for Spring Native applications. BellSoft serves millions of developers and companies from various industries across the globe. For more information, visit www.bell-sw.com.
We compiled an interactive scheme that will help you decide which BellSoft’s image is perfect for your project.
This repository contains Alpine glibc Docker images of Liberica JRE. Alpine Linux is a lightweight Linux distribution with the base image of ~5MB, which allows minimizing the size of a container. The original Alpine is based on musl, but if you are using a glibc-based distribution and unwilling to migrate to another libc, we added Liberica JRE images for Alpine glibc. We have been shipping images of Liberica JDK with Alpine musl since JDK 11. BellSoft’s engineers have upstreamed the support of this OS into JDK 16 and beyond as part of the Portola Project, and now we produce the smallest containers on the market that are only 42.72 MB, which are compatible with all Java applications. Microcontainers with Alpine Linux and Liberica JDK are perfect for building Java microservices:
Liberica JDK images for Alpine are available for following architectures:
The tags point at the Java version (right after the OS name) and supported architecture. Image name structure: X-Y, where X is the Java version and Y is the architecture type. If the architecture type is not included into the name, then the build supports AMD64 and ARM64 by default. The ‘latest’ tag points to the latest version of an image. Images with '-cds' in tag contain CDS (Class Data Sharing) archive. For instance, bellsoft/liberica-openjre-alpine:8u352-8-x86_64 is an image with Liberica JDK version 8u352 for Alpine glibc running on x86_64.
Alpaquita is a lightweight Linux distribution that integrates all the main features of Alpine plus multiple enhancements and enterprise support.
Like Alpine, Alpaquita is a small and performant Linux distribution, but in addition to that, it
The most important Alpaquita’s feature for the enterprise development is the support from the BellSoft team. Containers with Alpaquita and Liberica JDK are a unified solution with tested and perfectly compatible components that receive support and regular updates from a single vendor. Our clients obtain fixes on demand, which are implemented in the next release and become available for everyone. We provide Long-Term Support and a software bill of materials both for Liberica JDK and Alpaquita Linux.
As such, containers with Alpaquita are a free and better alternative to Alpine-based solutions.
You can find them at https://hub.docker.com/r/bellsoft/liberica-runtime-container
latest
,
latest-cds
,
23.0.1-13
,
23.0.1-13-cds
,
23.0.1
,
23.0.1-cds
,
23-38
,
23-38-cds
,
23
,
23-cds
,22
,
22-cds
21.0.5-11
,
21.0.5-11-cds
,
21.0.5
,
21.0.5-cds
,
21.0.4-9
,
21.0.4-9-cds
,
21.0.4
,
21.0.4-cds
,
21.0.3-10
,
21.0.3-10-cds
,
21.0.3
,
21.0.3-cds
,
21.0.1-12
,
21.0.1-12-cds
,
21.0.1
,
21.0.1-cds
,
21-37
,
21
,
21-cds
20
19
18
17.0.13-12
,
17.0.13-12-cds
,
17.0.13
,
17.0.13-cds
,
17.0.12-10
,
17.0.12-10-cds
,
17.0.12
,
17.0.12-cds
,
17.0.11-10
,
17.0.11-10-cds
,
17.0.11
,
17.0.11-cds
,
17.0.9-11
,
17.0.9-11-cds
,
17.0.9
,
17.0.9-cds
,
17.0.8-7
,
17.0.8
,
17
,
17-cds
16
15
11.0.25-11
,
11.0.25-11-cds
,
11.0.25
,
11.0.25-cds
,
11.0.24-9
,
11.0.24-9-cds
,
11.0.24
,
11.0.24-cds
,
11.0.23-10
,
11.0.23-10-cds
,
11.0.23
,
11.0.23-cds
,
11.0.21-10
,
11.0.21-10-cds
,
11.0.21
,
11.0.21-cds
,
11
,
11-cds
10
9
- armhf only (Raspberry Pi 2/3)8u432-7
,
8u432-7-cds
,
8u432
,
8u432-cds
,
8u422-6
,
8u422-6-cds
,
8u422
,
8u422-cds
,
8u412-9
,
8u412-9-cds
,
8u412
,
8u412-cds
,
8u392-9
,
8u392-9-cds
,
8u392
,
8u392-cds
,
8u
,
8u-cds
,
8
,
8-cds
- amd64 and aarch64 onlyFor example, you can run a Liberica OpenJRE 8u272 container with the following command:
docker run -it --rm bellsoft/liberica-openjre-alpine:8u272 java -version
To run some application you can create Dockerfile, based on bellsoft/liberica-openjre-alpine image or mount volume with your code/applicaiton, for example:
docker run -it --rm -v /home/user/project/:/data bellsoft/liberica-openjre-alpine:8u272 java -jar /data/MyApp.jar
Containerized deployments sometimes do some off-screen rendering, such as when preparing documents, forms, and images. When performing off-screen rendering, the JDK requires OS fonts and fontconfig
libraries to be present.
In case when you don't have these libraries or fonts you will encounter the exception, similar to one below:
Exception in thread "main" java.lang.InternalError: java.lang.reflect.InvocationTargetException
at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
at java.desktop/sun.font.SunFontManager.getInstance(SunFontManager.java:247)
at java.desktop/sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:261)
at java.desktop/sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1243)
...
at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:192)
at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:132)
Caused by: java.lang.NullPointerException
at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:362)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:312)
at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:307)
at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
... 28 more
On Alpine Linux, these libraries are provided by fontconfig
and ttf-dejavu
packages, and can be installed by running the following command:
apk add fontconfig ttf-dejavu
The Liberica JDK Dockerfile can be built with these libraries by specifying OPT_PKGS
build argument:
docker build -t bellsoft/liberica-openjre-alpine:8u242 \
--build-arg LIBERICA_RELEASE_TAG=8u272+10 \
--build-arg LIBERICA_VERSION=8u272 \
--build-arg LIBERICA_BUILD=7 \
--build-arg LIBERICA_VARIANT=jre \
--build-arg LIBERICA_ROOT=/usr/lib/jvm/jre-8u272-bellsoft-x86_64 \
--build-arg OPT_PKGS="fontconfig ttf-dejavu"
docker pull bellsoft/liberica-openjre-alpine