summaryrefslogtreecommitdiff
path: root/openjdk-runtime/README.adoc
blob: 9cd942d2fd285cb39323de10f9f5bc3a1f25cef0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// 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
----