From d920c892ab83e1f86a061d4901f68593d19f3b9b Mon Sep 17 00:00:00 2001 From: Joze RIHTARSIC <joze.RIHTARSIC@ext.ec.europa.eu> Date: Tue, 31 May 2022 13:20:29 +0200 Subject: [PATCH] Update weblogic version. --- .../status-folder/.disable_default_excludes | 4 + .../weblogic-oracle/status-folder/.gitignore | 5 + .../status-folder/database.status | 1 - smp-docker/images/build-docker-images.sh | 30 +- .../oracle/OracleJava/java-8/Dockerfile | 88 ++++- .../images/oracle/OracleJava/java-8/build.sh | 15 +- .../weblogic-12.2.1.3/Checksum.developer | 6 - .../oracle/weblogic-12.2.1.3/Checksum.generic | 6 - .../oracle/weblogic-12.2.1.3/Dockerfile | 87 ----- .../images/oracle/weblogic-12.2.1.3/README.md | 98 ------ ....2.1.3.0_wls_quick_Disk1_1of1.zip.download | 5 - .../properties/domain.properties | 2 - .../weblogic-12.2.1.4/Checksum.developer | 6 + .../oracle/weblogic-12.2.1.4/Checksum.generic | 6 + .../oracle/weblogic-12.2.1.4/Checksum.slim | 5 + .../Dockerfile.developer | 92 ++++-- .../Dockerfile.generic | 96 ++++-- .../oracle/weblogic-12.2.1.4/Dockerfile.slim | 114 +++++++ .../images/oracle/weblogic-12.2.1.4/README.md | 99 ++++++ .../container-scripts/create-wls-domain.py | 8 +- .../createAndStartEmptyDomain.sh | 31 +- .../container-scripts/get_healthcheck_url.sh | 11 + ...2.2.1.4.0_wls_lite_Disk1_1of1.zip.download | 5 + ....2.1.4.0_wls_quick_Disk1_1of1.zip.download | 5 + ...4.0_wls_quick_slim_Disk1_1of1.zip.download | 5 + .../install.file | 2 +- .../oraInst.loc | 0 .../properties/domain.properties | 2 + .../Dockerfile | 76 ----- .../README.md | 92 ------ .../build.sh | 43 --- .../container-scripts/setEnv.sh | 58 ---- .../container-scripts/create-wls-domain.py | 63 +--- .../container-scripts/createWLSDomain.sh | 6 +- .../datasource.properties.oracle | 0 .../container-scripts/deploySMPToDomain.sh | 0 .../container-scripts/ds-deploy.py | 0 .../functions/keystore.functions | 305 ++++++++++++++++++ .../container-scripts/shutdown-servers.py | 0 .../container-scripts/smp-app-deploy.py | 0 .../container-scripts/startAdminServer.sh | 0 .../container-scripts/startManagedServer.sh | 2 +- .../container-scripts/waitForAdminServer.sh | 4 +- .../container-scripts/wlst | 0 .../properties/docker-build/domain.properties | 3 +- .../docker-build/domain_security.properties | 0 .../properties/docker-run/security.properties | 0 .../images/weblogic-12.2.1.3-smp/Dockerfile | 43 --- .../images/weblogic-12.2.1.3-smp/README.md | 45 --- 49 files changed, 831 insertions(+), 743 deletions(-) create mode 100644 smp-docker/compose/weblogic-oracle/status-folder/.disable_default_excludes create mode 100644 smp-docker/compose/weblogic-oracle/status-folder/.gitignore delete mode 100644 smp-docker/compose/weblogic-oracle/status-folder/database.status delete mode 100644 smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.developer delete mode 100644 smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.generic delete mode 100644 smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile delete mode 100644 smp-docker/images/oracle/weblogic-12.2.1.3/README.md delete mode 100644 smp-docker/images/oracle/weblogic-12.2.1.3/fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip.download delete mode 100644 smp-docker/images/oracle/weblogic-12.2.1.3/properties/domain.properties create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.developer create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.generic create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.slim rename smp-docker/images/oracle/{weblogic-12.2.1.3 => weblogic-12.2.1.4}/Dockerfile.developer (51%) rename smp-docker/images/oracle/{weblogic-12.2.1.3 => weblogic-12.2.1.4}/Dockerfile.generic (53%) create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.slim create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/README.md rename smp-docker/images/oracle/{weblogic-12.2.1.3 => weblogic-12.2.1.4}/container-scripts/create-wls-domain.py (94%) rename smp-docker/images/oracle/{weblogic-12.2.1.3 => weblogic-12.2.1.4}/container-scripts/createAndStartEmptyDomain.sh (70%) create mode 100755 smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/get_healthcheck_url.sh create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip.download create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip.download create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip.download rename smp-docker/images/oracle/{weblogic-12.2.1.3 => weblogic-12.2.1.4}/install.file (76%) rename smp-docker/images/oracle/{weblogic-12.2.1.3 => weblogic-12.2.1.4}/oraInst.loc (100%) create mode 100644 smp-docker/images/oracle/weblogic-12.2.1.4/properties/domain.properties delete mode 100644 smp-docker/images/oracle/weblogic-12213-domain-home-in-image/Dockerfile delete mode 100644 smp-docker/images/oracle/weblogic-12213-domain-home-in-image/README.md delete mode 100755 smp-docker/images/oracle/weblogic-12213-domain-home-in-image/build.sh delete mode 100755 smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/setEnv.sh rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/container-scripts/create-wls-domain.py (73%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/container-scripts/createWLSDomain.sh (95%) rename smp-docker/images/{weblogic-12.2.1.3-smp => weblogic-12.2-smp}/container-scripts/datasource.properties.oracle (100%) rename smp-docker/images/{weblogic-12.2.1.3-smp => weblogic-12.2-smp}/container-scripts/deploySMPToDomain.sh (100%) rename smp-docker/images/{weblogic-12.2.1.3-smp => weblogic-12.2-smp}/container-scripts/ds-deploy.py (100%) create mode 100644 smp-docker/images/weblogic-12.2-smp/container-scripts/functions/keystore.functions rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/container-scripts/shutdown-servers.py (100%) rename smp-docker/images/{weblogic-12.2.1.3-smp => weblogic-12.2-smp}/container-scripts/smp-app-deploy.py (100%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/container-scripts/startAdminServer.sh (100%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/container-scripts/startManagedServer.sh (98%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/container-scripts/waitForAdminServer.sh (72%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/container-scripts/wlst (100%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/properties/docker-build/domain.properties (88%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/properties/docker-build/domain_security.properties (100%) rename smp-docker/images/{oracle/weblogic-12213-domain-home-in-image => weblogic-12.2-smp}/properties/docker-run/security.properties (100%) delete mode 100644 smp-docker/images/weblogic-12.2.1.3-smp/Dockerfile delete mode 100644 smp-docker/images/weblogic-12.2.1.3-smp/README.md diff --git a/smp-docker/compose/weblogic-oracle/status-folder/.disable_default_excludes b/smp-docker/compose/weblogic-oracle/status-folder/.disable_default_excludes new file mode 100644 index 000000000..e5d41c1ef --- /dev/null +++ b/smp-docker/compose/weblogic-oracle/status-folder/.disable_default_excludes @@ -0,0 +1,4 @@ +.gitignore is excluded when sharing artifacts on bamboo +http://ant.apache.org/manual/dirtasks.html + +And we want this folder to be shared in order to keep the project structure. \ No newline at end of file diff --git a/smp-docker/compose/weblogic-oracle/status-folder/.gitignore b/smp-docker/compose/weblogic-oracle/status-folder/.gitignore new file mode 100644 index 000000000..bfed62890 --- /dev/null +++ b/smp-docker/compose/weblogic-oracle/status-folder/.gitignore @@ -0,0 +1,5 @@ +# Ignore everything in this directory +* +# Except the following +!.gitignore +!.disable_default_excludes \ No newline at end of file diff --git a/smp-docker/compose/weblogic-oracle/status-folder/database.status b/smp-docker/compose/weblogic-oracle/status-folder/database.status deleted file mode 100644 index 85a548816..000000000 --- a/smp-docker/compose/weblogic-oracle/status-folder/database.status +++ /dev/null @@ -1 +0,0 @@ -DATABASE IS READY TO USE! diff --git a/smp-docker/images/build-docker-images.sh b/smp-docker/images/build-docker-images.sh index 6ae88b863..6f0a43b2e 100755 --- a/smp-docker/images/build-docker-images.sh +++ b/smp-docker/images/build-docker-images.sh @@ -27,8 +27,8 @@ ORACLE_DB19_FILE="LINUX.X64_193000_db_home.zip" ORACLE_DOCKERFILE="Dockerfile.xe" ORACLE_DB_FILE="${ORACLE_DB11_FILE}" -SERVER_JDK_FILE="server-jre-8u211-linux-x64.tar.gz" -WEBLOGIC_122_QUICK_FILE="fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip" +SERVER_JDK_FILE="server-jre-8u333-linux-x64.tar.gz" +WEBLOGIC_122_QUICK_FILE="fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip" SMP_VERSION= ORACLE_ARTEFACTS="/CEF/repo" @@ -124,7 +124,7 @@ validateAndPrepareArtefacts() { exit 1 else # copy artefact to docker build folder - cp "${ORACLE_ARTEFACTS}/${WEBLOGIC_122_QUICK_FILE}" ./oracle/weblogic-12.2.1.3/ + cp "${ORACLE_ARTEFACTS}/${WEBLOGIC_122_QUICK_FILE}" ./oracle/weblogic-12.2.1.4/ fi @@ -133,6 +133,10 @@ validateAndPrepareArtefacts() { mkdir -p "./tomcat-mysql-smp-sml/artefacts" fi + if [[ ! -d "./weblogic-12.2-smp/artefacts" ]]; then + mkdir -p "./weblogic-12.2-smp/artefacts" + fi + # SMP artefats if [[ ! -f "${SMP_ARTEFACTS}/smp.war" ]]; then echo "SMP artefact '${SMP_ARTEFACTS}/smp.war' not found. Was project built!" @@ -140,7 +144,7 @@ validateAndPrepareArtefacts() { else # copy artefact to docker build folder # for weblogic - cp "${SMP_ARTEFACTS}/smp.war" ./weblogic-12.2.1.3-smp/smp.war + cp "${SMP_ARTEFACTS}/smp.war" ./weblogic-12.2-smp/artefacts/smp.war # for mysql tomcat cp "${SMP_ARTEFACTS}/smp.war" ./tomcat-mysql-smp-sml/artefacts/smp.war fi @@ -151,7 +155,7 @@ validateAndPrepareArtefacts() { exit 1 else # copy artefact to docker build folder - cp "${SMP_ARTEFACTS}/smp-${SMP_VERSION}-setup.zip" ./weblogic-12.2.1.3-smp/smp-setup.zip + cp "${SMP_ARTEFACTS}/smp-${SMP_VERSION}-setup.zip" ./weblogic-12.2-smp/artefacts/smp-setup.zip cp "${SMP_ARTEFACTS}/smp-${SMP_VERSION}-setup.zip" ./tomcat-mysql-smp-sml/artefacts/smp-setup.zip fi @@ -178,22 +182,16 @@ buildImages() { # ----------------------------------------------------------------------------- # build docker image for oracle database # ----------------------------------------------------------------------------- - # create docker OS image with java (https://github.com/oracle/docker-images/tree/master/OracleJava/java-8) docker build -t oracle/serverjre:8 ./oracle/OracleJava/java-8/ # create weblogic basic (https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles/12.2.1.3) - docker build -f ./oracle/weblogic-12.2.1.3/Dockerfile.developer -t oracle/weblogic:12.2.1.3-developer ./oracle/weblogic-12.2.1.3/ - - # create weblogic domain-home-in-image (https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image./) - ./oracle/weblogic-12213-domain-home-in-image/container-scripts/setEnv.sh ./oracle/weblogic-12213-domain-home-in-image/properties/docker-build/domain.properties - docker build $BUILD_ARG --force-rm=true -t oracle/12213-domain-home-in-image ./oracle/weblogic-12213-domain-home-in-image/ + docker build -f ./oracle/weblogic-12.2.1.4/Dockerfile.developer -t oracle/weblogic:12.2.1.4-developer ./oracle/weblogic-12.2.1.4/ # build SMP deployment. - docker build -t "smp-weblogic-122:${SMP_VERSION}" ./weblogic-12.2.1.3-smp/ --build-arg SMP_VERSION="$SMP_VERSION" + docker build -t "smp-weblogic-122:${SMP_VERSION}" ./weblogic-12.2-smp/ --build-arg SMP_VERSION="$SMP_VERSION" # build tomcat mysql image deployment. docker build -t "smp-sml-tomcat-mysql:${SMP_VERSION}" ./tomcat-mysql-smp-sml/ --build-arg SMP_VERSION=${SMP_VERSION} - } function pushImageToDockerhub() { @@ -226,11 +224,9 @@ function pushImageIfExisting() { cleanArtefacts() { rm "./oracle/oracle-db-${ORA_VERSION}/${ORACLE_DB_FILE}" # clean rm "./oracle/OracleJava/java-8/${SERVER_JDK_FILE}" # clean - rm "./oracle/weblogic-12.2.1.3/${WEBLOGIC_122_QUICK_FILE}" # clean - rm "./weblogic-12.2.1.3-smp/smp.war" - rm "./weblogic-12.2.1.3-smp/smp-setup.zip" + rm "./oracle/weblogic-12.2.1.4/${WEBLOGIC_122_QUICK_FILE}" # clean - # clear also the tomcat/mysql image + rm -rf "./weblogic-12.2-smp/artefacts/*.*" rm -rf "./tomcat-mysql-smp-sml/artefacts/*.*" if [[ "V$SMP_ARTEFACTS_CLEAR" == "Vtrue" ]]; then diff --git a/smp-docker/images/oracle/OracleJava/java-8/Dockerfile b/smp-docker/images/oracle/OracleJava/java-8/Dockerfile index 86cf76763..021afc3f8 100644 --- a/smp-docker/images/oracle/OracleJava/java-8/Dockerfile +++ b/smp-docker/images/oracle/OracleJava/java-8/Dockerfile @@ -1,19 +1,83 @@ -# LICENSE UPL 1.0 +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. # -# Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. # -FROM oraclelinux:7-slim +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle Server JRE 8 +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# +# (1) server-jre-8uXX-linux-x64.tar.gz +# Download from https://www.oracle.com/java/technologies/javase-server-jre8-downloads.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -t oracle/serverjre:8 . +# +# 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:7-slim as builder MAINTAINER Aurelio Garcia-Ribeyro <aurelio.garciaribeyro@oracle.com> -ENV JAVA_PKG=server-jre-8u*-linux-x64.tar.gz \ - JAVA_HOME=/usr/java/default +# Since the files is compressed as tar.gz first yum install gzip and tar +RUN set -eux; \ + yum install -y \ + gzip \ + tar \ + ; \ + rm -rf /var/cache/yum + +# 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_PKG=server-jre-8u333-linux-x64.tar.gz \ + JAVA_SHA256=e6383f75665f5674deeb7e5c366fc7c6fc93e990c638c224dc68c5ec2863b763 \ + JAVA_HOME=/usr/java/jdk-8 + +COPY $JAVA_PKG /tmp/jdk.tgz +RUN set -eux; \ + 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 SLIM for the final image + +FROM oraclelinux:7-slim + +# Default to UTF-8 file.encoding +ENV LANG en_US.UTF-8 + +ENV JAVA_VERSION=1.8.0_333 \ + JAVA_HOME=/usr/java/jdk-8 + +ENV PATH $JAVA_HOME/bin:$PATH -ADD $JAVA_PKG /usr/java/ +# Copy the uncompressed Java Runtime from the builder image +COPY --from=builder $JAVA_HOME $JAVA_HOME -RUN export JAVA_DIR=$(ls -1 -d /usr/java/*) && \ - ln -s $JAVA_DIR /usr/java/latest && \ - ln -s $JAVA_DIR /usr/java/default && \ - alternatives --install /usr/bin/java java $JAVA_DIR/bin/java 20000 && \ - alternatives --install /usr/bin/javac javac $JAVA_DIR/bin/javac 20000 && \ - alternatives --install /usr/bin/jar jar $JAVA_DIR/bin/jar 20000 +## +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; \ + 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; + \ No newline at end of file diff --git a/smp-docker/images/oracle/OracleJava/java-8/build.sh b/smp-docker/images/oracle/OracleJava/java-8/build.sh index 5f9c79d9b..8e74ba7ac 100755 --- a/smp-docker/images/oracle/OracleJava/java-8/build.sh +++ b/smp-docker/images/oracle/OracleJava/java-8/build.sh @@ -1,2 +1,15 @@ #!/bin/sh -docker build -t oracle/serverjre:8 . + +# Copyright (c) 2019, 2022 Oracle and/or its affiliates. +# +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +if test "$1" = "8" +then + echo "Building Oracle Server JRE 8 on Oracle Linux 8" + docker build --file Dockerfile.8 --tag oracle/serverjre:8-oraclelinux8 . +else + echo "Building Oracle Server JRE 8 on Oracle Linux 7 slim" + docker build --tag oracle/serverjre:8 --tag oracle/serverjre:8-oraclelinux7 . +fi + diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.developer b/smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.developer deleted file mode 100644 index 8b78a3595..000000000 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.developer +++ /dev/null @@ -1,6 +0,0 @@ -# Download WebLogic Server Quick Installer 12.2.1.3 -# -# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html -# -a5d4811b431b2166e3e16c20c36ede09 fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip - diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.generic b/smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.generic deleted file mode 100644 index 7290c15d4..000000000 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/Checksum.generic +++ /dev/null @@ -1,6 +0,0 @@ -# Download WebLogic Server Generic Installer 12.2.1.3 -# -# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html -# -ea1b961b8896ac2f4006921965e41ddf fmw_12.2.1.3.0_wls_Disk1_1of1.zip - diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile b/smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile deleted file mode 100644 index 9b5a1fb6e..000000000 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile +++ /dev/null @@ -1,87 +0,0 @@ -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. -# -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for WebLogic 12.2.1.3 Quick Install Distro -# -# REQUIRED FILES TO BUILD THIS IMAGE -# ---------------------------------- -# (1) fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip -# Download the Developer Quick installer from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html -# -# (2) server-jre-8uXX-linux-x64.tar.gz -# Download from http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ docker build -t oracle/weblogic:12.2.1.3-developer . -# -# IMPORTANT -# --------- -# The resulting image of this Dockerfile contains a WLS Empty Domain. -# -# Pull base image -# From the Oracle Registry -# ------------------------- -FROM oracle/serverjre:8 - -# Maintainer -# ---------- -MAINTAINER Monica Riccelli <monica.riccelli@oracle.com> - -# Common environment variables required for this build (do NOT change) -# -------------------------------------------------------------------- -ENV ORACLE_HOME=/u01/oracle \ - USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \ - SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \ - PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin - -# Setup filesystem and oracle user -# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation -# ------------------------------------------------------------ -RUN mkdir -p /u01 && \ - chmod a+xr /u01 && \ - useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle - -# Copy scripts -#------------- -COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/ - -# Domain and Server environment variables -# ------------------------------------------------------------ -ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \ - ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}" \ - ADMIN_NAME="${ADMIN_NAME:-AdminServer}" \ - DEBUG_FLAG=true \ - PRODUCTION_MODE=dev \ - ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}" \ - ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}" - - - -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -ENV FMW_PKG=fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip \ - FMW_JAR=fmw_12.2.1.3.0_wls_quick.jar - -# Copy packages -# ------------- -COPY $FMW_PKG install.file oraInst.loc /u01/ -RUN chown oracle:oracle -R /u01 && \ - chmod +xr $SCRIPT_FILE - -# Install -# ------------------------------------------------------------ -USER oracle -RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \ - ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ - rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file - -WORKDIR ${ORACLE_HOME} - -# Define default command to start script. -CMD ["/u01/oracle/createAndStartEmptyDomain.sh"] diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/README.md b/smp-docker/images/oracle/weblogic-12.2.1.3/README.md deleted file mode 100644 index 2c7cd8397..000000000 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/README.md +++ /dev/null @@ -1,98 +0,0 @@ -Oracle WebLogic Server on Docker -================================= -These Docker configurations have been used to create the Oracle WebLogic Server (WLS) image. Providing this WLS image facilitates the configuration and environment setup for DevOps users. This project includes the installation and creation of an empty WebLogic Server domain (an Administration Server only). These Oracle WebLogic Server 12.2.1.3 images are based on Oracle Linux and Oracle JRE 8 (Server). - -The certification of Oracle WebLogic Server on Docker does not require the use of any file presented in this repository. Customers and users are welcome to use them as starters, and customize, tweak, or create from scratch, new scripts and Dockerfiles. - -For more information on the certification, please see the [Oracle WebLogic Server on Docker certification whitepaper](http://www.oracle.com/technetwork/middleware/weblogic/overview/weblogic-server-docker-containers-2491959.pdf) and [The WebLogic Server Blog](https://blogs.oracle.com/WebLogicServer/) for updates. - -## How to build and run -This project offers sample Dockerfiles for Oracle WebLogic Server 12cR2 (12.2.1.3). It provides at least one Dockerfile for the 'developer' distribution, a second Dockerfile for the 'generic' distribution. To assist in building the images, you can use the [`buildDockerImage.sh`](dockerfiles/buildDockerImage.sh) script. See below for instructions and usage. - -The `buildDockerImage.sh` script is a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters. - -### Building Oracle WebLogic Server Docker install images -**IMPORTANT:** You must download the binary of Oracle WebLogic Server and put it in place (see `.download` files inside `dockerfiles/<version>`). The WebLogic image extends the Oracle JRE Server 8 image. You must either build the image by using the Dockerfile in [`../../../OracleJava/java8`](https://github.com/oracle/docker-images/tree/master/OracleJava/java-8) or pull the latest image from the [Oracle Container Registry](https://container-registry.oracle.com) or the [Docker Store](https://store.docker.com). - -Before you build, select the version and distribution for which you want to build an image, then download the required packages (see `.download` files) and locate them in the folder of your distribution version of choice. Then, from the `dockerfiles` folder, run the `buildDockerImage.sh` script as root. - - $ sh buildDockerImage.sh - Usage: buildDockerImage.sh -v [version] [-d | -g ] [-s] - Builds a Docker Image for Oracle WebLogic Server. - - Parameters: - -v: version to build. Required. - Choose : 12.2.1.3 - -d: creates image based on 'developer' distribution - -g: creates image based on 'generic' distribution - -c: enables Docker image layer cache during build - -s: skips the MD5 check of packages - - * select one distribution only: -d, or -g - - LICENSE UPL 1.0 - - Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. - -**IMPORTANT:** The resulting images will have a single server domain (Administration Server only), by default. - - - 1. To build the `12.2.1.3`image, from `dockerfiles`, call: - - `$ sh buildDockerImage.sh -v 12.2.1.3 -d` - - 2. Verify that you now have this image in place with: - - `$ docker images` - -### Running a single server domain from the image -The WebLogic Server install image (built above) allows you to run a container with a single WebLogic Server domain. This makes it extremely simple to deploy applications and any resource the application might need. - -#### Providing the Administration Server user name and password -The user name and password must be supplied in a `domain.properties` file located in a HOST directory that you will map at Docker runtime with the `-v` option to the image directory `/u01/oracle/properties`. The properties file enables the scripts to configure the correct authentication for the WebLogic Administration Server. - -The format of the `domain.properties` file is key=value pair: - - username=myadminusername - password=myadminpassword - -**Note**: Oracle recommends that the `domain.properties` file be deleted or secured after the container and the WebLogic Server are started so that the user name and password are not inadvertently exposed. - -#### Start the container -Start a container from the image created in step 1. -You can override the default values of the following parameters during runtime with the `-e` option: - - * `ADMIN_NAME` (default: `AdminServer`) - * `ADMIN_LISTEN_PORT` (default: `7001`) - * `DOMAIN_NAME` (default: `base_domain`) - * `ADMINISTRATION_PORT_ENABLED` (default: `true`) - * `ADMINISTRATION_PORT` (default: `9002`) - -**NOTE**: For security, the Administration port 9002 is enabled by default, before running the container in WebLogic 12.2.1.3 the patch 27117282 must be applied. Please download the patch and apply it after you have built the 12.2.1.3 image. You can follow the sample https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-patch to see how to patch. An alternative is to not enable Administration port when you issue the docker run command, set `ADMINISTRTATION_PORT_ENABLED` to false. If you intend to run these images in production, then you must change the Production Mode to `production`. When you set the `DOMAIN_NAME`, the `DOMAIN_HOME=/u01/oracle/user_projects/domains/$DOMAIN_NAME`. - - $docker run -d -p 7001:7001 -p 9002:9002 -v `HOST PATH where the domain.properties file is`:/u01/oracle/properties -e ADMINISTRATION_PORT_ENABLED=true -e DOMAIN_NAME=abc_domain oracle/weblogic:12.2.1.3-developer - -Run the WLS Administration Console: - - $ docker inspect --format '{{.NetworkSettings.IPAddress}}' <container-name> - -In your browser, enter `https://xxx.xx.x.x:9002/console`. Your browser will request that you accept the Security Exception. To avoid the Security Exception, you must update the WebLogic Server SSL configuration with a custom identity certificate. - -## Choose your Oracle WebLogic Server distribution - -This project hosts two configurations (depending on the Oracle WebLogic Server version) for building Docker images with WebLogic Server 12c. - - * Quick Install Developer Distribution - - - For more information on the Oracle WebLogic Server 12cR2 Quick Install Developer Distribution, see [WLS Quick Install Distribution for Oracle WebLogic Server 12.2.1.3.0](http://download.oracle.com/otn/nt/middleware/12c/wls/12213/README.txt). - - - * Generic Distribution - - - For more information on the Oracle WebLogic Server 12cR2 Generic Full Distribution, see [WebLogic Server 12.2.1.3 Documentation](http://docs.oracle.com/middleware/12213/wls/index.html). - -## Samples for Oracle WebLogic Server domain creation -To give users an idea of how to create a WebLogic domain and cluster from a custom Dockerfile which extends the WebLogic Server install image, we provide a few samples for 12c versions of the developer distribution. For an example, look at the `12213-domain` sample. - -## Copyright -Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip.download b/smp-docker/images/oracle/weblogic-12.2.1.3/fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip.download deleted file mode 100644 index 29195504d..000000000 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip.download +++ /dev/null @@ -1,5 +0,0 @@ -# Download WebLogic Server Quick Installer 12.2.1.3 -# -# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html -# -a5d4811b431b2166e3e16c20c36ede09 fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/properties/domain.properties b/smp-docker/images/oracle/weblogic-12.2.1.3/properties/domain.properties deleted file mode 100644 index ee2eecf41..000000000 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/properties/domain.properties +++ /dev/null @@ -1,2 +0,0 @@ -username=weblogic -password=Weblogic1 diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.developer b/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.developer new file mode 100644 index 000000000..169a46a59 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.developer @@ -0,0 +1,6 @@ +# Download WebLogic Server Quick Installer 12.2.1.4 +# +# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html +# +8f88d91600ecb6826a91a3b72f832c6a fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip + diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.generic b/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.generic new file mode 100644 index 000000000..bde049748 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.generic @@ -0,0 +1,6 @@ +# Download WebLogic Server Generic Installer 12.2.1.4 +# +# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html +# +650109d90ab3da8f7a64b24a98e072b3 fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip + diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.slim b/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.slim new file mode 100644 index 000000000..d5ae7956d --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/Checksum.slim @@ -0,0 +1,5 @@ +# Download WebLogic Server Slim Installer 12.2.1.4 +# +# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html +# +df55639e00817308be249af5aa602bfb fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile.developer b/smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.developer similarity index 51% rename from smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile.developer rename to smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.developer index 9b5a1fb6e..ab4822880 100644 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile.developer +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.developer @@ -1,14 +1,14 @@ -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +#Copyright (c) 2014, 2020, Oracle and/or its affiliates. # -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +#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 WebLogic 12.2.1.3 Quick Install Distro +# This is the Dockerfile for WebLogic 12.2.1.4 Quick Install Distro # # REQUIRED FILES TO BUILD THIS IMAGE # ---------------------------------- -# (1) fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip +# (1) fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip # Download the Developer Quick installer from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html # # (2) server-jre-8uXX-linux-x64.tar.gz @@ -18,38 +18,64 @@ # ----------------------- # Put all downloaded files in the same directory as this Dockerfile # Run: -# $ docker build -t oracle/weblogic:12.2.1.3-developer . +# $ docker build -f Dockerfile.developer -t oracle/weblogic:12.2.1.4-developer . # # IMPORTANT # --------- # The resulting image of this Dockerfile contains a WLS Empty Domain. # -# Pull base image -# From the Oracle Registry -# ------------------------- -FROM oracle/serverjre:8 +# Extend base JRE image +# You must build the image by using the Dockerfile in GitHub project `../../../OracleJava/java8` +# ---------------------------------------------------------------------------------------------- +FROM oracle/serverjre:8 as builder -# Maintainer -# ---------- -MAINTAINER Monica Riccelli <monica.riccelli@oracle.com> +# Labels +# ------ +LABEL "provider"="Oracle" \ + "maintainer"="Monica Riccelli <monica.riccelli@oracle.com>" \ + "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) # -------------------------------------------------------------------- ENV ORACLE_HOME=/u01/oracle \ USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \ - SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \ PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin # Setup filesystem and oracle user # Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation # ------------------------------------------------------------ -RUN mkdir -p /u01 && \ - chmod a+xr /u01 && \ - useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle +RUN mkdir /u01 && \ + useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ + chown oracle:root -R /u01 && \ + chmod -R 775 /u01 -# Copy scripts -#------------- -COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/ +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV FMW_PKG=fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip \ + FMW_JAR=fmw_12.2.1.4.0_wls_quick.jar + +# Copy packages +# ------------- +COPY --chown=oracle:root $FMW_PKG install.file oraInst.loc /u01/ + +# Install +# ------------------------------------------------------------ +USER oracle +RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \ + ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ + rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/install.file && \ + rm -rf /u01/oracle/cfgtoollogs + +# Final image stage +FROM oracle/serverjre:8 + +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 # Domain and Server environment variables # ------------------------------------------------------------ @@ -61,26 +87,26 @@ ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \ ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}" \ ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}" +# Setup filesystem and oracle user +# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation +# ------------------------------------------------------------ +RUN mkdir -p /u01 && \ + chmod 775 /u01 && \ + useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ + chown oracle:root /u01 +COPY --from=builder --chown=oracle:root /u01 /u01 -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -ENV FMW_PKG=fmw_12.2.1.3.0_wls_quick_Disk1_1of1.zip \ - FMW_JAR=fmw_12.2.1.3.0_wls_quick.jar +# Copy scripts +#------------- +COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py container-scripts/get_healthcheck_url.sh /u01/oracle/ -# Copy packages -# ------------- -COPY $FMW_PKG install.file oraInst.loc /u01/ -RUN chown oracle:oracle -R /u01 && \ - chmod +xr $SCRIPT_FILE +RUN chmod +xr $SCRIPT_FILE $HEALTH_SCRIPT_FILE && \ + chown oracle:root $SCRIPT_FILE /u01/oracle/create-wls-domain.py $HEALTH_SCRIPT_FILE -# Install -# ------------------------------------------------------------ USER oracle -RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \ - ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ - rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file +HEALTHCHECK --start-period=10s --timeout=30s --retries=3 CMD curl -k -s --fail `$HEALTH_SCRIPT_FILE` || exit 1 WORKDIR ${ORACLE_HOME} # Define default command to start script. diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile.generic b/smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.generic similarity index 53% rename from smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile.generic rename to smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.generic index cbe0d3ac3..c5a4b58ac 100644 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/Dockerfile.generic +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.generic @@ -1,14 +1,14 @@ -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +#Copyright (c) 2014, 2020, Oracle and/or its affiliates. # -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +#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 WebLogic Server 12.2.1.3 Generic Distro +# This is the Dockerfile for Oracle WebLogic Server 12.2.1.4 Generic Distro # # REQUIRED FILES TO BUILD THIS IMAGE # ---------------------------------- -# (1) fmw_12.2.1.3.0_wls_Disk1_1of1.zip +# (1) fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip # Download the Generic installer from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html # # (2) server-jre-8uXX-linux-x64.tar.gz @@ -18,67 +18,93 @@ # ----------------------- # Put all downloaded files in the same directory as this Dockerfile # Run: -# $ docker build -f Dockerfile.generic -t oracle/weblogic:12.2.1.3-generic . +# $ docker build -f Dockerfile.generic -t oracle/weblogic:12.2.1.4-generic . # # IMPORTANT # --------- # The resulting image of this Dockerfile contains a WLS Empty Domain. # -# Pull base image -# From the Oracle Registry -# ------------------------- -FROM oracle/serverjre:8 +# Extend base JRE image +# You must build the image by using the Dockerfile in GitHub project `../../../OracleJava/java8` +# ---------------------------------------------------------------------------------------------- +FROM oracle/serverjre:8 as builder -# Maintainer -# ---------- -MAINTAINER Monica Riccelli <monica.riccelli@oracle.com> +# Labels +# ------ +LABEL "provider"="Oracle" \ + "maintainer"="Monica Riccelli <monica.riccelli@oracle.com>" \ + "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) # -------------------------------------------------------------------- ENV ORACLE_HOME=/u01/oracle \ USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \ - SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \ PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin # Setup filesystem and oracle user # Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation # ------------------------------------------------------------ -RUN mkdir -p /u01 && \ - chmod a+xr /u01 && \ - useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle - -# Copy scripts -#------------- -COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/ - -# Domain and Server environment variables -# ------------------------------------------------------------ -ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \ - ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}" \ - ADMIN_NAME="${ADMIN_NAME:-AdminServer}" \ - ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}" \ - ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}" +RUN mkdir /u01 && \ + useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ + chown oracle:root -R /u01 && \ + chmod -R 775 /u01 # Environment variables required for this build (do NOT change) # ------------------------------------------------------------- -ENV FMW_PKG=fmw_12.2.1.3.0_wls_Disk1_1of1.zip \ - FMW_JAR=fmw_12.2.1.3.0_wls.jar +ENV FMW_PKG=fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip \ + FMW_JAR=fmw_12.2.1.4.0_wls_lite_generic.jar # Copy packages # ------------- -COPY $FMW_PKG install.file oraInst.loc /u01/ -RUN chown oracle:oracle -R /u01 && \ - chmod +xr $SCRIPT_FILE +COPY --chown=oracle:root $FMW_PKG install.file oraInst.loc /u01/ # Install # ------------------------------------------------------------ USER oracle RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \ - ls /u01 && \ ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="WebLogic Server" && \ - rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file + rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/install.file && \ + rm -rf /u01/oracle/cfgtoollogs + +# Final image stage +FROM oracle/serverjre:8 + +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 + +# Domain and Server environment variables +# ------------------------------------------------------------ +ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \ + ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}" \ + ADMIN_NAME="${ADMIN_NAME:-AdminServer}" \ + ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}" \ + ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}" + +# Setup filesystem and oracle user +# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation +# ------------------------------------------------------------ +RUN mkdir -p /u01 && \ + chmod 775 /u01 && \ + useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ + chown oracle:root /u01 + +COPY --from=builder --chown=oracle:root /u01 /u01 +# Copy scripts +#------------- +COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py container-scripts/get_healthcheck_url.sh /u01/oracle/ + +RUN chmod +xr $SCRIPT_FILE $HEALTH_SCRIPT_FILE && \ + chown oracle:root $SCRIPT_FILE /u01/oracle/create-wls-domain.py $HEALTH_SCRIPT_FILE + +USER oracle +HEALTHCHECK --start-period=10s --timeout=30s --retries=3 CMD curl -k -s --fail `$HEALTH_SCRIPT_FILE` || exit 1 WORKDIR ${ORACLE_HOME} # Define default command to start script. diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.slim b/smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.slim new file mode 100644 index 000000000..96ecb17b2 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/Dockerfile.slim @@ -0,0 +1,114 @@ +#Copyright (c) 2014, 2020, 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 WebLogic Server 12.2.1.4 Slim Distro +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip +# Download the Slim installer from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html +# +# (2) server-jre-8uXX-linux-x64.tar.gz +# Download from http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ docker build -f Dockerfile.slim -t oracle/weblogic:12.2.1.4-slim . +# +# IMPORTANT +# --------- +# The resulting image of this Dockerfile contains a WLS Empty Domain. +# +# Extend base JRE image +# You must build the image by using the Dockerfile in GitHub project `../../../OracleJava/java8` +# ---------------------------------------------------------------------------------------------- +FROM oracle/serverjre:8 as builder + +# Labels +# ------ +LABEL "provider"="Oracle" \ + "maintainer"="Monica Riccelli <monica.riccelli@oracle.com>" \ + "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) +# -------------------------------------------------------------------- +ENV ORACLE_HOME=/u01/oracle \ + USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \ + PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin + +# Setup filesystem and oracle user +# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation +# ------------------------------------------------------------ +RUN mkdir /u01 && \ + useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ + chown oracle:root -R /u01 && \ + chmod -R 775 /u01 + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV FMW_PKG=fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip \ + FMW_JAR=fmw_12.2.1.4.0_wls_quick_slim.jar + +# Copy packages +# ------------- +COPY --chown=oracle:root $FMW_PKG install.file oraInst.loc /u01/ + +# Install +# ------------------------------------------------------------ +USER oracle + +RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \ + ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ + rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/install.file && \ + rm -rf /u01/oracle/cfgtoollogs + +# Final image stage +FROM oracle/serverjre:8 + +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 + +# Domain and Server environment variables +# ------------------------------------------------------------ +ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \ + ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}" \ + ADMIN_NAME="${ADMIN_NAME:-AdminServer}" \ + ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}" \ + ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}" \ + DEBUG_flag=false \ + PRODUCTION_MODE=prod + +# Setup filesystem and oracle user +# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation +# ------------------------------------------------------------ +RUN mkdir -p /u01 && \ + chmod 775 /u01 && \ + useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ + chown oracle:root /u01 + +COPY --from=builder --chown=oracle:root /u01 /u01 + +# Copy scripts +#------------- +COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py container-scripts/get_healthcheck_url.sh /u01/oracle/ + +RUN chmod +xr $SCRIPT_FILE $HEALTH_SCRIPT_FILE && \ + chown oracle:root $SCRIPT_FILE /u01/oracle/create-wls-domain.py $HEALTH_SCRIPT_FILE + +USER oracle + +HEALTHCHECK --start-period=10s --timeout=30s --retries=3 CMD curl -k -s --fail `$HEALTH_SCRIPT_FILE` || exit 1 +WORKDIR ${ORACLE_HOME} + +# Define default command to start script. +CMD ["/u01/oracle/createAndStartEmptyDomain.sh"] diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/README.md b/smp-docker/images/oracle/weblogic-12.2.1.4/README.md new file mode 100644 index 000000000..88802108c --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/README.md @@ -0,0 +1,99 @@ +Oracle WebLogic Server on Docker +================================= +These Docker configurations have been used to create the Oracle WebLogic Server (WLS) image. Providing this WLS image facilitates the configuration and environment setup for DevOps users. This project includes the installation and creation of an empty WebLogic Server domain (an Administration Server only). These Oracle WebLogic Server 12.2.1.4 images are based on Oracle Linux and Oracle JRE 8 (Server). + +The WebLogic Server install image allows you to run a WebLogic multi-server domain/cluster or a WebLogic single server domain. This makes it simple to deploy applications and any resources the application might need. + +The certification of Oracle WebLogic Server on Docker does not require the use of any file presented in this repository. Customers and users are welcome to use them as starters, and customize, tweak, or create from scratch, new scripts and Dockerfiles. + +For more information on the certification, please see the [Oracle WebLogic Server on Docker certification whitepaper](http://www.oracle.com/technetwork/middleware/weblogic/overview/weblogic-server-docker-containers-2491959.pdf) and [The WebLogic Server Blog](https://blogs.oracle.com/WebLogicServer/) for updates. + +## How to build and run +This project offers sample Dockerfiles for Oracle WebLogic Server 12cR2 (12.2.1.4). It provides at least one Dockerfile for the `developer` distribution, a second Dockerfile for the `generic` distribution, and a third Dockerfile for the `slim` distribution. + +1- The WebLogic `generic` image is supported for `development` and `production` deployment of WebLogic configurations using Docker. It contains the same binaries as those installed by the WebLogic generic installer. The WebLogic generic image is primarily intended for WebLogic domains managed with the WebLogic Kubernetes Operator, when WLS console-based monitoring, and possibly configuration, is required. All servers within a domain managed with the Operator will use the same WebLogic image. Support is also provided for environments where Kubernetes and/or the WebLogic Kubernetes Operator is not being used. + +2- The WebLogic `slim` image is supported for `development` and `production` deployment of WebLogic configurations using Docker. In order to reduce image size, it contains a subset of the binaries included in the WebLogic generic image. The WebLogic console, WebLogic examples, WebLogic clients, Maven plug-ins and Java DB have been removed - all binaries that remain included are the same as those in the WebLogic generic image. The WebLogic slim image is primarily intended for WebLogic domains managed with the WebLogic Kubernetes Operator, when WLS console-based monitoring and configuration is not required, and a smaller image size than the generic image is preferred. If there are requirements to monitor the WebLogic configuration, they should be addressed using Prometheus and Grafana or other alternatives. All servers within a domain managed with the Operator will use the same WebLogic image. Support is also provided for environments where Kubernetes and/or the WebLogic Kubernetes Operator is not being used. + +3- The WebLogic `developer` image is supported for `development` of WebLogic applications in Docker containers. In order to reduce image size, it contains a subset of the binaries included in the WebLogic generic image. WebLogic examples and WLS Console help files have been removed - all binaries that remain included are the same as those in the WebLogic generic image. The WebLogic developer image is primarily intended to provide a Docker image that is consistent with the WebLogic "quick installers" intended for `development` only. Production WebLogic domains should use the WebLogic generic or WebLogic slim images. + + +To assist in building the images, you can use the [`buildDockerImage.sh`](dockerfiles/buildDockerImage.sh) script. See below for instructions and usage. + +The `buildDockerImage.sh` script is a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters. + +### Building Oracle WebLogic Server Docker install images +**IMPORTANT:** You must download the binary of Oracle WebLogic Server and put it in place (see `.download` files inside `dockerfiles/<version>`). The WebLogic image extends the Oracle JRE Server 8 image. You must build the image by using the Dockerfile in [`../../../OracleJava/java8`](https://github.com/oracle/docker-images/tree/master/OracleJava/java-8). + +**NOTE:** The Dockerfiles install WebLogic with `INSTALL_TYPE=WebLogic Server` which does not include the WebLogic samples in the installation. If you want to include the WebLogic samples you need to change `INSTALL_TYPE=Complete with Examples` in the install.file. + +Before you build, select the version and distribution for which you want to build an image, then download the required packages (see `.download` files) and locate them in the folder of your distribution version of choice. Then, from the `dockerfiles` folder, run the `buildDockerImage.sh` script as root. + + $ sh buildDockerImage.sh + Usage: buildDockerImage.sh -v [version] [-d | -g | -m] [-s] + Builds a Docker Image for Oracle WebLogic Server. + + Parameters: + -v: version to build. Required. + Choose : 12.2.1.4 + -d: creates image based on 'developer' distribution + -g: creates image based on 'generic' distribution + -m: creates image based on 'slim' distribution + -c: enables Docker image layer cache during build + -s: skips the MD5 check of packages + + * select one distribution only: -d, -g, or -m + + LICENSE UPL 1.0 + + Copyright (c) 2014-2019 Oracle and/or its affiliates. All rights reserved. + +**IMPORTANT:** The resulting images will have a single server domain (Administration Server only), by default. + + + 1. To build the `12.2.1.4`image, from `dockerfiles`, call: + + `$ sh buildDockerImage.sh -v 12.2.1.4 -d` + + 2. Verify that you now have this image in place with: + + `$ docker images` + +### Running a single server domain from the image +The WebLogic Server install image (built above) allows you to run a container with a single WebLogic Server domain. This makes it extremely simple to deploy applications and any resource the application might need. + +#### Providing the Administration Server user name and password +The user name and password must be supplied in a `domain.properties` file located in a HOST directory that you will map at Docker runtime with the `-v` option to the image directory `/u01/oracle/properties`. The properties file enables the scripts to configure the correct authentication for the WebLogic Server Administration Server. + +The format of the `domain.properties` file is key=value pair: + + username=myadminusername + password=myadminpassword + +**Note**: Oracle recommends that the `domain.properties` file be deleted or secured after the container and the WebLogic Server are started so that the user name and password are not inadvertently exposed. + +#### Start the container +Start a container from the image created in step 1. +You can override the default values of the following parameters during runtime with the `-e` option: + + * `ADMIN_NAME` (default: `AdminServer`) + * `ADMIN_LISTEN_PORT` (default: `7001`) + * `DOMAIN_NAME` (default: `base_domain`) + * `ADMINISTRATION_PORT_ENABLED` (default: `true`) + * `ADMINISTRATION_PORT` (default: `9002`) + +**NOTE**: For security, the Administration port 9002 is enabled by default, before running the container in WebLogic 12.2.1.4. If you prefer to not enable the Administration port when you issue the `docker run` command, set `ADMINISTRTATION_PORT_ENABLED` to false. If you intend to run these images in production, then you must change the Production Mode to `production`. When you set the `DOMAIN_NAME`, the `DOMAIN_HOME=/u01/oracle/user_projects/domains/$DOMAIN_NAME`. + + $ docker run -d -p 7001:7001 -p 9002:9002 -v `HOST PATH where the domain.properties file is`:/u01/oracle/properties -e ADMINISTRATION_PORT_ENABLED=true -e DOMAIN_NAME=docker_domain -e ADMIN_NAME=docker-AdminServer oracle/weblogic:12.2.1.4-developer + +Run the WLS Administration Console: + + $ docker inspect --format '{{.NetworkSettings.IPAddress}}' <container-name> + +In your browser, enter `https://xxx.xx.x.x:9002/console`. Your browser will request that you accept the Security Exception. To avoid the Security Exception, you must update the WebLogic Server SSL configuration with a custom identity certificate. + +## Samples for Oracle WebLogic Server domain creation +To give users an idea of how to create a WebLogic domain and cluster from a custom Dockerfile which extends the WebLogic Server install image, we provide a few samples for 12c versions of the developer distribution. For an example, look at the `12214-domain` sample. + +## Copyright +Copyright (c) 2014, 2022, Oracle and/or its affiliates. diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/container-scripts/create-wls-domain.py b/smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/create-wls-domain.py similarity index 94% rename from smp-docker/images/oracle/weblogic-12.2.1.3/container-scripts/create-wls-domain.py rename to smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/create-wls-domain.py index a7c6cac5f..3ebe5004a 100644 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/container-scripts/create-wls-domain.py +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/create-wls-domain.py @@ -1,6 +1,6 @@ -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +#Copyright (c) 2014, 2022, Oracle and/or its affiliates. # -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +#Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. # # WebLogic on Docker Default Domain # @@ -49,8 +49,8 @@ set('Name', admin_name) set('ListenAddress', '') set('ListenPort', admin_listen_port) if administration_port_enabled != "false": - create('AdminServer','SSL') - cd('SSL/AdminServer') + create(admin_name, 'SSL') + cd('SSL/' + admin_name) set('Enabled', 'True') # Define the user password for weblogic diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/container-scripts/createAndStartEmptyDomain.sh b/smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/createAndStartEmptyDomain.sh similarity index 70% rename from smp-docker/images/oracle/weblogic-12.2.1.3/container-scripts/createAndStartEmptyDomain.sh rename to smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/createAndStartEmptyDomain.sh index d17d14016..d5eb9a79a 100755 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/container-scripts/createAndStartEmptyDomain.sh +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/createAndStartEmptyDomain.sh @@ -1,12 +1,9 @@ #!/bin/bash # -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2022, Oracle and/or its affiliates. # -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +#Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. -#Define DOMAIN_HOME -export DOMAIN_HOME=/u01/oracle/user_projects/domains/$DOMAIN_NAME -echo "Domain Home is: " $DOMAIN_HOME # If AdminServer.log does not exists, container is starting for 1st time # So it should start NM and also associate with AdminServer @@ -30,14 +27,14 @@ trap _term SIGTERM # Set SIGKILL handler trap _kill SIGKILL -ADD_DOMAIN=1 -if [ ! -f ${DOMAIN_HOME}/servers/AdminServer/logs/AdminServer.log ]; then - ADD_DOMAIN=0 -fi +#Define DOMAIN_HOME +export DOMAIN_HOME=/u01/oracle/user_projects/domains/$DOMAIN_NAME +echo "Domain Home is: " $DOMAIN_HOME mkdir -p $ORACLE_HOME/properties # Create Domain only if 1st execution -if [ $ADD_DOMAIN -eq 0 ]; then +if [ ! -e ${DOMAIN_HOME}/servers/${ADMIN_NAME}/logs/${ADMIN_NAME}.log ]; then + echo "Create Domain" PROPERTIES_FILE=/u01/oracle/properties/domain.properties if [ ! -e "$PROPERTIES_FILE" ]; then echo "A properties file with the username and password needs to be supplied." @@ -59,16 +56,20 @@ if [ $ADD_DOMAIN -eq 0 ]; then # Create an empty domain wlst.sh -skipWLSModuleScanning -loadProperties $PROPERTIES_FILE /u01/oracle/create-wls-domain.py - mkdir -p ${DOMAIN_HOME}/servers/AdminServer/security/ - echo "username=${USER}" >> $DOMAIN_HOME/servers/AdminServer/security/boot.properties - echo "password=${PASS}" >> $DOMAIN_HOME/servers/AdminServer/security/boot.properties + mkdir -p ${DOMAIN_HOME}/servers/${ADMIN_NAME}/security/ + chmod -R g+w ${DOMAIN_HOME} + echo "username=${USER}" >> $DOMAIN_HOME/servers/${ADMIN_NAME}/security/boot.properties + echo "password=${PASS}" >> $DOMAIN_HOME/servers/${ADMIN_NAME}/security/boot.properties ${DOMAIN_HOME}/bin/setDomainEnv.sh fi # Start Admin Server and tail the logs ${DOMAIN_HOME}/startWebLogic.sh -touch ${DOMAIN_HOME}/servers/AdminServer/logs/AdminServer.log -tail -f ${DOMAIN_HOME}/servers/AdminServer/logs/AdminServer.log & +if [ -e ${DOMAIN_HOME}/servers/${ADMIN_NAME}/logs/${ADMIN_NAME}.log ]; then + echo "${DOMAIN_HOME}/servers/${ADMIN_NAME}/logs/${ADMIN_NAME}.log" +fi +touch ${DOMAIN_HOME}/servers/${ADMIN_NAME}/logs/${ADMIN_NAME}.log +tail -f ${DOMAIN_HOME}/servers/${ADMIN_NAME}/logs/${ADMIN_NAME}.log childPID=$! wait $childPID diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/get_healthcheck_url.sh b/smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/get_healthcheck_url.sh new file mode 100755 index 000000000..4a2feef44 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/container-scripts/get_healthcheck_url.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# +#Copyright (c) 2020, Oracle and/or its affiliates. +# +#Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +if [ "$ADMINISTRATION_PORT_ENABLED" = "true" ] ; then + echo "https://{localhost:$ADMINISTRATION_PORT}/weblogic/ready" ; +else + echo "http://{localhost:$ADMIN_LISTEN_PORT}/weblogic/ready" ; +fi diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip.download b/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip.download new file mode 100644 index 000000000..b64667e26 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip.download @@ -0,0 +1,5 @@ +# Download WebLogic Server Generic Installer 12.2.1.4 +# +# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html +# +650109d90ab3da8f7a64b24a98e072b3 fmw_12.2.1.4.0_wls_lite_Disk1_1of1.zip diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip.download b/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip.download new file mode 100644 index 000000000..2fd58b5e8 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip.download @@ -0,0 +1,5 @@ +# Download WebLogic Server Quick Installer 12.2.1.4 +# +# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html +# +8f88d91600ecb6826a91a3b72f832c6a fmw_12.2.1.4.0_wls_quick_Disk1_1of1.zip diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip.download b/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip.download new file mode 100644 index 000000000..9d4e14a67 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip.download @@ -0,0 +1,5 @@ +# Download WebLogic Server Slim Installer 12.2.1.4 +# +# - http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html +# +df55639e00817308be249af5aa602bfb fmw_12.2.1.4.0_wls_quick_slim_Disk1_1of1.zip diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/install.file b/smp-docker/images/oracle/weblogic-12.2.1.4/install.file similarity index 76% rename from smp-docker/images/oracle/weblogic-12.2.1.3/install.file rename to smp-docker/images/oracle/weblogic-12.2.1.4/install.file index 23fdba63a..0ca964dbf 100644 --- a/smp-docker/images/oracle/weblogic-12.2.1.3/install.file +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/install.file @@ -1,4 +1,4 @@ -# Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014-2019 Oracle and/or its affiliates. All rights reserved. [ENGINE] #DO NOT CHANGE THIS. diff --git a/smp-docker/images/oracle/weblogic-12.2.1.3/oraInst.loc b/smp-docker/images/oracle/weblogic-12.2.1.4/oraInst.loc similarity index 100% rename from smp-docker/images/oracle/weblogic-12.2.1.3/oraInst.loc rename to smp-docker/images/oracle/weblogic-12.2.1.4/oraInst.loc diff --git a/smp-docker/images/oracle/weblogic-12.2.1.4/properties/domain.properties b/smp-docker/images/oracle/weblogic-12.2.1.4/properties/domain.properties new file mode 100644 index 000000000..e4db42348 --- /dev/null +++ b/smp-docker/images/oracle/weblogic-12.2.1.4/properties/domain.properties @@ -0,0 +1,2 @@ +username=myweblogicuser +password=welcome1 diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/Dockerfile b/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/Dockerfile deleted file mode 100644 index 2acf724ef..000000000 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/Dockerfile +++ /dev/null @@ -1,76 +0,0 @@ -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. -# -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This Dockerfile extends the Oracle WebLogic image by creating a sample domain. -# -# Util scripts are copied into the image enabling users to plug NodeManager -# automatically into the AdminServer running on another container. -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Put all downloaded files in the same directory as this Dockerfile -# Run: -# $ sudo docker build -t 12213-domain-home-image -# -# Pull base image -# --------------- -FROM oracle/weblogic:12.2.1.3-developer - -# Maintainer -# ---------- -MAINTAINER Monica Riccelli <monica.riccelli@oracle.com> - -ARG CUSTOM_DOMAIN_NAME="${CUSTOM_DOMAIN_NAME:-domain1}" -ARG CUSTOM_ADMIN_PORT="${CUSTOM_ADMIN_PORT:-7001}" -ARG CUSTOM_MANAGED_SERVER_PORT="${CUSTOM_MANAGED_SERVER_PORT:-8001}" -ARG CUSTOM_DEBUG_PORT="${CUSTOM_DEBUG_PORT:-8453}" -ARG CUSTOM_ADMIN_NAME="${CUSTOM_ADMIN_NAME:-admin-server}" -ARG CUSTOM_ADMIN_HOST="${CUSTOM_ADMIN_HOST:-wlsadmin}" -ARG CUSTOM_CLUSTER_NAME="${CUSTOM_CLUSTER_NAME:-DockerCluster}" - -# WLS Configuration -# --------------------------- -ENV ORACLE_HOME=/u01/oracle \ - PROPERTIES_FILE_DIR="/u01/oracle/properties" \ - DOMAIN_NAME="${CUSTOM_DOMAIN_NAME}" \ - DOMAIN_HOME="/u01/oracle/user_projects/domains/${CUSTOM_DOMAIN_NAME}" \ - ADMIN_PORT="${CUSTOM_ADMIN_PORT}" \ - ADMIN_NAME="${CUSTOM_ADMIN_NAME}" \ - ADMIN_HOST="${CUSTOM_ADMIN_HOST}" \ - CLUSTER_NAME="${CUSTOM_CLUSTER_NAME}" \ - MANAGED_SERVER_PORT="${CUSTOM_MANAGED_SERVER_PORT}" \ - MANAGED_SERV_NAME="${MANAGED_SERV_NAME}" \ - DEBUG_PORT="8453" \ - PATH=$PATH:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:${DOMAIN_HOME}:${DOMAIN_HOME}/bin:/u01/oracle - -# Add files required to build this image -COPY container-scripts/* /u01/oracle/ - -#Create directory where domain will be written to -USER root -RUN chmod +xw /u01/oracle/*.sh && \ - chmod +xw /u01/oracle/*.py && \ - mkdir -p ${PROPERTIES_FILE_DIR} && \ - chown -R oracle:oracle ${PROPERTIES_FILE_DIR} && \ - mkdir -p $DOMAIN_HOME && \ - chown -R oracle:oracle $DOMAIN_HOME && \ - chmod -R a+xwr $DOMAIN_HOME - -COPY properties/docker-build/domain*.properties ${PROPERTIES_FILE_DIR}/ - -# Configuration of WLS Domain -RUN /u01/oracle/createWLSDomain.sh && \ - echo ". $DOMAIN_HOME/bin/setDomainEnv.sh" >> /u01/oracle/.bashrc && \ - chmod -R a+x $DOMAIN_HOME/bin/*.sh && \ - rm ${PROPERTIES_FILE_DIR}/*.properties - -# Expose ports for admin, managed server, and debug -EXPOSE $ADMIN_PORT $MANAGED_SERVER_PORT $DEBUG_PORT - -WORKDIR $DOMAIN_HOME - -# Define default command to start bash. -CMD ["startAdminServer.sh"] diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/README.md b/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/README.md deleted file mode 100644 index e9a731ed5..000000000 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/README.md +++ /dev/null @@ -1,92 +0,0 @@ -Example Image with a WebLogic Server Domain -============================================= -This Dockerfile extends the Oracle WebLogic image by creating a sample WebLogic Server 12.2.1.3 domain and cluster into a Docker image. - -A domain is created inside the image and utility scripts are copied into the image, enabling users to start an Administration Server and a Managed Server, each running in separate containers. - -**Note:** In this sample, the WebLogic Servers are configured with a blank listen address; when running JTA transactions, you must use a DNS server to configure the listen addresses to use DNS names. - -## Providing the Administration Server user name and password - - -**During Docker Build:** The user name and password must be supplied in the `domain_security.properties` file. The property file is located in the directory `docker-images/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker_build` in the HOST. This property file gets copied into the image directory `/u01/oracle/properties`. - -**During Docker Run:** The user name and password must be supplied in a `security.properties` file. The property file is located in a `docker-images/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker_run` directory in the HOST. On the Docker run command line, the `-v` option maps the property file into the image directory `/u01/oracle/properties`. - - -The security property files enable the scripts to configure the correct authentication for the WebLogic Administration Server and Managed Servers. The format of the `security.properties` and `domain_security.properties` files are key=value pairs, for example: - - username=myadminusername - password=myadminpassword - -**Note:** Oracle recommends that the `domain_security.properties` and `security.properties` files be deleted or secured after the container and the WebLogic Server are started so that the user name and password are not inadvertently exposed. - -## How to Build and Run -At build time, the `domain.properties` file is used to pass in the Docker arguments and configuration parameters for the WebLogic domain. - - -**During Docker Build:** The domain configuration parameters must be supplied in the `domain.properties` file. This file is located in the directory `properties/docker_build` in the HOST. This property file gets copied into the image directory `/u01/oracle/properties`. - - -The domain property file enables you to customize the parameters to configure the WebLogic domain. The format of the `domain.properties` are key=value pairs, for example: - - ADMIN_NAME=admin-server - ADMIN_HOST=wlsadmin - MANAGED_SERVER_NAME_BASE=managed-server - CONFIGURED_MANAGED_SERVER_COUNT=2 - CLUSTER_NAME=cluster-1 - DEBUG_FLAG=true - PRODUCTION_MODE_ENABLED=true - CLUSTER_TYPE=DYNAMIC - CLUSTER_NAME=cluster1 - -**NOTE:** Before invoking the build make sure you have built `oracle/weblogic:12.2.1.3-developer`. - - -Under the directory `docker-images/OracleWebLogic/samples/12213-domain-home-in-image/container_scripts` find the script `setEnv.sh`. This script extracts the following Docker arguments and passes them as a `--build-arg` to the Dockerfile. - - -* Domain Name: `DOMAIN_NAME` (default: `base_domain`) -* Admin Port: `ADMIN_PORT` (default: `7001`) -* Managed Server Port: `MANAGED_SERVER_PORT` (default: `8001`) -* Debug Port: `DEBUG_PORT` (default: `8453`) -* Database Port: `DB_PORT` (default: `1527`) -* Admin Server Name: `ADMIN_NAME` (default: `admin-server`) -* Admin Server Host: `ADMIN_HOST` (default: `wlsadmin`) -* Cluster Name: `CLUSTER_NAME` (default: `cluster1`) - -**NOTE:** The `DOMAIN_HOME` will be persisted in the image directory `/u01/oracle/user-projects/domains/$DOMAIN_NAME`. - -To build this sample, run: - - $ . container-scripts/setEnv.sh ./properties/docker-build/domain.properties - $ docker build $BUILD_ARG --force-rm=true -t 12213-domain-home-in-image . - - -**During Docker Run:** of the Administration and Managed Servers, the user name and password need to be passed in as well as some optional parameters. The property file is located in a `docker-images/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker_run` in the HOST. On the Docker run command line, add the `-v` option which maps the property file into the image directory `/u01/oracle/properties`. - - -To start the containerized Administration Server, run: - - $ docker run -d --name wlsadmin --hostname wlsadmin -p 7001:7001 \ - -v <HOST DIRECTORY TO PROPERTIES FILE>/properties/docker-run:/u01/oracle/properties \ - 12213-domain-home-in-image - -To start a containerized Managed Server (MS1) to self-register with the Administration Server above, run: - - $ docker run -d --name MS1 --link wlsadmin:wlsadmin -p 8001:8001 \ - -v <HOST DIRECTORY TO PROPERTIES FILE>/properties/docker-run:/u01/oracle/properties \ - -e MANAGED_SERV_NAME=managed-server1 12213-domain-home-in-image startManagedServer.sh - -To start a second Managed Server (MS2), run: - - $ docker run -d --name MS2 --link wlsadmin:wlsadmin -p 8002:8001 \ - -v <HOST DIRECTORY TO PROPERTIES FILE>/properties/docker-run:/u01/oracle/properties \ - -e MANAGED_SERV_NAME=managed-server2 12213-domain-home-in-image startManagedServer.sh - -The above scenario from this sample will give you a WebLogic domain with a cluster set up on a single host environment. - -You may create more containerized Managed Servers by calling the `docker` command above - -# Copyright -Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/build.sh b/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/build.sh deleted file mode 100755 index 3678ff1a4..000000000 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/build.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. -# -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. -# -# TAG_NAME - Tag the docker image with this name. This overrides the default of -# 12213-domain-home-in-imag:latest. -# -# There are three ways to tag the domain home image using this build script. -# -# . Do nothing and the image will be tagged with the default name. -# . Add an IMAGE_TAG variable to the properties file and allow the -# setEnv.sh to manage the tag. Overrides the default tag. -# . Set the TAG_NAME environment variable. Overrides the default tag. -# - - -# Determine the tag name for the resulting image using the value in the TAG_NAME. -# The setEnv.sh will set the TAG_NAME variable if the property is found in the -# properties file. This function should be called after the setEnv.sh is run -tag_name() { - tagName=${CUSTOM_IMAGE_TAG:-"12213-domain-home-in-image:latest"} - echo "CUSTOM_IMAGE_TAG ${tagName} " -} - -# The location where the script is running will be used as the Context for -# the docker build Dockerfile commands -set_context() { - scriptDir="$( cd "$( dirname "$0" )" && pwd )" - if [ ! -d "${scriptDir}" ]; then - echo "Unable to determine the working directory for the domain home in image sample" - echo "Using shell /bin/sh to determine and found ${scriptDir}" - clean_and_exit - fi - echo "Context for docker build is ${scriptDir}" -} - -set_context -. ${scriptDir}/container-scripts/setEnv.sh ${scriptDir}/properties/docker-build/domain.properties - -tag_name -docker build $BUILD_ARG -t ${tagName} ${scriptDir} diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/setEnv.sh b/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/setEnv.sh deleted file mode 100755 index 3b601e27d..000000000 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/setEnv.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. -# -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. - -BUILD_ARG='' -if [ "$#" -eq "0" ] - then - echo "A properties file with variable definitions should be supplied." - exit 1 - else - PROPERTIES_FILE=$1 - echo Export environment variables from the ${PROPERTIES_FILE} properties file - fi - -extract_env() { - env_value=`awk '{print $1}' $2 | grep ^$1= | cut -d "=" -f2` - if [ -n "$env_value" ]; then - env_arg=`echo "CUSTOM_$1=$env_value"` - echo " env_arg: $env_arg" - export $env_arg - fi -} - -set_env_arg(){ - extract_env $1 $2 - if [ -n "$env_arg" ]; then - BUILD_ARG="$BUILD_ARG --build-arg $env_arg" - fi -} - -# Set DOMAIN_NAME -set_env_arg DOMAIN_NAME ${PROPERTIES_FILE} - -# Set ADMIN_NAME -set_env_arg ADMIN_NAME ${PROPERTIES_FILE} - -# Set ADMIN_HOST -set_env_arg ADMIN_HOST ${PROPERTIES_FILE} - -# Set ADMIN_PORT -set_env_arg ADMIN_LISTEN_PORT ${PROPERTIES_FILE} - -# Set MANAGED_SERVER_PORT -set_env_arg MANAGEDSERVER_PORT ${PROPERTIES_FILE} - -# Set DEBUG_PORT -set_env_arg DEBUG_PORT ${PROPERTIES_FILE} - -# Set IMAGE_TAG -extract_env IMAGE_TAG ${PROPERTIES_FILE} - -# Set CLUSTER_NAME -set_env_arg CLUSTER_NAME ${PROPERTIES_FILE} - -export BUILD_ARG=$BUILD_ARG -echo BUILD_ARG=$BUILD_ARG diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/create-wls-domain.py b/smp-docker/images/weblogic-12.2-smp/container-scripts/create-wls-domain.py similarity index 73% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/create-wls-domain.py rename to smp-docker/images/weblogic-12.2-smp/container-scripts/create-wls-domain.py index e0bcdab15..0d485eec1 100644 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/create-wls-domain.py +++ b/smp-docker/images/weblogic-12.2-smp/container-scripts/create-wls-domain.py @@ -23,23 +23,22 @@ def getEnvVar(var): # This python script is used to create a WebLogic domain #domain_uid = DOMAIN_UID -server_port = int(os.environ.get("MANAGED_SERVER_PORT")) +server_port = int(MANAGED_SERVER_PORT) domain_path = os.environ.get("DOMAIN_HOME") cluster_name = CLUSTER_NAME print('cluster_name : [%s]' % cluster_name); admin_server_name = ADMIN_NAME -#admin_server_name_svc = os.environ.get("ADMIN_SERVER_NAME_SVC") -admin_port = int(os.environ.get("ADMIN_PORT")) -domain_name = os.environ.get("DOMAIN_NAME") +admin_port = int(ADMIN_PORT) +admin_https_port = int(ADMIN_HTTPS_PORT) +domain_name = DOMAIN_NAME t3_channel_port = int(T3_CHANNEL_PORT) t3_public_address = T3_PUBLIC_ADDRESS number_of_ms = int(CONFIGURED_MANAGED_SERVER_COUNT) cluster_type = CLUSTER_TYPE managed_server_name_base = MANAGED_SERVER_NAME_BASE -#managed_server_name_base_svc = MANAGED_SERVER_NAME_BASE_SVC -#domain_logs = DOMAIN_LOGS_DIR -#script_dir = CREATE_DOMAIN_SCRIPT_DIR production_mode_enabled = PRODUCTION_MODE_ENABLED +ksIdentityAlias = ADMIN_HOST +ksIdentityPassword = SERVER_TLS_KEYSTORE_PASS # Read the domain secrets from the common python file #execfile('%s/read-domain-secret.py' % script_dir) @@ -98,7 +97,6 @@ cmo.setPassword(password) # ============================================== setOption('OverwriteDomain', 'true') - # Create a cluster # ====================== cd('/') @@ -156,54 +154,6 @@ else: print('Done setting attributes for Dynamic Cluster: %s' % cluster_name); -# Create a Data Source -# ====================== -#cd('/') -#print('Configuring a Data Source: %s' % dsname); -#create(dsname, 'JDBCSystemResource') -#cd('/JDBCSystemResource/' + dsname + '/JdbcResource/' + dsname) -#cmo.setName(dsname) - -#cd('/JDBCSystemResource/' + dsname + '/JdbcResource/' + dsname) -#create('myJdbcDataSourceParams','JDBCDataSourceParams') -#cd('JDBCDataSourceParams/NO_NAME_0') -#set('JNDIName', java.lang.String(dsjndiname)) -#set('GlobalTransactionsProtocol', java.lang.String('None')) - -#cd('/JDBCSystemResource/' + dsname + '/JdbcResource/' + dsname) -#create('myJdbcDriverParams','JDBCDriverParams') -#cd('JDBCDriverParams/NO_NAME_0') -#set('DriverName', dsdriver) -#set('URL', dsurl) -#set('PasswordEncrypted', dspassword) -#set('UseXADataSourceInterface', 'false') - -#print 'create JDBCDriverParams Properties' -#create('myProperties','Properties') -#cd('Properties/NO_NAME_0') -#create('user','Property') -#cd('Property/user') -#set('Value', dsusername) - -#cd('../../') -#create('databaseName','Property') -#cd('Property/databaseName') -#set('Value', dsdbname) - -#print 'create JDBCConnectionPoolParams' -#cd('/JDBCSystemResource/' + dsname + '/JdbcResource/' + dsname) -#create('myJdbcConnectionPoolParams','JDBCConnectionPoolParams') -#cd('JDBCConnectionPoolParams/NO_NAME_0') -#set('TestTableName','SQL SELECT 1 FROM DUAL') -#set('InitialCapacity',int(dsinitalcapacity)) - -#print('Done setting attributes for Data Source: %s' % dsname); - -# Assign -# ====== -# Uncomment to target and enable the data source for the cluster -# assign('JDBCSystemResource', dsname, 'Target', cluster_name) - # Write Domain # ============ writeDomain(domain_path) @@ -217,6 +167,7 @@ if production_mode_enabled == "true": cmo.setProductionModeEnabled(true) else: cmo.setProductionModeEnabled(false) + updateDomain() closeDomain() print 'Domain Updated' diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/createWLSDomain.sh b/smp-docker/images/weblogic-12.2-smp/container-scripts/createWLSDomain.sh similarity index 95% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/createWLSDomain.sh rename to smp-docker/images/weblogic-12.2-smp/container-scripts/createWLSDomain.sh index ec83e4bab..9e33085c7 100755 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/createWLSDomain.sh +++ b/smp-docker/images/weblogic-12.2-smp/container-scripts/createWLSDomain.sh @@ -1,8 +1,8 @@ #!/bin/bash # -#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. +#Copyright (c) 2014, 2020, Oracle and/or its affiliates. # -#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. +#Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. #Define DOMAIN_HOME echo "Domain Home is: " $DOMAIN_HOME @@ -86,4 +86,4 @@ if [ -z "${PASS}" ]; then fi # Create domain -wlst.sh -skipWLSModuleScanning -loadProperties ${DOMAIN_PROPERTIES_FILE} -loadProperties ${SEC_PROPERTIES_FILE} /u01/oracle/create-wls-domain.py +wlst.sh -skipWLSModuleScanning -loadProperties ${DOMAIN_PROPERTIES_FILE} -loadProperties ${SEC_PROPERTIES_FILE} /u01/oracle/create-wls-domain.py \ No newline at end of file diff --git a/smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/datasource.properties.oracle b/smp-docker/images/weblogic-12.2-smp/container-scripts/datasource.properties.oracle similarity index 100% rename from smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/datasource.properties.oracle rename to smp-docker/images/weblogic-12.2-smp/container-scripts/datasource.properties.oracle diff --git a/smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/deploySMPToDomain.sh b/smp-docker/images/weblogic-12.2-smp/container-scripts/deploySMPToDomain.sh similarity index 100% rename from smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/deploySMPToDomain.sh rename to smp-docker/images/weblogic-12.2-smp/container-scripts/deploySMPToDomain.sh diff --git a/smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/ds-deploy.py b/smp-docker/images/weblogic-12.2-smp/container-scripts/ds-deploy.py similarity index 100% rename from smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/ds-deploy.py rename to smp-docker/images/weblogic-12.2-smp/container-scripts/ds-deploy.py diff --git a/smp-docker/images/weblogic-12.2-smp/container-scripts/functions/keystore.functions b/smp-docker/images/weblogic-12.2-smp/container-scripts/functions/keystore.functions new file mode 100644 index 000000000..1fcb1d504 --- /dev/null +++ b/smp-docker/images/weblogic-12.2-smp/container-scripts/functions/keystore.functions @@ -0,0 +1,305 @@ + + + +# +# Provides functions to help setup keystores that will be used in Docker images. +# + +# +# Downloads the certificate of an SSL server certificate into a file having the provided name. The ".pem" extension is +# automatically appended to the file name and the file will be created into the ${CERTIFICATES} location. +# +# Args: +# $1 - SSL server host and port, divided by the ':' character +# $2 - the name of the file into which to save the certificate +downloadSslCertificate() { + : "${CERTIFICATES:?Need to set CERTIFICATES non-empty}" + : "${1:?Please provide the SSL server host and port (i.e. host:port) as the first parameter}" + : "${2:?Please provide the certificate name as the second parameter (e.g. 'red_gw', 'be00000001')}" + + local serverHostAndPort="${1}" + local certificateName="${2}" + + echo "Downloading SSL certificate from ${serverHostAndPort} to the ${CERTIFICATES} location: certificateName=${certificateName}" + + keytool -printcert \ + -sslserver "${serverHostAndPort}" \ + -rfc 2>/dev/null >"${CERTIFICATES}"/"${certificateName}".pem +} + +# +# Checks whether a keystore entry exists in a keystore file. +# +# Args: +# $1 - keystore file name +# $2 - alias for the entry to be checked for its existence (e.g. 'red_gw', 'blue_gw') +# $3 - keystore password +# $4 - (optional) keystore type; "JKS" by default +containsKeystoreEntry() { + : "${1:?Please provide the keystore file name as the first parameter}" + : "${2:?Please provide the alias for the keystore entry as the second parameter (e.g. 'red_gw', 'blue_gw')}" + : "${3:?Please provide the keystore password as the third parameter}" + + local keystoreFileName="${1}" + local keystoreAlias="${2}" + local keystorePassword="${3}" + local keystoreType="${4:-JKS}" + + echo "Checking for the presence of the keystore entry ${keystoreAlias} inside keystore ${keystoreFileName}: \ +keystorePassword=${keystorePassword}, keystoreType=${keystoreType}" + + local result=$(keytool -list -alias "${keystoreAlias}" \ + -storetype "${keystoreType}" \ + -keystore "${keystoreFileName}" \ + -storepass "${keystorePassword}" \ + -rfc 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | wc -l) + + ((result > 0)) +} + +# +# Exports an entry from a keystore file to a certificate file. The certificate file will have the same name +# as the alias of the entry and will be exported to the ${CERTIFICATES} location, having a ".pem" extension. +# +# Args: +# $1 - keystore file name +# $2 - alias for the entry to be exported (e.g. 'red_gw', 'blue_gw') +# $3 - keystore password +# $4 - (optional) keystore type; "JKS" by default +exportCertificate() { + : "${CERTIFICATES:?Need to set CERTIFICATES non-empty}" + : "${1:?Please provide the keystore file name as the first parameter}" + : "${2:?Please provide the alias for the keystore entry as the second parameter (e.g. 'red_gw', 'blue_gw')}" + : "${3:?Please provide the keystore password as the third parameter}" + + local keystoreFileName="${1}" + local keystoreAlias="${2}" + local keystorePassword="${3}" + local keystoreType="${4:-JKS}" + + echo "Exporting entry from ${keystoreFileName}: keystoreAlias=${keystoreAlias}, keystorePassword=${keystorePassword}, \ +keystoreType=${keystoreType}" + + keytool -exportcert \ + -alias "${keystoreAlias}" \ + -file "${CERTIFICATES}/${keystoreAlias}.pem" \ + -storetype "${keystoreType}" \ + -keystore "${keystoreFileName}" \ + -storepass "${keystorePassword}" \ + -rfc \ + -v 2>/dev/null +} + +# +# Imports an entry into a keystore file from an existing certificate file. The certificate file MUST have the same name +# as the alias of the entry to be imported and MUST be present in the ${CERTIFICATES} location, having a ".pem" extension. +# +# Args: +# $1 - keystore file name +# $2 - alias for the entry to be imported (e.g. 'red_gw', 'blue_gw') +# $3 - keystore password +# $4 - private key password +# $5 - (optional) keystore type; "JKS" by default +importCertificate() { + : "${CERTIFICATES:?Need to set CERTIFICATES non-empty}" + : "${1:?Please provide the keystore file name as the first parameter}" + : "${2:?Please provide the alias for the keystore entry as the second parameter (e.g. 'red_gw', 'blue_gw')}" + : "${3:?Please provide the keystore password as the third parameter}" + : "${4:?Please provide the private key password for the keystore entry as the fourth parameter}" + + local keystoreFileName="${1}" + local keystoreAlias="${2}" + local keystorePassword="${3}" + local privateKeyPassword="${4}" + local keystoreType="${5:-JKS}" + + echo "Importing entry into ${keystoreFileName}: keystoreAlias=${keystoreAlias}, keystorePassword=${keystorePassword}, \ +privateKeyPassword=${privateKeyPassword}, keystoreType=${keystoreType}" + + keytool -importcert \ + -alias "${keystoreAlias}" \ + -file "${CERTIFICATES}/${keystoreAlias}.pem" \ + -keypass "${privateKeyPassword}" \ + -noprompt \ + -storetype "${keystoreType}" \ + -keystore "${keystoreFileName}" \ + -storepass "${keystorePassword}" \ + -v 2>/dev/null +} + +# +# Imports a single or all of the entries from a source keystore to a destination keystore. The source and destination +# keystores must be in the same directory. +# +# If the source alias is missing, all the entries are imported from the source keystore; otherwise, only a single entry +# is imported. If a destination alias is not provided, then source alias is used as the destination alias. +# +# Unless otherwise specified, the source and destination keystore are by default of type "JKS". +# +# Args: +# $1 - source keystore file name +# $2 - destination keystore file name +# $3 - source keystore password +# $4 - destination keystore password +# $5 - source private key password +# $6 - destination private key password +# $7 - (optional) source alias for the entry to be imported (e.g. 'red_gw', 'blue_gw'); +# $8 - (optional) destination alias for the entry to be imported (e.g. 'red_gw', 'blue_gw'); +# $9 - (optional) source keystore type; "JKS" by default +# $10 - (optional) destination keystore type; "JKS" by default +importKeystore() { + : "${1:?Please provide the source keystore file name as the first parameter}" + : "${2:?Please provide the destination keystore file name as the second parameter}" + : "${3:?Please provide the source keystore password as the third parameter}" + : "${4:?Please provide the destination keystore password as the fourth parameter}" + : "${5:?Please provide the private key password for the source keystore entry as the fifth parameter}" + : "${6:?Please provide the private key password for the destination keystore entry as the sixth parameter}" + + local srcKeystoreFileName="${1}" + local destKeystoreFileName="${2}" + local srcKeystorePassword="${3}" + local destKeystorePassword="${4}" + local sourcePrivateKeyPassword="${5}" + local destinationPrivateKeyPassword="${6}" + local sourceKeystoreAlias="${7}" + local destinationKeystoreAlias="${8}" + local sourceKeystoreType="${9:-JKS}" + local destinationKeystoreType="${10:-JKS}" + + echo "Importing keystore entries from ${srcKeystoreFileName} to ${destKeystoreFileName}: \ +srcKeystorePassword=${srcKeystorePassword}, destKeystorePassword=${destKeystorePassword}, \ +sourcePrivateKeyPassword=${sourcePrivateKeyPassword}, destinationPrivateKeyPassword=${destinationPrivateKeyPassword}, \ +sourceKeystoreAlias=${sourceKeystoreAlias}, destinationKeystoreAlias=${destinationKeystoreAlias}, \ +sourceKeystoreType=${sourceKeystoreType}, destinationKeystoreType=${destinationKeystoreType}" + + keytool -importkeystore \ + -srckeystore "${srcKeystoreFileName}" \ + -destkeystore "${destKeystoreFileName}" \ + -srcstorepass "${srcKeystorePassword}" \ + -deststorepass "${destKeystorePassword}" \ + -srckeypass "${sourcePrivateKeyPassword}" \ + -destkeypass "${destinationPrivateKeyPassword}" \ + -noprompt \ + ${sourceKeystoreAlias:+-srcalias "${sourceKeystoreAlias}"} \ + ${destinationKeystoreAlias:+-destalias "${destinationKeystoreAlias}"} \ + -srcstoretype "${sourceKeystoreType}" \ + -deststoretype "${destinationKeystoreType}" \ + -v 2>/dev/null +} + +# +# Removes an existing entry from a keystore file. +# +# Args: +# $1 - keystore file name +# $2 - alias for the entry to be removed (e.g. 'red_gw', 'blue_gw') +# $3 - keystore password +# $4 - (optional) keystore type; "JKS" by default +removeKeystoreEntry() { + : "${1:?Please provide the keystore file name as the first parameter}" + : "${2:?Please provide the alias for the keystore entry as the second parameter (e.g. 'red_gw', 'blue_gw')}" + : "${3:?Please provide the keystore password as the third parameter}" + + local keystoreFileName="${1}" + local keystoreAlias="${2}" + local keystorePassword="${3}" + local keystoreType="${4:-JKS}" + + echo "Removing entry from ${keystoreFileName}: keystoreAlias=${keystoreAlias}, keystorePassword=${keystorePassword}, \ +keystoreType=${keystoreType}" + + keytool -delete \ + -alias "${keystoreAlias}" \ + -storetype "${keystoreType}" \ + -keystore "${keystoreFileName}" \ + -storepass "${keystorePassword}" \ + -v 2>/dev/null +} + +# +# Creates a new keystore. The name of the keystore will be "gateway_keystore.jks" unless the optional domain name +# argument is provided - in this case the name of the keystore will be "gateway_keystore_DOMAIN.jks" -. +# +# Args: +# $1 - alias for the keystore entry (e.g. 'red_gw', 'blue_gw') +# $2 - keystore password +# $3 - private key password +# $4 - domain name to use as prefix for the keystore files; empty for the default domain +generateKeyStore() { + : "${CERTIFICATES:?Need to set CERTIFICATES non-empty}" + : "${1:?Please provide the alias of the keystore entry as the first parameter (e.g. 'red_gw', 'blue_gw')}" + : "${2:?Please provide the keystore password as the second parameter}" + : "${3:?Please provide the private key password as the third parameter}" + : "${4:?Please provide the domain name as the fourth parameter}" + + local keystoreAlias="${1}" + local keystorePassword="${2}" + local privateKeyPassword="${3}" + local domainName="${4}" + local keystoreFileName="${domainName}-gateway_keystore.jks" + + echo "Generating keystore ${keystoreFileName} using: keystoreAlias=${keystoreAlias}, \ +keystorePassword=${keystorePassword}, privateKeyPassword=${privateKeyPassword}, domainName=${domainName}" + + if containsKeystoreEntry "${keystoreFileName}" "${keystoreAlias}" "${keystorePassword}"; then + echo "Cert with keystoreAlias=${keystoreAlias} already exists in ${keystoreFileName}. Deleting keystore entry before creating it again!" + removeKeystoreEntry "${keystoreFileName}" "${keystoreAlias}" "${keystorePassword}" + fi + + keytool -genkeypair \ + -dname "C=BE,O=eDelivery,CN=${keystoreAlias}" \ + -alias "${keystoreAlias}" \ + -keyalg RSA \ + -keysize 2048 \ + -keypass "${privateKeyPassword}" \ + -validity 3652 \ + -storetype JKS \ + -keystore "${keystoreFileName}" \ + -storepass "${keystorePassword}" \ + -v 2>/dev/null + + if [ -f "${CERTIFICATES}/${keystoreAlias}.pem" ]; then + echo "The certificate ${CERTIFICATES}/${keystoreAlias}.pem shouldn't already exist" + exit 1 + fi + + exportCertificate "${keystoreFileName}" "${keystoreAlias}" "${keystorePassword}" + + chmod a+w "${keystoreFileName}" +} + +# +# Imports an existing public-key certificate into a truststore. If the truststore is missing, it will be created. The +# name of the truststore chosen as destination will be "gateway_truststore.jks" unless the optional domain name +# argument is provided - in this case the name of the truststore used will be "gateway_truststore_DOMAIN.jks" -. +# +# Args: +# $1 - alias for the destination entry (e.g. 'red_gw', 'blue_gw') +# $2 - keystore password for the destination truststore +# $3 - private key password for both the destination entry +# $4 - domain name to use as prefix for the truststore file; empty for the default domain +updateTrustStore() { + : "${CERTIFICATES:?Need to set CERTIFICATES non-empty}" + : "${1:?Please provide the alias for both the source and destination keystore entries as the first parameter (e.g. 'red_gw', 'blue_gw')}" + : "${2:?Please provide the keystore password for both the source and destination keystores as the second parameter}" + : "${3:?Please provide the private key password for both the source and destination keystore entries as the third parameter}" + : "${4:?Please provide the domain name as the fourth parameter}" + + local keystoreAlias="${1}" + local keystorePassword="${2}" + local privateKeyPassword="${3}" + local domainName="${4}" + local truststoreFileName="${domainName}-gateway_truststore.jks" + + echo "Updating truststore ${truststoreFileName} using: keystoreAlias=${keystoreAlias}, \ +keystorePassword=${keystorePassword}, privateKeyPassword=${privateKeyPassword}, domainName=${domainName}" + + if containsKeystoreEntry "${truststoreFileName}" "${keystoreAlias}" "${keystorePassword}"; then + echo "Cert with keystoreAlias=${keystoreAlias} already exists in ${truststoreFileName}. Deleting truststore entry before importing certificate!" + removeKeystoreEntry "${truststoreFileName}" "${keystoreAlias}" "${keystorePassword}" + fi + + importCertificate "${truststoreFileName}" "${keystoreAlias}" "${keystorePassword}" "${privateKeyPassword}" + + chmod a+w "${truststoreFileName}" +} diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/shutdown-servers.py b/smp-docker/images/weblogic-12.2-smp/container-scripts/shutdown-servers.py similarity index 100% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/shutdown-servers.py rename to smp-docker/images/weblogic-12.2-smp/container-scripts/shutdown-servers.py diff --git a/smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/smp-app-deploy.py b/smp-docker/images/weblogic-12.2-smp/container-scripts/smp-app-deploy.py similarity index 100% rename from smp-docker/images/weblogic-12.2.1.3-smp/container-scripts/smp-app-deploy.py rename to smp-docker/images/weblogic-12.2-smp/container-scripts/smp-app-deploy.py diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/startAdminServer.sh b/smp-docker/images/weblogic-12.2-smp/container-scripts/startAdminServer.sh similarity index 100% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/startAdminServer.sh rename to smp-docker/images/weblogic-12.2-smp/container-scripts/startAdminServer.sh diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/startManagedServer.sh b/smp-docker/images/weblogic-12.2-smp/container-scripts/startManagedServer.sh similarity index 98% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/startManagedServer.sh rename to smp-docker/images/weblogic-12.2-smp/container-scripts/startManagedServer.sh index c6335cffe..471b0e09d 100755 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/startManagedServer.sh +++ b/smp-docker/images/weblogic-12.2-smp/container-scripts/startManagedServer.sh @@ -40,7 +40,7 @@ fi #Set Java Options JAVA_OPTIONS=`awk '{print $1}' ${SEC_PROPERTIES_FILE} | grep ^JAVA_OPTIONS= | cut -d "=" -f2` -if [ -z "${JAVA_OPTIONS}" ]; then +if [ -z "${JAVA_OPTIONS}" ]; then JAVA_OPTIONS="-Dweblogic.StdoutDebugEnabled=false" fi export JAVA_OPTIONS=${JAVA_OPTIONS} diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/waitForAdminServer.sh b/smp-docker/images/weblogic-12.2-smp/container-scripts/waitForAdminServer.sh similarity index 72% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/waitForAdminServer.sh rename to smp-docker/images/weblogic-12.2-smp/container-scripts/waitForAdminServer.sh index e95a65c50..24da5874d 100755 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/waitForAdminServer.sh +++ b/smp-docker/images/weblogic-12.2-smp/container-scripts/waitForAdminServer.sh @@ -7,10 +7,10 @@ # This script will wait until Admin Server is available. # There is no timeout! # -echo "Waiting for WebLogic Admin Server on $ADMIN_HOST:$ADMIN_PORT to become available..." +echo "Waiting for WebLogic Admin Server on $WL_ADMIN_HOST:$WL_ADMIN_PORT to become available..." while : do - (echo > /dev/tcp/$ADMIN_HOST/$ADMIN_PORT) >/dev/null 2>&1 + (echo > /dev/tcp/$WL_ADMIN_HOST/$WL_ADMIN_PORT) >/dev/null 2>&1 available=$? if [[ $available -eq 0 ]]; then echo "WebLogic Admin Server is now available. Proceeding..." diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/wlst b/smp-docker/images/weblogic-12.2-smp/container-scripts/wlst similarity index 100% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/container-scripts/wlst rename to smp-docker/images/weblogic-12.2-smp/container-scripts/wlst diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/properties/docker-build/domain.properties b/smp-docker/images/weblogic-12.2-smp/properties/docker-build/domain.properties similarity index 88% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/properties/docker-build/domain.properties rename to smp-docker/images/weblogic-12.2-smp/properties/docker-build/domain.properties index a0a7049c6..9f8cc3296 100644 --- a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/properties/docker-build/domain.properties +++ b/smp-docker/images/weblogic-12.2-smp/properties/docker-build/domain.properties @@ -1,5 +1,6 @@ DOMAIN_NAME=domain1 ADMIN_PORT=7001 +ADMIN_HTTPS_PORT=7002 ADMIN_NAME=admin-server ADMIN_HOST=wlsadmin MANAGED_SERVER_PORT=8001 @@ -14,4 +15,4 @@ CLUSTER_TYPE=DYNAMIC JAVA_OPTIONS=-Dweblogic.StdoutDebugEnabled=false T3_CHANNEL_PORT=30012 T3_PUBLIC_ADDRESS=kubernetes -IMAGE_TAG=domain-home-in-image:12.2.1.3 +SERVER_TLS_KEYSTORE_PASS=test123 \ No newline at end of file diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/properties/docker-build/domain_security.properties b/smp-docker/images/weblogic-12.2-smp/properties/docker-build/domain_security.properties similarity index 100% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/properties/docker-build/domain_security.properties rename to smp-docker/images/weblogic-12.2-smp/properties/docker-build/domain_security.properties diff --git a/smp-docker/images/oracle/weblogic-12213-domain-home-in-image/properties/docker-run/security.properties b/smp-docker/images/weblogic-12.2-smp/properties/docker-run/security.properties similarity index 100% rename from smp-docker/images/oracle/weblogic-12213-domain-home-in-image/properties/docker-run/security.properties rename to smp-docker/images/weblogic-12.2-smp/properties/docker-run/security.properties diff --git a/smp-docker/images/weblogic-12.2.1.3-smp/Dockerfile b/smp-docker/images/weblogic-12.2.1.3-smp/Dockerfile deleted file mode 100644 index b480d24e3..000000000 --- a/smp-docker/images/weblogic-12.2.1.3-smp/Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -# LICENSE UPL 1.0 -# -# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This Dockerfile extends the Oracle WebLogic image built under 12213-doma-home-in-image. -# -# It will deploy any package defined in APP_PKG_FILE. -# into the DOMAIN_HOME with name defined in APP_NAME -# -# HOW TO BUILD THIS IMAGE -# ----------------------- -# Run: -# $ docker build -t weblogic-smp . -# -# Pull base image -# --------------- -FROM oracle/12213-domain-home-in-image - -# Define variable -ARG SMP_VERSION -ENV APP_VERSION=$SMP_VERSION -ENV LC_ALL=en_US.UTF-8 -ENV LANG="en_US.UTF-8" -ENV LANGUAGE="en_US" - - - - -# Copy files and deploy application in WLST Offline mode -COPY container-scripts/* /u01/oracle/ -COPY smp.war /u01/oracle/ - -RUN /u01/oracle/deploySMPToDomain.sh && \ - wlst -loadProperties /u01/oracle/datasource.properties.oracle /u01/oracle/ds-deploy.py \ - # set enforce-valid-basic-auth-credentials false to allow basic authentication for rest services - && sed -i -e "s/<\/security-configuration>/ <enforce-valid-basic-auth-credentials>false<\/enforce-valid-basic-auth-credentials>\n<\/security-configuration>/g" "/u01/oracle/user_projects/domains/domain1/config/config.xml" - - - -# Define default command to start bash. -CMD ["startAdminServer.sh"] diff --git a/smp-docker/images/weblogic-12.2.1.3-smp/README.md b/smp-docker/images/weblogic-12.2.1.3-smp/README.md deleted file mode 100644 index 63dee3288..000000000 --- a/smp-docker/images/weblogic-12.2.1.3-smp/README.md +++ /dev/null @@ -1,45 +0,0 @@ -Example of Image with WLS Domain -================================ -This Dockerfile extends the Oracle WebLogic image built under 12213-domain-home-in-image and deploy the sample application to the cluster. - -This sample deploys a simple, one-page web application contained in a ZIP archive. This archive needs to be built (one time only) before building the Docker image. - - $ ./build-archive.sh - -# How to build and run -To deploy an application to a domain where the domain home is inside the image you extend the image `12213-domain-home-in-image` and using WLST offline you deploy the sample application. First make sure you have built sample WebLogic domain image inside **12213-domain-home-in-image**. Now to build this sample, run: - - $ docker build --build-arg APPLICATION_NAME=sample --build-arg APPLICATION_PKG=archive.zip -t 12213-domain-with-app . - -# How to run the domain -Follow the instructions in the sample `OracleWebLogic/samples/12213-domain-home-in-image` to define your domain properties in the domain.properties and domain-security.properties files. - -To start the containerized Administration Server, run: - - $ docker run -d --name wlsadmin --hostname wlsadmin -p 7001:7001 \ - -v <HOST DIRECTORY TO PROPERTIES FILE>/properties/docker-run:/u01/oracle/properties \ - 12213-domain-with-app - -To start a containerized Managed Server (MS1) to self-register with the Administration Server above, run: - - $ docker run -d --name MS1 --link wlsadmin:wlsadmin -p 8001:8001 \ - -v <HOST DIRECTORY TO PROPERTIES FILE>/properties/docker-run:/u01/oracle/properties \ - -e MANAGED_SERV_NAME=managed-server1 12213-domain-with-app startManagedServer.sh - -To start a second Managed Server (MS2), run: - - $ docker run -d --name MS2 --link wlsadmin:wlsadmin -p 8002:8001 \ - -v <HOST DIRECTORY TO PROPERTIES FILE>/properties/docker-run:/u01/oracle/properties \ - -e MANAGED_SERV_NAME=managed-server2 12213-domain-with-app startManagedServer.sh - - -Run the WLS Administration Console: - -In your browser, enter `https://localhost:7001/console`. - -Run the sample application: - -To access the sample application, in your browser enter `http://localhost:7001/sample`. - -# Copyright -Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved. -- GitLab