-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added JDK 22 to OracleJava, replaced JDK 21 with JDK 22 in OracleOpen…
…JDK (#2774) Signed-off-by: Aurelio Garcia-Ribeyro <[email protected]>
- Loading branch information
1 parent
caea5ad
commit ff78d02
Showing
6 changed files
with
118 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright (c) 2022, 2024 Oracle and/or its affiliates. | ||
# | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | ||
# | ||
# ORACLE DOCKERFILES PROJECT | ||
# -------------------------- | ||
# This is the Dockerfile for Oracle JDK 22 on Oracle Linux 8 | ||
# | ||
# REQUIRED FILES TO BUILD THIS IMAGE | ||
# ---------------------------------- | ||
# This dockerfile will download a copy of JDK 22 from | ||
# https://download.oracle.com/java/22/latest/jdk-22_linux-<ARCH>_bin.tar.gz | ||
# | ||
# It will use either x64 or aarch64 depending on the target platform | ||
# | ||
# HOW TO BUILD THIS IMAGE | ||
# ----------------------- | ||
# Run: | ||
# $ docker build -t oracle/jdk:22 . | ||
# | ||
# This command is already scripted in build.sh so you can alternatively run | ||
# $ bash build.sh | ||
# | ||
# The builder image will be used to uncompress the tar.gz file with the Java Runtime. | ||
|
||
FROM oraclelinux:8 as builder | ||
|
||
LABEL maintainer="Aurelio Garcia-Ribeyro <[email protected]>" | ||
|
||
# Since the files are compressed as tar.gz first dnf install tar. gzip is already in oraclelinux:8 | ||
RUN set -eux; \ | ||
dnf install -y tar; | ||
|
||
# Default to UTF-8 file.encoding | ||
ENV LANG en_US.UTF-8 | ||
|
||
# Environment variables for the builder image. | ||
# Required to validate that you are using the correct file | ||
|
||
ENV JAVA_URL=https://download.oracle.com/java/22/latest \ | ||
JAVA_HOME=/usr/java/jdk-22 | ||
|
||
## | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN set -eux; \ | ||
ARCH="$(uname -m)" && \ | ||
# Java uses just x64 in the name of the tarball | ||
if [ "$ARCH" = "x86_64" ]; \ | ||
then ARCH="x64"; \ | ||
fi && \ | ||
JAVA_PKG="$JAVA_URL"/jdk-22_linux-"${ARCH}"_bin.tar.gz ; \ | ||
JAVA_SHA256=$(curl "$JAVA_PKG".sha256) ; \ | ||
curl --output /tmp/jdk.tgz "$JAVA_PKG" && \ | ||
echo "$JAVA_SHA256" */tmp/jdk.tgz | sha256sum -c; \ | ||
mkdir -p "$JAVA_HOME"; \ | ||
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1 | ||
|
||
## Get a fresh version of OL8 for the final image | ||
FROM oraclelinux:8 | ||
|
||
# Default to UTF-8 file.encoding | ||
ENV LANG en_US.UTF-8 | ||
ENV JAVA_HOME=/usr/java/jdk-22 | ||
ENV PATH $JAVA_HOME/bin:$PATH | ||
|
||
# If you need the Java Version you can read it from the release file with | ||
# JAVA_VERSION=$(sed -n '/^JAVA_VERSION="/{s///;s/"//;p;}' "$JAVA_HOME"/release); | ||
|
||
# Copy the uncompressed Java Runtime from the builder image | ||
COPY --from=builder $JAVA_HOME $JAVA_HOME | ||
|
||
RUN set -eux; \ | ||
# Ensure we get the latest OL 8 updates available at build time | ||
dnf -y update; \ | ||
# JDK assumes freetype is available | ||
dnf install -y \ | ||
freetype fontconfig \ | ||
; \ | ||
rm -rf /var/cache/dnf; \ | ||
ln -sfT "$JAVA_HOME" /usr/java/default; \ | ||
ln -sfT "$JAVA_HOME" /usr/java/latest; \ | ||
for bin in "$JAVA_HOME/bin/"*; do \ | ||
base="$(basename "$bin")"; \ | ||
[ ! -e "/usr/bin/$base" ]; \ | ||
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \ | ||
done; | ||
|
||
CMD ["jshell"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (c) 2024 Oracle and/or its affiliates. | ||
# | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | ||
|
||
echo "Building Oracle JDK 22 on Oracle Linux 8" | ||
docker build --file Dockerfile --tag oracle/jdk:22-ol8 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# Copyright (c) 2022, 2023 Oracle and/or its affiliates. | ||
# Copyright (c) 2022, 2024 Oracle and/or its affiliates. | ||
# | ||
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | ||
# | ||
# ORACLE DOCKERFILES PROJECT | ||
# -------------------------- | ||
# This is the Dockerfile for Oracle OpenJDK 21 on Oracle Linux 8 | ||
# This is the Dockerfile for Oracle OpenJDK 22 on Oracle Linux 8 | ||
# | ||
# REQUIRED FILES TO BUILD THIS IMAGE | ||
# ---------------------------------- | ||
# | ||
# (1) openjdk-21.xx_linux-x64_bin.tar.gz | ||
# Downloaded from https://jdk.java.net/21/ | ||
# (1) openjdk-22.xx_linux-x64_bin.tar.gz | ||
# Downloaded from https://jdk.java.net/22/ | ||
# | ||
# HOW TO BUILD THIS IMAGE | ||
# ----------------------- | ||
# Run: | ||
# $ docker build -t oracle/openjdk:21 . | ||
# $ docker build -t oracle/openjdk:22 . | ||
# | ||
# This command is already scripted in build.sh so you can alternatively run | ||
# $ bash build.sh | ||
|
@@ -25,8 +25,8 @@ FROM oraclelinux:8 | |
|
||
LABEL maintainer="Aurelio Garcia-Ribeyro <[email protected]>" | ||
|
||
ENV JAVA_URL=https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL \ | ||
JAVA_HOME=/usr/java/jdk-21 \ | ||
ENV JAVA_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL \ | ||
JAVA_HOME=/usr/java/jdk-22 \ | ||
LANG=en_US.UTF-8 | ||
|
||
|
||
|
@@ -50,7 +50,7 @@ RUN set -eux; \ | |
if [ "$ARCH" = "x86_64" ]; \ | ||
then ARCH="x64"; \ | ||
fi && \ | ||
JAVA_PKG="$JAVA_URL"/openjdk-21.0.2_linux-"${ARCH}"_bin.tar.gz ; \ | ||
JAVA_PKG="$JAVA_URL"/openjdk-22_linux-"${ARCH}"_bin.tar.gz ; \ | ||
JAVA_SHA256="$(curl "$JAVA_PKG".sha256)" ; \ | ||
curl --output /tmp/jdk.tgz "$JAVA_PKG" && \ | ||
echo "$JAVA_SHA256" */tmp/jdk.tgz | sha256sum -c -; \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters