Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle web logic14 and oracle java8 dockerfile fixes oca #2884

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 20 additions & 21 deletions OracleJava/8/jdk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,65 +19,64 @@
# $ docker build -t oracle/jdk:8 .
#
# 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.

FROM oraclelinux:7-slim as builder
FROM oraclelinux:7-slim AS builder

LABEL maintainer="Aurelio Garcia-Ribeyro <[email protected]>"

# Since the files is compressed as tar.gz first yum install gzip and tar
# Since the file is compressed as tar.gz, first install gzip and tar
RUN yum install -y gzip tar

# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8
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 the JDK tar.gz file
COPY jdk-8u*.tar.gz /tmp/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN set -eux; \
ARCH="$(uname -m)" && \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d ; \
ARCH="$(uname -m)"; \
if [ "$ARCH" = "x86_64" ]; then \
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz; \
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d; \
else \
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c ; \
fi && \
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz; \
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c; \
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
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1;

## Get a fresh version of Oracle Linux 7-slim for the final image
FROM oraclelinux:7-slim

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

# Set environment variables for Java
ENV JAVA_HOME=/usr/java/jdk-8

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

##
# Perform system updates and set up Java alternatives
RUN yum -y update; \
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; \
[ ! -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
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
# 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;
51 changes: 24 additions & 27 deletions OracleJava/8/jdk/Dockerfile.ol8
Original file line number Diff line number Diff line change
Expand Up @@ -18,67 +18,64 @@
# Run:
# $ docker build -t oracle/jdk:8 .
#
# This command is already scripted in build.sh so you can alternatively run
# $ bash build.sh 8
# This command is already scripted in build.sh so you can alternatively run:
# $ bash build.sh 8
#
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.

FROM oraclelinux:8 as builder
FROM oraclelinux:8 AS builder

LABEL maintainer="Aurelio Garcia-Ribeyro <[email protected]>"

# Since the files is compressed as tar.gz first yum install tar. gzip is already in oraclelinux:8
# Since the file is compressed as tar.gz, install tar (gzip is already included 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
# Default to UTF-8 file encoding
ENV LANG=en_US.UTF-8

# Set environment variables for the builder image
ENV JAVA_HOME=/usr/java/jdk-8

# Copy the JDK tar.gz file
COPY jdk-8u*.tar.gz /tmp/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN set -eux; \
ARCH="$(uname -m)" && \
if [ "$ARCH" = "x86_64" ]; \
then \
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d ; \
ARCH="$(uname -m)"; \
if [ "$ARCH" = "x86_64" ]; then \
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz; \
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d; \
else \
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz ; \
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c ; \
fi && \
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz; \
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c; \
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
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1;

## Get a fresh version of Oracle Linux 8 for the final image

FROM oraclelinux:8

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

# Set Java environment variables
ENV JAVA_HOME=/usr/java/jdk-8

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

##
# Perform system updates and configure alternatives for Java binaries
RUN dnf -y update; \
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; \
[ ! -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
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
# 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;
21 changes: 7 additions & 14 deletions OracleJava/8/serverjre/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,36 @@
#
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.

FROM oraclelinux:7-slim as builder
FROM oraclelinux:7-slim AS builder

LABEL maintainer="Aurelio Garcia-Ribeyro <[email protected]>"

# Since the files is compressed as tar.gz first yum install gzip and tar
# Since the files are compressed as tar.gz, first install gzip and tar
RUN yum install -y gzip tar

# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8
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=7c9a3a87045c226647c09bc1eb1fc832f99a9105dbc924cfeab3bf16b3504d24 ; \
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;

## Get a fresh version of Oracle Linux 7-slim for the final image

FROM oraclelinux:7-slim

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

ENV JAVA_HOME=/usr/java/jdk-8

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
Expand All @@ -67,10 +64,6 @@ RUN yum -y update; \
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; \
[ ! -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
# 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;
26 changes: 11 additions & 15 deletions OracleJava/8/serverjre/Dockerfile.ol8
Original file line number Diff line number Diff line change
Expand Up @@ -18,59 +18,55 @@
# Run:
# $ docker build -t oracle/serverjre:8 .
#
# This command is already scripted in build.sh so you can alternatively run
# This command is already scripted in build.sh, so you can alternatively run:
# $ bash build.sh 8
#
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.

FROM oraclelinux:8 as builder
FROM oraclelinux:8 AS builder

LABEL maintainer="Aurelio Garcia-Ribeyro <[email protected]>"

# Since the files is compressed as tar.gz first yum install tar. gzip is already in oraclelinux:8
# Since the file is compressed as tar.gz, install tar. gzip is already included in oraclelinux:8.
RUN dnf install -y tar

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

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

# 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=7c9a3a87045c226647c09bc1eb1fc832f99a9105dbc924cfeab3bf16b3504d24 ; \
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;

## Get a fresh version of Oracle Linux 8 for the final image

FROM oraclelinux:8

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

ENV JAVA_HOME=/usr/java/jdk-8

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

##
# Update system and clean cache
RUN dnf -y update; \
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; \
[ ! -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
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
# 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;
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
#
# From the Oracle Docker GitHub Project
# --------------------------------------
FROM oracle/jdk:11 as builder
ARG JAVA_VERSION=jdk:8-ol8
FROM oracle/$JAVA_VERSION AS builder

# Labels
# ------
LABEL "provider"="Oracle" \
"maintainer"="Monica Riccelli <[email protected]>" \
"issues"="https://github.com/oracle/docker-images/issues" \
"port.admin.listen"="7001" \
"port.administration"="9002"
LABEL provider="Oracle" \
maintainer="Monica Riccelli <[email protected]>" \
issues="https://github.com/oracle/docker-images/issues" \
port.admin.listen="7001" \
port.administration="9002"

# Common environment variables required for this build (do NOT change)
# --------------------------------------------------------------------
Expand Down Expand Up @@ -64,14 +64,22 @@ RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \
rm -rf /u01/oracle/cfgtoollogs

# Final image stage
FROM oracle/jdk:11
FROM oracle/$JAVA_VERSION AS runtime

ENV ORACLE_HOME=/u01/oracle \
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
HEALTH_SCRIPT_FILE=/u01/oracle/get_healthcheck_url.sh \
PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin


# Build arguments
ARG DOMAIN_NAME
ARG ADMIN_LISTEN_PORT
ARG ADMIN_NAME
ARG ADMINISTRATION_PORT_ENABLED
ARG ADMINISTRATION_PORT

# Domain and Server environment variables
# ------------------------------------------------------------
ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
Expand Down
Loading