blob: f163d4e0d9de327b6e0dff0103a086c2693ca701 [file] [log] [blame]
Matthias Andreas Benkarda9074952022-05-13 20:47:42 +02001// SPDX-FileCopyrightText: © 2022 Matthias Andreas Benkard <code@mail.matthias.benkard.de>
2//
3// SPDX-License-Identifier: GFDL-1.3-or-later
4
5= openjdk-runtime
6Matthias Andreas Benkard
7// Meta
8:experimental:
9:data-uri:
10:sectnums:
11:toc:
12:stem:
13:keywords: mulk
14// Settings
15:icons: font
16:source-highlighter: rouge
17
18A container image that contains an OpenJDK runtime suitable for running
19modern web services.
20
21
22== Summary
23
24This container image ships the latest OpenJDK feature release from
25https://jdk.java.net[jdk.java.net] on top of a
26https://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
27Hat UBI Micro] base.
28
Matthias Andreas Benkard776cee32022-05-13 22:27:08 +020029By default the image contains all modules shipped with OpenJDK.
Matthias Andreas Benkarda9074952022-05-13 20:47:42 +020030
31
32== Building
33
34[source,shell]
35----
36./prepare
37docker build -t $IMAGE_NAME .
38----
39
40
41== Customization
42
43You may want to customize the module set included in the JDK.
44
Matthias Andreas Benkard776cee32022-05-13 22:27:08 +020045For example, say all you need are `java.base` and `java.naming`, then
46the following excludes everything else contained in the OpenJDK
47distribution:
Matthias Andreas Benkarda9074952022-05-13 20:47:42 +020048
49[source,dockerfile]
50----
51RUN /jdk/*/bin/jlink \
52 -J-XX:MaxRAMPercentage=75 \
Matthias Andreas Benkard776cee32022-05-13 22:27:08 +020053 --add-modules java.base,java.naming \ #<1>
Matthias Andreas Benkarda9074952022-05-13 20:47:42 +020054 --compress=1 \
55 --no-man-pages \
56 --strip-debug \
57 --output /java
58----
Matthias Andreas Benkard776cee32022-05-13 22:27:08 +020059<1> Include the JDK modules that you need.
Matthias Andreas Benkarda9074952022-05-13 20:47:42 +020060
61
62== Usage
63
64[source,shell]
65----
66docker run $IMAGE_NAME java -version
67----
Matthias Andreas Benkard44a658a2022-05-19 06:46:52 +020068
69
70== License
71
72This recipe is freely redistributable under the GNU General Public
73License, version 3, or, at your option, any later version.
74
75Redistribution of the resulting container image is subject to the
76https://www.redhat.com/en/about/agreements#UBI[Red Hat Universal Base
77Image EULA] in addition to the license terms applicable to the
78individual software components it consists of.