diff --git a/OracleWebLogic/samples/12213-domain-home-in-image-wdt/README.md b/OracleWebLogic/samples/12213-domain-home-in-image-wdt/README.md index 9f585abcd1..8e124b78a6 100644 --- a/OracleWebLogic/samples/12213-domain-home-in-image-wdt/README.md +++ b/OracleWebLogic/samples/12213-domain-home-in-image-wdt/README.md @@ -8,27 +8,31 @@ The Dockerfile uses the `createDomain` script from the Oracle WebLogic Deploy To ### WDT Model File and Archive -This sample includes a basic WDT model, `simple-topology.yaml`, that describes the intended configuration of the domain within the Docker image. WDT models can be created and modified using a text editor, following the format and rule described in the README file for the WDT project in GitHub. +This sample includes a basic WDT model, `simple-topology.yaml`, that describes the intended configuration of the domain within the Docker image. WDT models can be created and modified using a text editor, following the format and rules described in the README file for the WDT project in GitHub. -Another option is to use the WDT `discoverDomain` tool to create a model. This process is also described in the WDT project's README file. A user can use the tool to analyze an existing domain, and create a model based on its configuration. The user may choose to customize the model before using it to create a new Docker image. +Another option is to use the WDT `discoverDomain` tool to create a model. This process is also described in the WDT project README file. A user can use the tool to analyze an existing domain, and create a model based on its configuration. The user may choose to customize the model before using it to create a new Docker image. -The sample model is accompanied by a properties file whose values can be changed to customize a domain. The model's variable tokens are replaced with values from 'simple-topology.properties' when building the docker image. The properties files can be created and modified using a text editor. Select variables in the properties file are used by the Dockerfile during the build to persist ENV variables and expose ports in the image. - -Care should be taken to secure the credentials that are present in the model. The ADMIN credential attributes in the sample model have a file token referencing a special property file. Each special property file must only contain a single property and can be created and modified using a text editor. The sample includes the files adminuser.properties and the adminpass.properties in the properties/docker_build directory. +The sample model is accompanied by a properties file whose values can be changed to customize a domain. The model's variable tokens are replaced with values from 'simple-topology.properties' when building the Docker image. The properties files can be created and modified using a text editor. Select variables in the properties file are used by the Dockerfile during the build to persist ENV variables and expose ports in the image. + +Care should be taken to secure the credentials that are present in the model. The ADMIN credential attributes in the sample model have a file token referencing a special property file. Each special property file must only contain a single property and can be created and modified using a text editor. The sample includes the files `adminuser.properties` and the `adminpass.properties` in the `properties/docker_build` directory. See the README file for more information on using property and file tokens in the WDT model. -The ADMIN credentials are necessary to start the Admin or Managed Server in a docker container. The sample provides security.properties in the properties/docker-run directory. This file contains the admin credentials and additional properties used to customize the Weblogic Server start. +The ADMIN credentials are necessary to start the Administration or Managed Server in a Docker container. The sample provides `security.properties` in the `properties/docker-run` directory. This file contains the admin credentials and additional properties used to customize the WebLogic Server start. -Note: Oracle recommends that the adminpass.properties, adminuser.properties and security.properties files be deleted or secured after the image is built and the WebLogic Server are started so that the user name and password are not inadvertently exposed. +**Note**: Oracle recommends that the `adminpass.properties`, `adminuser.properties`, and `security.properties` files be deleted or secured after the image is built and the WebLogic Server is started so that the user name and password are not inadvertently exposed. Domain creation may require the deployment of applications and libraries. This is accomplished by creating a ZIP archive with a specific structure, then referencing those items in the model. This sample creates and deploys a simple ZIP archive containing a small application WAR. That archive is built in the sample directory prior to creating the Docker image. When the WDT `discoverDomain` tool is used on an existing domain, a ZIP archive is created containing any necessary applications and libraries. The corresponding configuration for those applications and libraries is added to the model. -### How to Build and Run +## How to Build and Run + + +**NOTE:** The image is based on a WebLogic Server image in the docker-images project: `oracle/weblogic:12.2.1.3-developer`. Build that image to your local repository before building this sample. + +The WebLogic Deploy Tool installer is required to build this image. Add `weblogic-deploy.zip` to the sample directory. The Docker sample requires a minimum release of weblogic-deploy-tooling-0.14. This release uses the new command argument `-domain_home` on the `createDomain` step. This argument allows a domain home path with a domain folder name that can be different from the domain name in the model file. -The WebLogic Deploy Tool installer is required to build this image. Add `weblogic-deploy.zip` to the sample directory. The docker sample requires a minimum release of weblogic-deploy-tooling-0.14. This release uses the new command argument -domain_home on the createDomain step. This argument allows a Domain Home path with a domain folder name that can be different from the Domain name in the model file. $ wget https://github.com/oracle/weblogic-deploy-tooling/releases/download/weblogic-deploy-tooling-0.14/weblogic-deploy.zip @@ -40,10 +44,9 @@ This sample deploys a simple, one-page web application contained in a ZIP archiv $ ./build-archive.sh -The sample requires the Admin Host, Admin Port and Admin Name. It also requires the Managed Server port and the domain Debug - Port. The ports will be EXPOSED through Docker. The other arguments are persisted in the image to be used when running a - container. If an attribute is not provided as a --build-arg on the build command, the following defaults are set. +The sample requires the Admin Host, Admin Port and Admin Name. It also requires the Managed Server port and the domain debug port. The ports will be EXPOSED through Docker. The other arguments are persisted in the image to be used when running a container. If an attribute is not provided as a `--build-arg` on the `build` command, the following defaults are set. +``` CUSTOM_ADMIN_NAME = admin-server The value is persisted to the image as ADMIN_NAME @@ -61,8 +64,9 @@ CUSTOM_DEBUG_PORT = 8453 CUSTOM_DOMAIN_NAME = base_domain The value is persisted to the image as DOMAIN_NAME +``` -To build this sample taking the defaults, run: +To build this sample keeping the defaults, run: $ docker build \ --build-arg WDT_MODEL=simple-topology.yaml \ @@ -71,16 +75,16 @@ To build this sample taking the defaults, run: --force-rm=true \ -t 12213-domain-home-in-image-wdt . -This will use the model, variable and archive files in the sample directory. +This will use the model, variable, and archive files in the sample directory. -This sample provides a script which will read the model variable file and parse the domain, admin and managed server information - into a string of --build-arg statements. This build arg string is exported as environment variable BUILD_ARG. - The sample script specifically parses the sample variable file. Use it as an example to parse a custom variable file. - This will insure that the values docker exposes and persists in the image are the same values configured in the domain. +This sample provides a script which will read the model variable file and parse the domain, Administration and Managed Server information + into a string of `--build-arg` statements. This build `arg` string is exported as the environment variable `BUILD_ARG`. + The sample script specifically parses the sample variable file. Use it as an example to parse a custom variable file. + This will insure that the values Docker exposes and persists in the image are the same values configured in the domain. To parse the sample variable file and build the sample, run: - $ container-scripts/setEnv.sh properties/docker-build/domain.properties + $ container-scripts/setEnv.sh properties/docker-build/domain.properties $ docker build \ $BUILD_ARG \ diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/README.md b/OracleWebLogic/samples/12213-domain-home-in-image/README.md index f08f30923e..da42eddc3a 100644 --- a/OracleWebLogic/samples/12213-domain-home-in-image/README.md +++ b/OracleWebLogic/samples/12213-domain-home-in-image/README.md @@ -2,29 +2,33 @@ 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 Servers each running in separate containers. As part of the domain configuration there is a data source that connects to a Derby database started in the Admin Server container. The data source in the Managed servers connect to the Derby database in the Admin server container. +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. +**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 +## Providing the Administration Server user name and password -**During Docker Build:** The user name, password must be supplied in 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` in the HOST. In the Docker run command line add the -v option maps the property file into the image directory /u01/oracle/properties. +**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`. -The security property files enables 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: +**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. +**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. + -### 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`. -**During Docker Build:** The domain configuration parameters must be supplied in the domain.properties file. This 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`. -The domain property file enables you to customize the parameter to configure the WebLogic domain. The format of the domain.properties are key=value pairs, for example: +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 @@ -35,9 +39,11 @@ The domain property file enables you to customize the parameter to configure the PRODUCTION_MODE_ENABLED=true CLUSTER_TYPE=DYNAMIC -**NOTE:** Before invoking the build make sure you have built `oracle/weblogic:12.2.1.3-developer`. +**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. -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`) @@ -47,7 +53,7 @@ Under the directory `docker-images/OracleWebLogic/samples/12213-domain-home-in-i * Admin Server Name: `ADMIN_NAME` (default: `admin-server`) * Admin Server Host: `ADMIN_HOST` (default: `wlsadmin`) -**NOTE:** The DOMAIN_HOME will be persisted in the image directory `/u01/oracle/user-projects/domains/$DOMAIN_NAME`. +**NOTE:** The `DOMAIN_HOME` will be persisted in the image directory `/u01/oracle/user-projects/domains/$DOMAIN_NAME`. To build this sample, run: @@ -55,8 +61,7 @@ To build this sample, run: $ docker build $BUILD_ARG --force-rm=true -t 12213-domain-home-in-image . - -**During Docker Run:** of the admin 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. In the Docker run command line add the -v option which maps the property file into the image directory /u01/oracle/properties. +**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: diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/create-wls-domain.py b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/create-wls-domain.py index 016c5f40dd..999add154e 100644 --- a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/create-wls-domain.py +++ b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/create-wls-domain.py @@ -54,7 +54,7 @@ def getEnvVar(var): print('cluster_type : [%s]' % cluster_type); print('managed_server_name_base : [%s]' % managed_server_name_base); print('production_mode_enabled : [%s]' % production_mode_enabled); -print('dsname : [%s]' % dsname); +#print('dsname : [%s]' % dsname); print('t3_channel_port : [%s]' % t3_channel_port); print('t3_public_address : [%s]' % t3_public_address); @@ -159,46 +159,46 @@ def getEnvVar(var): # 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); +#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 # ====== diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startAdminServer.sh b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startAdminServer.sh index 63021f27c8..3960f76007 100755 --- a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startAdminServer.sh +++ b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startAdminServer.sh @@ -94,15 +94,6 @@ if [ -z "${JAVA_OPTIONS}" ]; then fi export JAVA_OPTIONS=${JAVA_OPTIONS} -#Define start of Derby Database -#echo "Java Options: ${JAVA_OPTIONS}" -#DERBY_FLAG=`awk '{print $1}' ${SEC_PROPERTIES_FILE} | grep ^DERBY_FLAG= | cut -d "=" -f2` -#if [ -z "${DERBY_FLAG}" ]; then -# DERBY_FLAG="true" -#fi -#export DERBY_FLAG=${DERBY_FLAG} -#echo "Start Derby: ${DERBY_FLAG}" - # Create domain mkdir -p ${AS_SECURITY} echo "username=${USER}" >> ${AS_SECURITY}/boot.properties diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startManagedServer.sh b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startManagedServer.sh index 3ffef7b6fa..c6335cffe5 100755 --- a/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startManagedServer.sh +++ b/OracleWebLogic/samples/12213-domain-home-in-image/container-scripts/startManagedServer.sh @@ -46,14 +46,6 @@ fi export JAVA_OPTIONS=${JAVA_OPTIONS} echo "Java Options: ${JAVA_OPTIONS}" -#Set env to Start Derby DB -#DERBY_FLAG=`awk '{print $1}' ${SEC_PROPERTIES_FILE} | grep ^DERBY_FLAG= | cut -d "=" -f2` -#if [ -z "${DERBY_FLAG}" ]; then -# DERBY_FLAG="true" -#fi -#export DERBY_FLAG=${DERBY_FLAG} -#echo "Start Derby: ${DERBY_FLAG}" - # Create Managed Server mkdir -p ${MS_SECURITY} echo "username=${USER}" >> ${MS_SECURITY}/boot.properties diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-build/domain.properties b/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-build/domain.properties index 0f22622de9..aefe841c4f 100644 --- a/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-build/domain.properties +++ b/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-build/domain.properties @@ -9,23 +9,11 @@ CLUSTER_NAME=cluster-1 DEBUG_PORT=8453 DB_PORT=1527 DEBUG_FLAG=true -DERBY_FLAG=true PRODUCTION_MODE_ENABLED=true CLUSTER_TYPE=DYNAMIC JAVA_OPTIONS=-Dweblogic.StdoutDebugEnabled=false T3_CHANNEL_PORT=30012 T3_PUBLIC_ADDRESS=kubernetes -#Derby Data Source parameters -dsname=DockerDS -dsdbname=DerbyDB;create=true -dsjndiname=/DockerDS -dsdriver=org.apache.derby.jdbc.ClientXADataSource -dsurl=jdbc:derby://localhost:1527/DerbyDB;ServerName=localhost;databaseName=DerbyDB;create=true -dsusername=dbuser -dspassword=dbpassword -dstestquery=SQL SELECT 1 FROM SYS.SYSTABLES -dsinitalcapacity=0 -dsmaxcapacity=15 #Oracle database settings #dsname=DockerDS2 #dsdbname=default;create=true diff --git a/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-run/security.properties b/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-run/security.properties index fd16d73bda..bd5269b9e9 100644 --- a/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-run/security.properties +++ b/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker-run/security.properties @@ -1,5 +1,4 @@ username=myuser password=mypassword1 JAVA_OPTIONS=-Dweblogic.StdoutDebugEnabled=false -DERBY_FLAG=true diff --git a/OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile.patching-ontop-12213 b/OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile.patching-ontop-12213 new file mode 100644 index 0000000000..5b4bf2354a --- /dev/null +++ b/OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile.patching-ontop-12213 @@ -0,0 +1,56 @@ +# LICENSE UPL 1.0 +# +# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This Dockerfile extends the Oracle WebLogic install image, and applies necesary +# patch for the WebLogic Kubernetes Operator 2.0. The patch 28076014 is applied on top +# of WebLogic 12.2.1.3. + +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) p27117282_122130_Generic.zip (This patch is needed only if the WebLogic binary image +# is created manually from this Github project) +# (2) p28076014_122130_Generic.zip (On top of WebLogic Server 12.2.1.3) +# Download the patches from http://support.oracle.com +# +# HOW TO BUILD THIS IMAGE +# ----------------------- +# Put all downloaded files in the same directory as this Dockerfile +# Run: +# $ sudo docker build -t oracle/weblogic:12213-update-k8s -f Dockerfile.patching-ontop-12213 . +# + +# Pull base image +# --------------- +FROM oracle/weblogic:12.2.1.3-developer + +# Maintainer +# ---------- +MAINTAINER Monica Riccelli + +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +ENV PATCH_PKG1="p27117282_122130_Generic.zip" +ENV PATCH_PKG2="p28076014_122130_Generic.zip" + +# Copy supplemental package and scripts +# -------------------------------- +COPY $PATCH_PKG1 $PATCH_PKG2 /u01/ + +# Installation of Supplemental Quick Installer +# -------------------------------------------- +USER oracle +RUN cd /u01 && $JAVA_HOME/bin/jar xf /u01/$PATCH_PKG1 && \ + cd /u01/27117282 && $ORACLE_HOME/OPatch/opatch apply -silent && \ + cd /u01 && $JAVA_HOME/bin/jar xf /u01/$PATCH_PKG2 && \ + cd /u01/28076014 && $ORACLE_HOME/OPatch/opatch apply -silent && \ + $ORACLE_HOME/OPatch/opatch util cleanup -silent && \ + rm /u01/$PATCH_PKG1 && rm /u01/$PATCH_PKG2 && \ + rm -rf /u01/28076014 && rm -rf /u01/27117282 && \ + rm -rf /u01/oracle/cfgtoollogs/opatch/* + +WORKDIR ${ORACLE_HOME} + +CMD ["/u01/oracle/createAndStartEmptyDomain.sh"] diff --git a/OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile b/OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile.patching-ontop-12213-psu similarity index 77% rename from OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile rename to OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile.patching-ontop-12213-psu index 91689f5ed7..4fde853053 100644 --- a/OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile +++ b/OracleWebLogic/samples/12213-patch-wls-for-k8s/Dockerfile.patching-ontop-12213-psu @@ -4,20 +4,22 @@ # # ORACLE DOCKERFILES PROJECT # -------------------------- -# This Dockerfile extends the Oracle WebLogic install image, upgrades OPatch, and applies a patch. +# This Dockerfile extends the Oracle WebLogic install image, upgrades OPatch, and applies necesary patch for +# the WebLogic Kubernetes Operator 2.0. The patch 28076014 is applied on top of the Oct 2018 PSU and requires i +# an upgrade of OPatch to 13.9.4.0. # REQUIRED FILES TO BUILD THIS IMAGE # ---------------------------------- -# (1) p28186730_139400_Generic.zip -# (2) p28298734_122130_Generic.zip -# (3) p28076014_122130_Generic.zip +# (1) p28186730_139400_Generic.zip (Opatch update) +# (2) p28298734_122130_Generic.zip (WLS PATCH SET UPDATE 12.2.1.3.181016 ) +# (3) p28076014_12213181016_Generic.zip (On top of WLS PATCH SET UPDATE 12.2.1.3.181016) # Download the patches from http://support.oracle.com # # HOW TO BUILD THIS IMAGE # ----------------------- # Put all downloaded files in the same directory as this Dockerfile # Run: -# $ sudo docker build -t oracle/weblogic:12213-update-k8s . +# $ sudo docker build -t oracle/weblogic:12213-update-k8s Dockerfile.patching-ontop-12213-psu . # # Pull base image @@ -32,7 +34,7 @@ MAINTAINER Monica Riccelli # ------------------------------------------------------------- ENV PATCH_PKG0="p28186730_139400_Generic.zip" ENV PATCH_PKG1="p28298734_122130_Generic.zip" -ENV PATCH_PKG2="p28076014_122130_Generic.zip" +ENV PATCH_PKG2="p28076014_12213181016_Generic.zip" # Copy supplemental package and scripts # -------------------------------- diff --git a/OracleWebLogic/samples/12213-patch-wls-for-k8s/README.md b/OracleWebLogic/samples/12213-patch-wls-for-k8s/README.md index 0efb5c39cf..861528419c 100644 --- a/OracleWebLogic/samples/12213-patch-wls-for-k8s/README.md +++ b/OracleWebLogic/samples/12213-patch-wls-for-k8s/README.md @@ -1,21 +1,33 @@ Example of Image with WLS Domain ================================ -This Dockerfile extends the Oracle WebLogic install image by updating OPatch and applying a patch. Before applying the WebLogic 12.2.1.3 October PSU PATCH 12.2.1.3.181016WLSPSU, Opatch needs to be updated with PATCH 28186730: OPATCH 13.9.4.0.0 FOR FMW/WLS 12.2.1.3. +There are two Dockerfiles which extend the Oracle WebLogic binary image and apply a necessary patch for the WebLogic Kubernetes Operator 2.0. -**Notes:** Historically, OPatch was updated by unzipping and replacing the `ORACLE_HOME/OPatch` directory. For versions greater than or equal to 13.6, now it uses the OUI installation tooling. This ensures that the installer both executes the file updates and logs the components and file changes to the OUI meta-data. A pure unzip install means the OUI tooling is not aware of these changes, which has on occasion, led to upgrade-related issues. +1.) `Dockerfile.patching-ontop-12213`: applies two patches `p28076014` (on top of WLS 12.2.1.3) and `p27117282` (this patch is needed only if the WebLogic binary image is created manually from this GitHub project). -We are applying patch `p28076014_12213_Generic.zip` which is required for the WebLogic Kubernetes Operator to work. +2.) `Dockerfile.patching-ontop-12213-psu`: applies patch `p28298734` (WLS PATCH SET UPDATE 12.2.1.3.181016), patch `p28076014` (on top of WLS 12.2.1.3 October PSU), and `p28186730` (Opatch update). Before applying the WebLogic 12.2.1.3 October PSU PATCH 12.2.1.3.181016WLSPSU, Opatch needs to be updated with PATCH 28186730: OPATCH 13.9.4.0.0 FOR FMW/WLS 12.2.1.3. + +**Note**: Historically, OPatch was updated by unzipping and replacing the `ORACLE_HOME/OPatch` directory. For versions greater than or equal to 13.6, now it uses the OUI installation tooling. This ensures that the installer both executes the file updates and logs the components and file changes to the OUI meta-data. A pure unzip install means the OUI tooling is not aware of these changes, which has on occasion, led to upgrade-related issues. + +We are applying patch `p28076014` which is required for the WebLogic Kubernetes Operator to work. ## How to build First make sure you have built **oracle/weblogic:12.2.1.3-developer**. +If you want to patch on top of WebLogic Server 12.2.1.3 download: + + file [p28076014_122130_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. + file [p27117282_122130_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. + +If you want to patch on top of WebLogic Server 12.2.1.3 October PSU download: - Then download file [p28186730_139400_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. - Then download file [p28298734_122130_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. - Then download file [p28076014_122130_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. + file [p28186730_139400_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. + file [p28298734_122130_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. + file [p28076014_12213181016_Generic.zip](http://support.oracle.com) and place it in the same directory as this README. To build, run: - $ docker build -t oracle/weblogic:12213-patch-wls-for-k8s . + $ docker build -t oracle/weblogic:12213-patch-wls-for-k8s -f Dockerfile.patching-ontop-12213 . + or + $ docker build -t oracle/weblogic:12213-patch-wls-for-k8s -f Dockerfile.patching-ontop-12213-psu . ## Verify that the patch has been applied correctly Run a container from the image: @@ -27,7 +39,8 @@ cd OPatch and run: ./opatch version ./opatch lspatches -You will see the OPatch version being 13.9.4.0.0 and the one-off patches 27117282 and 28076014 applied. + 1) You will see one-off patches 28076014, and 27117282. + 2) You will see one-off patches 28076014, 28298734 WLS PATCH SET UPDATE 12.2.1.3.181016, and the OPatch version being 13.9.4.0.0. ## Run a single server domain The WebLogic Server install image (patched in this sample) allows you to run a container with a single WebLogic Server domain. This makes it extremely simple to deploy applications and any resources the applications might need. The steps below describe how to run the single server domain container. @@ -53,7 +66,7 @@ You can override the default values of the following parameters during runtime w * `ADMINISTRATION_PORT_ENABLED` (default: `true`) * `ADMINISTRATION_PORT` (default: `9002`) -**NOTE**: For security, the Administration port 9002 is enabled by default. If you would like to disable the Administration port, set `ADMINISTRTATION_PORT_ENABLED` to false. If you intend to run these images in production, then you must change the Production Mode to `production`. To set the `DOMAIN_NAME`, you must set both `DOMAIN_NAME` and `DOMAIN_HOME`. +**NOTE**: For security, the Administration port 9002 is enabled by default. If you would like to disable the Administration port, set `ADMINISTRTATION_PORT_ENABLED` to `false`. If you intend to run these images in production, then you must change the Production Mode to `production`. To set the `DOMAIN_NAME`, you must set both `DOMAIN_NAME` and `DOMAIN_HOME`. ``` $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_HOME=/u01/oracle/user_projects/domains/abc_domain -e DOMAIN_NAME=abc_domain oracle/weblogic:12213-opatch-update @@ -66,7 +79,7 @@ Run the WLS Administration Console: 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 WebLogic multi-server domains and cluster -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-home-in-image sample. +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-home-in-image` sample. # Copyright Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleWebLogic/samples/12213-patch-wls-for-k8s/build.sh b/OracleWebLogic/samples/12213-patch-wls-for-k8s/build.sh new file mode 100755 index 0000000000..859c2c35dc --- /dev/null +++ b/OracleWebLogic/samples/12213-patch-wls-for-k8s/build.sh @@ -0,0 +1,9 @@ +#!/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. +# +# Build the image using Dockerfile.patching-ontop-12213 to apply patch 28076014 based on WebLogic 12.2.1.3, or build +# the image using Dockerfile.patching-ontop-12213-psu to apply patch 28076014 ontop of WebLogic 12.2.1.3 October PSU. +docker build -t oracle/weblogic:12213-patch-wls-for-k8s -f Dockerfile.$1 . diff --git a/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_122130_Generic.download b/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_122130_Generic.download index 7196e8255f..5f798fc41f 100644 --- a/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_122130_Generic.download +++ b/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_122130_Generic.download @@ -2,7 +2,7 @@ # # https://support.oracle.com # -# 1) Download the ZIP file "Patch" for WebLogic 12.2.1.3 +# 1) Download the ZIP file "Patch" for WebLogic 12.2.1.3 # 2) Put the ZIP file in the same location as this .download file # b57a9b37a0828575e2931a3da88f821e p28076014_122130_Generic.zip diff --git a/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_12213_Generic.download b/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_12213181016_Generic.download similarity index 53% rename from OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_12213_Generic.download rename to OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_12213181016_Generic.download index 7196e8255f..dc558785c8 100644 --- a/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_12213_Generic.download +++ b/OracleWebLogic/samples/12213-patch-wls-for-k8s/p28076014_12213181016_Generic.download @@ -2,7 +2,7 @@ # # https://support.oracle.com # -# 1) Download the ZIP file "Patch" for WebLogic 12.2.1.3 +# 1) Download the ZIP file "Patch" for WebLogic 12.2.1.3 # 2) Put the ZIP file in the same location as this .download file # -b57a9b37a0828575e2931a3da88f821e p28076014_122130_Generic.zip +fdbaea99a68c79910098b66db6017485 p28076014_12213181016_Generic.zip