Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions OracleJava/11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ RUN set -eux; \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-11*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=f50fdec8a48a9b360d30ecc29af36f63f04f0b70ec829d3bf821e4e361682791 ; \
JAVA_SHA256=d22d0fcca761861a1eb2f5f6eb116c933354e8b1f76b3cda189c722cc0177c98 ; \
else \
mv "$(ls /tmp/jdk-11*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=ff0c3387f47ed2eff9fdf936952573113824fc29de463bb13a3a804cc13d2ae8 ; \
JAVA_SHA256=3fc0d93f6363d32723c293ba5a9016e8ab27410351ed804020cfe71e87d3bc0a ; \
fi && \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
Expand Down
4 changes: 2 additions & 2 deletions OracleJava/11/Dockerfile.ol8
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ RUN set -eux; \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-11*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=f50fdec8a48a9b360d30ecc29af36f63f04f0b70ec829d3bf821e4e361682791 ; \
JAVA_SHA256=d22d0fcca761861a1eb2f5f6eb116c933354e8b1f76b3cda189c722cc0177c98 ; \
else \
mv "$(ls /tmp/jdk-11*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=ff0c3387f47ed2eff9fdf936952573113824fc29de463bb13a3a804cc13d2ae8 ; \
JAVA_SHA256=3fc0d93f6363d32723c293ba5a9016e8ab27410351ed804020cfe71e87d3bc0a ; \
fi && \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
Expand Down
28 changes: 14 additions & 14 deletions OracleJava/17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# This dockerfile will download a copy of JDK 17 from
# https://download.oracle.com/java/17/latest/jdk-17_linux-<ARCH>_bin.tar.gz
#
# It will use either x64 or aarch64 depending on the target platform
# (1) jdk-17.XX_linux-x64_bin.tar.gz or jdk-17.XX_linux-aarch64_bin.tar.gz
# Download from https://www.oracle.com/java/technologies/downloads
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
# $ docker build -t oracle/jdk:17 .
#
Expand All @@ -29,30 +28,31 @@ LABEL maintainer="Aurelio Garcia-Ribeyro <aurelio.garciaribeyro@oracle.com>"

# Since the files are compressed as tar.gz first dnf install tar. gzip is already in oraclelinux:8
RUN 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/17/latest \
JAVA_HOME=/usr/java/jdk-17
ENV JAVA_HOME=/usr/java/jdk-17

