blob: f163d4e0d9de327b6e0dff0103a086c2693ca701 [file] [log] [blame]
// SPDX-FileCopyrightText: © 2022 Matthias Andreas Benkard <code@mail.matthias.benkard.de>
//
// SPDX-License-Identifier: GFDL-1.3-or-later
= openjdk-runtime
Matthias Andreas Benkard
// Meta
:experimental:
:data-uri:
:sectnums:
:toc:
:stem:
:keywords: mulk
// Settings
:icons: font
:source-highlighter: rouge
A container image that contains an OpenJDK runtime suitable for running
modern web services.
== Summary
This container image ships the latest OpenJDK feature release from
https://jdk.java.net[jdk.java.net] on top of a
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/building_running_and_managing_containers/assembly_types-of-container-images_building-running-and-managing-containers#con_understanding-the-ubi-micro-images_assembly_types-of-container-images[Red
Hat UBI Micro] base.
By default the image contains all modules shipped with OpenJDK.
== Building
[source,shell]
----
./prepare
docker build -t $IMAGE_NAME .
----
== Customization
You may want to customize the module set included in the JDK.
For example, say all you need are `java.base` and `java.naming`, then
the following excludes everything else contained in the OpenJDK
distribution:
[source,dockerfile]
----
RUN /jdk/*/bin/jlink \
-J-XX:MaxRAMPercentage=75 \
--add-modules java.base,java.naming \ #<1>
--compress=1 \
--no-man-pages \
--strip-debug \
--output /java
----
<1> Include the JDK modules that you need.
== Usage
[source,shell]
----
docker run $IMAGE_NAME java -version
----
== License
This recipe is freely redistributable under the GNU General Public
License, version 3, or, at your option, any later version.
Redistribution of the resulting container image is subject to the
https://www.redhat.com/en/about/agreements#UBI[Red Hat Universal Base
Image EULA] in addition to the license terms applicable to the
individual software components it consists of.