Skip to content

Commit 83f5452

Browse files
committed
Update Oracle WebLogic and Java Dockerfiles for version 14.1.1.0
- Standardized Dockerfile formatting (e.g., uppercase `AS` in multi-stage builds) - Fixed minor grammatical issues in comments for clarity - Improved environment variable definitions with consistent syntax - Refined system update commands and alternatives configuration for Java binaries - Removed deprecated Dockerfiles for developer, generic, and slim distributions - Updated buildDockerImage.sh script for better compatibility with JDK 8/11 This update ensures consistency across the Dockerfiles and improves build stability. Signed-off-by: Marcos Caputo <[email protected]>
1 parent 801bdcb commit 83f5452

File tree

11 files changed

+135
-479
lines changed

11 files changed

+135
-479
lines changed

OracleJava/8/jdk/Dockerfile

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,65 +19,64 @@
1919
# $ docker build -t oracle/jdk:8 .
2020
#
2121
# This command is already scripted in build.sh so you can alternatively run
22-
# $ bash build.sh
22+
# $ bash build.sh
2323
#
2424
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.
2525

26-
FROM oraclelinux:7-slim as builder
26+
FROM oraclelinux:7-slim AS builder
2727

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

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

3333
# Default to UTF-8 file.encoding
34-
ENV LANG en_US.UTF-8
34+
ENV LANG=en_US.UTF-8
3535

3636
# Environment variables for the builder image.
3737
# Required to validate that you are using the correct file
38-
3938
ENV JAVA_HOME=/usr/java/jdk-8
4039

40+
# Copy the JDK tar.gz file
4141
COPY jdk-8u*.tar.gz /tmp/
4242
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
43+
4344
RUN set -eux; \
44-
ARCH="$(uname -m)" && \
45-
if [ "$ARCH" = "x86_64" ]; \
46-
then \
47-
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz ; \
48-
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d ; \
45+
ARCH="$(uname -m)"; \
46+
if [ "$ARCH" = "x86_64" ]; then \
47+
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz; \
48+
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d; \
4949
else \
50-
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz ; \
51-
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c ; \
52-
fi && \
50+
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz; \
51+
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c; \
52+
fi; \
5353
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
5454
mkdir -p "$JAVA_HOME"; \
55-
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1
55+
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1;
5656

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

6060
# Default to UTF-8 file.encoding
61-
ENV LANG en_US.UTF-8
61+
ENV LANG=en_US.UTF-8
6262

63+
# Set environment variables for Java
6364
ENV JAVA_HOME=/usr/java/jdk-8
64-
65-
ENV PATH $JAVA_HOME/bin:$PATH
65+
ENV PATH=$JAVA_HOME/bin:$PATH
6666

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

70-
##
70+
# Perform system updates and set up Java alternatives
7171
RUN yum -y update; \
7272
rm -rf /var/cache/yum; \
7373
ln -sfT "$JAVA_HOME" /usr/java/default; \
7474
ln -sfT "$JAVA_HOME" /usr/java/latest; \
7575
for bin in "$JAVA_HOME/bin/"*; do \
7676
base="$(basename "$bin")"; \
77-
[ ! -e "/usr/bin/$base" ]; \
78-
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
77+
[ ! -e "/usr/bin/$base" ] && alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
7978
done; \
8079
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
81-
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
80+
# The file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
8281
# See https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.html
8382
java -Xshare:dump;

OracleJava/8/jdk/Dockerfile.ol8

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,67 +18,64 @@
1818
# Run:
1919
# $ docker build -t oracle/jdk:8 .
2020
#
21-
# This command is already scripted in build.sh so you can alternatively run
22-
# $ bash build.sh 8
21+
# This command is already scripted in build.sh so you can alternatively run:
22+
# $ bash build.sh 8
2323
#
2424
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.
2525

26-
FROM oraclelinux:8 as builder
26+
FROM oraclelinux:8 AS builder
2727

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

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

33-
# Default to UTF-8 file.encoding
34-
ENV LANG en_US.UTF-8
35-
36-
# Environment variables for the builder image.
37-
# Required to validate that you are using the correct file
33+
# Default to UTF-8 file encoding
34+
ENV LANG=en_US.UTF-8
3835

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