##
COPY *.tar.gz /tmp/
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"; \
then \
mv "$(ls /tmp/jdk-17*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=f7a6fdebeb11840e1f5314bc330feb75b67e52491cf39073dbf3e51e3889ff08 ; \
else \
mv "$(ls /tmp/jdk-17*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=277e0010e7b17583e63827f9537a153ea79cb4b6ca28d523cd8a82f14a24a769 ; \
fi && \
JAVA_PKG="$JAVA_URL"/jdk-17_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; \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1

## Get a fresh version of OL8 for the final image
FROM oraclelinux:8
Expand Down
4 changes: 2 additions & 2 deletions OracleJava/8/jdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ RUN set -eux; \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=92bfdee599c334f641de2d4ae08a4a082b966cb19b88d13d48b8486f80727b58 ; \
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d ; \
else \
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=2cec03d24cf622d3c97af5fb3e6d0465de8cf7ce599b586e254bedb5ba23a9ca ; \
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c ; \
fi && \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
Expand Down
4 changes: 2 additions & 2 deletions OracleJava/8/jdk/Dockerfile.ol8
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ RUN set -eux; \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=92bfdee599c334f641de2d4ae08a4a082b966cb19b88d13d48b8486f80727b58 ; \
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d ; \
else \
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=2cec03d24cf622d3c97af5fb3e6d0465de8cf7ce599b586e254bedb5ba23a9ca ; \
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c ; \
fi && \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
Expand Down
10 changes: 4 additions & 6 deletions OracleJava/8/serverjre/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@ ENV LANG en_US.UTF-8

# Environment variables for the builder image.
# Required to validate that you are using the correct file


ENV JAVA_HOME=/usr/java/jdk-8

COPY server-jre-8u*-linux-x64.tar.gz /tmp/jdk.tgz
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -eux; \
JAVA_SHA256=f6ad55ddd04f3a3a920312092e29be872b76104aded2cd5df51edb50c14136f2 ; \
JAVA_SHA256=7c9a3a87045c226647c09bc1eb1fc832f99a9105dbc924cfeab3bf16b3504d24 ; \
echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1;
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1;

## Get a fresh version of SLIM for the final image

Expand All @@ -54,7 +53,7 @@ FROM oraclelinux:7-slim
# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8

ENV JAVA_HOME=/usr/java/jdk-8
ENV JAVA_HOME=/usr/java/jdk-8

ENV PATH $JAVA_HOME/bin:$PATH

Expand All @@ -71,8 +70,7 @@ RUN yum -y update; \
[ ! -e "/usr/bin/$base" ]; \
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
done; \
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
# See https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.html
java -Xshare:dump;

2 changes: 1 addition & 1 deletion OracleJava/8/serverjre/Dockerfile.ol8
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ENV JAVA_HOME=/usr/java/jdk-8
COPY server-jre-8u*-linux-x64.tar.gz /tmp/jdk.tgz
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -eux; \
JAVA_SHA256=f6ad55ddd04f3a3a920312092e29be872b76104aded2cd5df51edb50c14136f2 ; \
JAVA_SHA256=7c9a3a87045c226647c09bc1eb1fc832f99a9105dbc924cfeab3bf16b3504d24 ; \
echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1;
Expand Down
10 changes: 5 additions & 5 deletions OracleJava/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Oracle Java Server JRE provides the features from Oracle Java JDK commonly requi

## Building the Oracle Java base image

For JDK 23, 21, and 17 the required JDK binaries will be downloaded from [Oracle](https://www.oracle.com/javadownload) as part of the build using curl.
For JDK 23 and 21 the required JDK binaries will be downloaded from [Oracle](https://www.oracle.com/javadownload) as part of the build using curl.

For JDK 11 and JDK 8 you must first download the linux x64 or linux aarch64 compressed archive (tar.gz), for Server JRE 8 you must download the linux x64 compressed archive, from [https://oracle.com/javadownload](https://www.oracle.com/javadownload) and place it in the same directory as the corresponding Dockerfile.
For JDK 17, JDK 11, and JDK 8 you must first download the linux x64 or linux aarch64 compressed archive (tar.gz), for Server JRE 8 you must download the linux x64 compressed archive, from [https://oracle.com/javadownload](https://www.oracle.com/javadownload) and place it in the same directory as the corresponding Dockerfile.

e.g. for JDK 11 download jdk-11[X]_linux-x64_bin.tar.gz into OracleJava/11, for Server JRE 8 download server-jre-8uXXX-linux-x64.tar.gz into OracleJava/8/serverjre
e.g. for JDK 17 download jdk-17[X]_linux-x64_bin.tar.gz into OracleJava/17, for Server JRE 8 download server-jre-8uXXX-linux-x64.tar.gz into OracleJava/8/serverjre

To build the container image run `docker build`. Tag it with the correct version number.

Expand Down Expand Up @@ -65,9 +65,9 @@ The script `build.sh` will tag the images it creates with the JDK version, and w

## Licenses

JDK 23, 21, and 17 are downloaded, as part of the build process, from the [Oracle Website](https://www.oracle.com/javadownload) under the [Oracle No-Fee Terms and Conditions (NFTC)](https://java.com/freeuselicense).
JDK 23 and 21 are downloaded, as part of the build process, from the [Oracle Website](https://www.oracle.com/javadownload) under the [Oracle No-Fee Terms and Conditions (NFTC)](https://java.com/freeuselicense).

For building JDK 11, JDK 8, and Server JRE 8 you must first download the corresponding Java Runtime from the [Oracle Website](https://www.oracle.com/javadownload) and accept the license indicated on that page.
For building JDK17, JDK 11, JDK 8, and Server JRE 8 you must first download the corresponding Java Runtime from the [Oracle Website](https://www.oracle.com/javadownload) and accept the license indicated on that page.

All scripts and files hosted in this project and GitHub [`docker/OracleJava`](./) repository, required to build the container images are, unless otherwise noted, released under the [UPL 1.0](https://oss.oracle.com/licenses/upl/) license.

Expand Down
5 changes: 2 additions & 3 deletions OracleOpenJDK/23/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ FROM oraclelinux:9

LABEL maintainer="Aurelio Garcia-Ribeyro <aurelio.garciaribeyro@oracle.com>"

ENV JAVA_URL=https://download.java.net/java/GA/jdk23/3c5b90190c68498b986a97f276efd28a/37/GPL \
ENV JAVA_URL=https://download.java.net/java/GA/jdk23.0.1/c28985cbf10d4e648e4004050f8781aa/11/GPL \
JAVA_HOME=/usr/java/jdk-23 \
LANG=en_US.UTF-8


# 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);
Expand All @@ -50,7 +49,7 @@ RUN set -eux; \
if [ "$ARCH" = "x86_64" ]; \
then ARCH="x64"; \
fi && \
JAVA_PKG="$JAVA_URL"/openjdk-23_linux-"${ARCH}"_bin.tar.gz ; \
JAVA_PKG="$JAVA_URL"/openjdk-23.0.1_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 -; \
Expand Down