Skip to content

Commit fdb5157

Browse files
committed
Introduce OpenJDK 17 build image (preview)
Initial image descriptor for an OpenJDK 17 image. Note the OSBS configuration is a little unusual, this is due to the image being prepared and tested early. Signed-off-by: Jonathan Dowland <[email protected]>
1 parent 5e0e434 commit fdb5157

File tree

5 files changed

+156
-0
lines changed

5 files changed

+156
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#!/bin/sh
3+
# ==============================================================================
4+
# JDK specific customizations
5+
#
6+
# ==============================================================================
7+
8+
function jvm_specific_diagnostics() {
9+
echo "-Xlog:gc::utctime -XX:NativeMemoryTracking=summary"
10+
}

modules/jdk/17/configure.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
# Configure module
3+
set -e
4+
5+
SCRIPT_DIR=$(dirname $0)
6+
ARTIFACTS_DIR=${SCRIPT_DIR}/artifacts
7+
8+
chown -R jboss:root $SCRIPT_DIR
9+
chmod -R ug+rwX $SCRIPT_DIR
10+
chmod ug+x ${ARTIFACTS_DIR}/opt/jboss/container/openjdk/jdk/*
11+
12+
pushd ${ARTIFACTS_DIR}
13+
cp -pr * /
14+
popd
15+
16+
# Set this JDK as the alternative in use
17+
_arch="$(uname -i)"
18+
alternatives --set java java-17-openjdk.${_arch}
19+
alternatives --set javac java-17-openjdk.${_arch}
20+
alternatives --set java_sdk_openjdk java-17-openjdk.${_arch}
21+
alternatives --set jre_openjdk java-17-openjdk.${_arch}
22+
23+
# Update securerandom.source for quicker starts (must be done after removing jdk 8, or it will hit the wrong files)
24+
JAVA_SECURITY_FILE=/usr/lib/jvm/java/conf/security/java.security
25+
SECURERANDOM=securerandom.source
26+
if grep -q "^$SECURERANDOM=.*" $JAVA_SECURITY_FILE; then
27+
sed -i "s|^$SECURERANDOM=.*|$SECURERANDOM=file:/dev/urandom|" $JAVA_SECURITY_FILE
28+
else
29+
echo $SECURERANDOM=file:/dev/urandom >> $JAVA_SECURITY_FILE
30+
fi

modules/jdk/17/module.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
schema_version: 1
2+
3+
name: "jboss.container.openjdk.jdk"
4+
description: "Installs the JDK for OpenJDK 17."
5+
version: "17"
6+
7+
labels:
8+
- name: "org.jboss.product"
9+
value: "openjdk"
10+
- name: "org.jboss.product.version"
11+
value: "17"
12+
- name: "org.jboss.product.openjdk.version"
13+
value: "17"
14+
15+
envs:
16+
- name: "JAVA_HOME"
17+
value: "/usr/lib/jvm/java-17"
18+
- name: "JAVA_VENDOR"
19+
value: "openjdk"
20+
- name: "JAVA_VERSION"
21+
value: "17"
22+
- name: JBOSS_CONTAINER_OPENJDK_JDK_MODULE
23+
value: /opt/jboss/container/openjdk/jdk
24+
25+
packages:
26+
install:
27+
- java-17-openjdk-devel
28+
29+
modules:
30+
install:
31+
- name: jboss.container.user
32+
33+
execute:
34+
- script: configure.sh

redhat/ubi8-openjdk-17.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
osbs:
2+
configuration:
3+
container:
4+
compose:
5+
pulp_repos: true
6+
packages: []
7+
signing_intent: unsigned
8+
repository:
9+
name: containers/openjdk
10+
branch: openjdk-17-ubi8
11+
koji_target: openjdk-17-ubi8-containers-candidate
12+
13+
packages:
14+
manager: microdnf
15+
content_sets:
16+
x86_64:
17+
- rhel-8-for-x86_64-baseos-rpms__8
18+
- rhel-8-for-x86_64-appstream-rpms__8
19+
ppc64le:
20+
- rhel-8-for-ppc64le-appstream-rpms__8
21+
- rhel-8-for-ppc64le-baseos-rpms__8
22+
aarch64:
23+
- rhel-8-for-aarch64-baseos-rpms__8
24+
- rhel-8-for-aarch64-appstream-rpms__8
25+
s390x:
26+
- rhel-8-for-s390x-baseos-rpms__8
27+
- rhel-8-for-s390x-appstream-rpms__8

ubi8-openjdk-17.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# This is an Image descriptor for Cekit
2+
3+
schema_version: 1
4+
5+
from: "ubi8-minimal:8.5"
6+
name: &name "ubi8/openjdk-17"
7+
version: &version "1.10"
8+
description: "Source To Image (S2I) image for Red Hat OpenShift providing OpenJDK 17"
9+
10+
labels:
11+
- name: "io.k8s.description"
12+
value: "Platform for building and running plain Java applications (fat-jar and flat classpath)"
13+
- name: "io.k8s.display-name"
14+
value: "Java Applications"
15+
- name: "io.openshift.tags"
16+
value: "builder,java"
17+
- name: "maintainer"
18+
value: "Red Hat OpenJDK <[email protected]>"
19+
- name: "com.redhat.component"
20+
value: "openjdk-17-ubi8-container"
21+
- name: "usage"
22+
value: "https://access.redhat.com/documentation/en-us/red_hat_jboss_middleware_for_openshift/3/html/red_hat_java_s2i_for_openshift/"
23+
- name: "com.redhat.license_terms"
24+
value: "https://www.redhat.com/en/about/red-hat-end-user-license-agreements#UBI"
25+
26+
envs:
27+
- name: PATH
28+
value: $PATH:"/usr/local/s2i"
29+
- name: "JBOSS_IMAGE_NAME"
30+
value: *name
31+
- name: "JBOSS_IMAGE_VERSION"
32+
value: *version
33+
34+
ports:
35+
- value: 8080
36+
- value: 8443
37+
38+
modules:
39+
repositories:
40+
- path: modules
41+
install:
42+
- name: jboss.container.util.pkg-update
43+
- name: jboss.container.openjdk.jdk
44+
version: "17"
45+
- name: jboss.container.prometheus
46+
- name: jboss.container.maven
47+
version: "8.2.3.6"
48+
- name: jboss.container.java.s2i.bash
49+
- name: jboss.container.java.singleton-jdk
50+
51+
help:
52+
add: true
53+
54+
packages:
55+
manager: microdnf

0 commit comments

Comments
 (0)