39+
# Copy the JDK tar.gz file
4140
COPY jdk-8u*.tar.gz /tmp/
4241
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
42+
4343
RUN set -eux; \
44-
ARCH="$(uname -m)" && \
45-
if [ "$ARCH" = "x86_64" ]; \
46-
then \
47-
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz ; \
48-
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d ; \
44+
ARCH="$(uname -m)"; \
45+
if [ "$ARCH" = "x86_64" ]; then \
46+
mv "$(ls /tmp/jdk-8*-linux-x64.tar.gz)" /tmp/jdk.tar.gz; \
47+
JAVA_SHA256=b396978a716b7d23ccccabfe5c47c3b75d2434d7f8f7af690bc648172382720d; \
4948
else \
50-
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz ; \
51-
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c ; \
52-
fi && \
49+
mv "$(ls /tmp/jdk-8*-linux-aarch64.tar.gz)" /tmp/jdk.tar.gz; \
50+
JAVA_SHA256=e68d3e31ffcf7f05a4de65d04974843073bdff238bb6524adb272de9e616be7c; \
51+
fi; \
5352
echo "$JAVA_SHA256 */tmp/jdk.tar.gz" | sha256sum -c -; \
5453
mkdir -p "$JAVA_HOME"; \
55-
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1
54+
tar --extract --file /tmp/jdk.tar.gz --directory "$JAVA_HOME" --strip-components 1;
5655

5756
## Get a fresh version of Oracle Linux 8 for the final image
58-
5957
FROM oraclelinux:8
6058

61-
# Default to UTF-8 file.encoding
62-
ENV LANG en_US.UTF-8
59+
# Default to UTF-8 file encoding
60+
ENV LANG=en_US.UTF-8
6361

62+
# Set Java environment variables
6463
ENV JAVA_HOME=/usr/java/jdk-8
65-
66-
ENV PATH $JAVA_HOME/bin:$PATH
64+
ENV PATH=$JAVA_HOME/bin:$PATH
6765

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

71-
##
69+
# Perform system updates and configure alternatives for Java binaries
7270
RUN dnf -y update; \
7371
rm -rf /var/cache/dnf; \
7472
ln -sfT "$JAVA_HOME" /usr/java/default; \
7573
ln -sfT "$JAVA_HOME" /usr/java/latest; \
7674
for bin in "$JAVA_HOME/bin/"*; do \
7775
base="$(basename "$bin")"; \
78-
[ ! -e "/usr/bin/$base" ]; \
79-
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
76+
[ ! -e "/usr/bin/$base" ] && alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
8077
done; \
8178
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
82-
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
79+
# The file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
8380
# See https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.html
8481
java -Xshare:dump;

OracleJava/8/serverjre/Dockerfile

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,36 @@
2323
#
2424
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.
2525

26-
FROM oraclelinux:7-slim as builder
26+
FROM oraclelinux:7-slim AS builder
2727

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

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

3333
# Default to UTF-8 file.encoding
34-
ENV LANG en_US.UTF-8
34+
ENV LANG=en_US.UTF-8
3535

3636
# Environment variables for the builder image.
3737
# Required to validate that you are using the correct file
38-
3938
ENV JAVA_HOME=/usr/java/jdk-8
4039

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

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

5351
# Default to UTF-8 file.encoding
54-
ENV LANG en_US.UTF-8
52+
ENV LANG=en_US.UTF-8
5553

5654
ENV JAVA_HOME=/usr/java/jdk-8
57-
58-
ENV PATH $JAVA_HOME/bin:$PATH
55+
ENV PATH="$JAVA_HOME/bin:$PATH"
5956

6057
# Copy the uncompressed Java Runtime from the builder image
6158
COPY --from=builder $JAVA_HOME $JAVA_HOME
@@ -67,10 +64,6 @@ RUN yum -y update; \
6764
ln -sfT "$JAVA_HOME" /usr/java/latest; \
6865
for bin in "$JAVA_HOME/bin/"*; do \
6966
base="$(basename "$bin")"; \
70-
[ ! -e "/usr/bin/$base" ]; \
71-
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
67+
[ ! -e "/usr/bin/$base" ] && alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
7268
done; \
73-
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
74-
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
75-
# See https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.html
7669
java -Xshare:dump;

