Skip to content

Commit

Permalink
changed copyright year, fixed indentation"
Browse files Browse the repository at this point in the history
Signed-off-by: Aurelio Garcia-Ribeyro <[email protected]>
  • Loading branch information
aureliogrb committed Oct 15, 2024
1 parent f5882fb commit a9eaef6
Show file tree
Hide file tree
Showing 14 changed files with 263 additions and 264 deletions.
56 changes: 28 additions & 28 deletions OracleJava/11/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# $ docker build -t oracle/jdk:11 .
#
# This command is already scripted in build.sh so you can alternatively run
# $ bash build.sh
# $ bash build.sh
#
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.

Expand All @@ -28,8 +28,8 @@ FROM oraclelinux:7-slim as builder
LABEL maintainer="Aurelio Garcia-Ribeyro <[email protected]>"

RUN yum install -y gzip tar
# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8

Expand All @@ -43,48 +43,48 @@ ENV JAVA_HOME=/usr/java/jdk-11
COPY *.tar.gz /tmp/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -eux; \
ARCH="$(uname -m)" && \
ARCH="$(uname -m)" && \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-11*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
mv "$(ls /tmp/jdk-11*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=d22d0fcca761861a1eb2f5f6eb116c933354e8b1f76b3cda189c722cc0177c98 ; \
else \
mv "$(ls /tmp/jdk-11*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=3fc0d93f6363d32723c293ba5a9016e8ab27410351ed804020cfe71e87d3bc0a ; \
mv "$(ls /tmp/jdk-11*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=3fc0d93f6363d32723c293ba5a9016e8ab27410351ed804020cfe71e87d3bc0a ; \
fi && \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1
## Get a fresh version of SLIM for the final image
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1
## Get a fresh version of SLIM for the final image
FROM oraclelinux:7-slim

# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8

ENV JAVA_HOME=/usr/java/jdk-11

ENV PATH $JAVA_HOME/bin:$PATH
ENV PATH $JAVA_HOME/bin:$PATH

# Copy the uncompressed Java Runtime from the builder image
COPY --from=builder $JAVA_HOME $JAVA_HOME

RUN set -eux; \
# Update the base image
yum -y update; \
yum install -y \
# JDK assumes freetype is available
freetype fontconfig \
; \
rm -rf /var/cache/yum; \
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; \
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
java -Xshare:dump;
yum -y update; \
yum install -y \
# JDK assumes freetype is available
freetype fontconfig \
; \
rm -rf /var/cache/yum; \
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; \
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
java -Xshare:dump;

CMD ["jshell"]
44 changes: 22 additions & 22 deletions OracleJava/11/Dockerfile.ol8
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# $ docker build -t oracle/jdk:11 .
#
# This command is already scripted in build.sh so you can alternatively run
# $ bash build.sh 8
# $ bash build.sh 8
#
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.

Expand All @@ -42,18 +42,18 @@ ENV JAVA_HOME=/usr/java/jdk-11
COPY *.tar.gz /tmp/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -eux; \
ARCH="$(uname -m)" && \
ARCH="$(uname -m)" && \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-11*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
mv "$(ls /tmp/jdk-11*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=d22d0fcca761861a1eb2f5f6eb116c933354e8b1f76b3cda189c722cc0177c98 ; \
else \
mv "$(ls /tmp/jdk-11*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=3fc0d93f6363d32723c293ba5a9016e8ab27410351ed804020cfe71e87d3bc0a ; \
mv "$(ls /tmp/jdk-11*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=3fc0d93f6363d32723c293ba5a9016e8ab27410351ed804020cfe71e87d3bc0a ; \
fi && \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
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 All @@ -63,26 +63,26 @@ ENV LANG en_US.UTF-8

ENV JAVA_HOME=/usr/java/jdk-11

ENV PATH $JAVA_HOME/bin:$PATH
ENV PATH $JAVA_HOME/bin:$PATH

# Copy the uncompressed Java Runtime from the builder image
COPY --from=builder $JAVA_HOME $JAVA_HOME

RUN set -eux; \
dnf -y update; \
dnf install -y \
dnf -y update; \
dnf install -y \
# JDK assumes freetype is available
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; \
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; \
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
java -Xshare:dump;
java -Xshare:dump;

CMD ["jshell"]
8 changes: 4 additions & 4 deletions OracleJava/11/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

if test "$1" = "8"
then
echo "Building Oracle JDK 11 on Oracle Linux 8"
docker build --file Dockerfile.ol8 --tag oracle/jdk:11-ol8 .
echo "Building Oracle JDK 11 on Oracle Linux 8"
docker build --file Dockerfile.ol8 --tag oracle/jdk:11-ol8 .
else
echo "Building Oracle JDK 11 on Oracle Linux 7 slim"
docker build --tag oracle/jdk:11-ol7 .
echo "Building Oracle JDK 11 on Oracle Linux 7 slim"
docker build --tag oracle/jdk:11-ol7 .
fi
52 changes: 26 additions & 26 deletions OracleJava/17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# $ docker build -t oracle/jdk:17 .
#
# This command is already scripted in build.sh so you can alternatively run
# $ bash build.sh
# $ bash build.sh
#
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.

Expand All @@ -41,26 +41,26 @@ ENV JAVA_HOME=/usr/java/jdk-17
COPY *.tar.gz /tmp/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -eux; \
ARCH="$(uname -m)" && \
ARCH="$(uname -m)" && \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-17*_linux-x64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
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 ; \
mv "$(ls /tmp/jdk-17*_linux-aarch64_bin.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=277e0010e7b17583e63827f9537a153ea79cb4b6ca28d523cd8a82f14a24a769 ; \
fi && \
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1
## Get a fresh version of OL8 for the final image
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
mkdir -p "$JAVA_HOME"; \
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

# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8
ENV JAVA_HOME=/usr/java/jdk-17
ENV PATH $JAVA_HOME/bin:$PATH
ENV JAVA_HOME=/usr/java/jdk-17
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);
Expand All @@ -70,18 +70,18 @@ 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;
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"]
62 changes: 31 additions & 31 deletions OracleJava/21/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# This dockerfile will download a copy of JDK 21 from
# https://download.oracle.com/java/21/latest/jdk-21_linux-<ARCH>_bin.tar.gz
# https://download.oracle.com/java/21/latest/jdk-21_linux-<ARCH>_bin.tar.gz
#
# It will use either x64 or aarch64 depending on the target platform
#
Expand All @@ -19,7 +19,7 @@
# $ docker build -t oracle/jdk:21 .
#
# This command is already scripted in build.sh so you can alternatively run
# $ bash build.sh
# $ bash build.sh
#
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.

Expand All @@ -29,39 +29,39 @@ 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;
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/21/latest \
JAVA_HOME=/usr/java/jdk-21
JAVA_HOME=/usr/java/jdk-21

##
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN set -eux; \
ARCH="$(uname -m)" && \
# Java uses just x64 in the name of the tarball
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-21_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
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-21
ENV PATH $JAVA_HOME/bin:$PATH
ENV JAVA_HOME=/usr/java/jdk-21
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);
Expand All @@ -71,18 +71,18 @@ 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;
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"]
Loading

0 comments on commit a9eaef6

Please sign in to comment.