OracleJava/8/serverjre/Dockerfile.ol8

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,55 @@
1818
# Run:
1919
# $ docker build -t oracle/serverjre:8 .
2020
#
21-
# This command is already scripted in build.sh so you can alternatively run
21+
# This command is already scripted in build.sh, so you can alternatively run:
2222
# $ bash build.sh 8
2323
#
2424
# The builder image will be used to uncompress the tar.gz file with the Java Runtime.
2525

26-
FROM oraclelinux:8 as builder
26+
FROM oraclelinux:8 AS builder
2727

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

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

3333
# Default to UTF-8 file.encoding
34-
ENV LANG en_US.UTF-8
34+
ENV LANG=en_US.UTF-8
3535

3636
# Environment variables for the builder image.
37-
# Required to validate that you are using the correct file
38-
37+
# Required to validate that you are using the correct file.
3938
ENV JAVA_HOME=/usr/java/jdk-8
4039

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

4948
## Get a fresh version of Oracle Linux 8 for the final image
50-
5149
FROM oraclelinux:8
5250

5351
# Default to UTF-8 file.encoding
54-
ENV LANG en_US.UTF-8
52+
ENV LANG=en_US.UTF-8
5553

5654
ENV JAVA_HOME=/usr/java/jdk-8
57-
58-
ENV PATH $JAVA_HOME/bin:$PATH
55+
ENV PATH="$JAVA_HOME/bin:$PATH"
5956

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

63-
##
60+
# Update system and clean cache
6461
RUN dnf -y update; \
6562
rm -rf /var/cache/dnf; \
6663
ln -sfT "$JAVA_HOME" /usr/java/default; \
6764
ln -sfT "$JAVA_HOME" /usr/java/latest; \
6865
for bin in "$JAVA_HOME/bin/"*; do \
6966
base="$(basename "$bin")"; \
70-
[ ! -e "/usr/bin/$base" ]; \
71-
alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
67+
[ ! -e "/usr/bin/$base" ] && alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
7268
done; \
7369
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
74-
# the file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
70+
# The file will be stored as /usr/java/jdk-8/jre/lib/amd64/server/classes.jsa
7571
# See https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.html
7672
java -Xshare:dump;

OracleWebLogic/dockerfiles/14.1.1.0/Dockerfile.developer-11 renamed to OracleWebLogic/dockerfiles/14.1.1.0/Dockerfile.developer

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
#
2323
# From the Oracle Docker GitHub Project
2424
# --------------------------------------
25-
FROM oracle/jdk:11 as builder
25+
ARG JAVA_VERSION=jdk:8-ol8
26+
FROM oracle/$JAVA_VERSION AS builder
2627

2728
# Labels
28-
# ------
29-
LABEL "provider"="Oracle" \
30-
"maintainer"="Monica Riccelli <[email protected]>" \
31-
"issues"="https://github.com/oracle/docker-images/issues" \
32-
"port.admin.listen"="7001" \
33-
"port.administration"="9002"
29+
LABEL provider="Oracle" \
30+
maintainer="Monica Riccelli <[email protected]>" \
31+
issues="https://github.com/oracle/docker-images/issues" \
32+
port.admin.listen="7001" \
33+
port.administration="9002"
3434

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

6666
# Final image stage
67-
FROM oracle/jdk:11
67+
FROM oracle/$JAVA_VERSION AS runtime
6868

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

75+
76+
# Build arguments
77+
ARG DOMAIN_NAME
78+
ARG ADMIN_LISTEN_PORT
79+
ARG ADMIN_NAME
80+
ARG ADMINISTRATION_PORT_ENABLED
81+
ARG ADMINISTRATION_PORT
82+
7583
# Domain and Server environment variables
7684
# ------------------------------------------------------------
7785
ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \

0 commit comments

Comments
 (0)