From 1644a796ab7e51638690911d833d540e243f9865 Mon Sep 17 00:00:00 2001 From: Yagnesh Kotecha Date: Mon, 17 Jul 2017 05:23:51 -0700 Subject: [PATCH 1/2] Pushed SOA BPM docker images --- OracleSOABPM/COPYRIGHT | 20 + OracleSOABPM/LICENSE | 3 + OracleSOABPM/README.md | 24 + .../dockerfiles/12.2.1.2-soabpm/Dockerfile | 92 ++++ .../container-scripts/createDomain.py | 475 ++++++++++++++++++ .../container-scripts/createDomainAndStart.sh | 252 ++++++++++ .../container-scripts/startAS.sh | 52 ++ .../container-scripts/startMS.sh | 98 ++++ .../container-scripts/updListenAddress.py | 49 ++ ....1.2.0_bpm_quickstart_generic.jar.download | 5 + ...1.2.0_bpm_quickstart_generic2.jar.download | 5 + .../dockerfiles/12.2.1.2-soabpm/oraInst.loc | 2 + .../12.2.1.2-soabpm/soabpm.response | 13 + OracleSOABPM/dockerfiles/README.md | 33 ++ OracleSOABPM/dockerfiles/buildDockerImage.sh | 140 ++++++ OracleSOABPM/samples/README.md | 61 +++ OracleSOABPM/samples/docker-compose.yml | 147 ++++++ OracleSOABPM/setenv.sh | 70 +++ 18 files changed, 1541 insertions(+) create mode 100644 OracleSOABPM/COPYRIGHT create mode 100644 OracleSOABPM/LICENSE create mode 100644 OracleSOABPM/README.md create mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile create mode 100755 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py create mode 100755 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh create mode 100755 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh create mode 100755 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh create mode 100755 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py create mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download create mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download create mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/oraInst.loc create mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response create mode 100644 OracleSOABPM/dockerfiles/README.md create mode 100755 OracleSOABPM/dockerfiles/buildDockerImage.sh create mode 100644 OracleSOABPM/samples/README.md create mode 100644 OracleSOABPM/samples/docker-compose.yml create mode 100755 OracleSOABPM/setenv.sh diff --git a/OracleSOABPM/COPYRIGHT b/OracleSOABPM/COPYRIGHT new file mode 100644 index 0000000000..29a070604d --- /dev/null +++ b/OracleSOABPM/COPYRIGHT @@ -0,0 +1,20 @@ +Copyright (c) 2003 - 2017, Oracle Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/OracleSOABPM/LICENSE b/OracleSOABPM/LICENSE new file mode 100644 index 0000000000..2970b5248f --- /dev/null +++ b/OracleSOABPM/LICENSE @@ -0,0 +1,3 @@ +Unless otherwise noted, all files in this folder are released +under the Common Development and Distribution License (CDDL) 1.0 +and GNU Public License 2.0 licenses. diff --git a/OracleSOABPM/README.md b/OracleSOABPM/README.md new file mode 100644 index 0000000000..02ca1560ba --- /dev/null +++ b/OracleSOABPM/README.md @@ -0,0 +1,24 @@ +Oracle SOA Suite/BPM on Docker +============================== +Sample Docker build file to facilitate installation, configuration, and environment setup for DevOps users for Release 12.2.1.2.0. For more information check out +[Oracle Fusion Middleware](http://www.oracle.com/technetwork/middleware/fusion-middleware/overview/index.html) specifically the sections on +- Service Integration (SOA) +- Business Process Management + +## What is included +- Sample docker file to build an image containing a pre-configured SOA, BPM or OSB domain +- Docker Compose file to start an instance of the Database, Admin Server and a Managed Server + +## How to build +[Please review this README file](dockerfiles/README.md) + +## How to run +[Please review this README file](samples/README.md) + +## License +To download and run Oracle Fusion Middleware, regardless whether inside or outside a Docker container, you must download the binaries from the Oracle website and accept the license indicated at that page. + +All scripts and files hosted in this project and GitHub [docker-images/OracleSOABPM](./) repository required to build the Docker images are, unless otherwise noted, released under the Common Development and Distribution License (CDDL) 1.0 and GNU Public License 2.0 licenses. + +## Copyright +Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile new file mode 100644 index 0000000000..4218865991 --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile @@ -0,0 +1,92 @@ +# LICENSE CDDL 1.0 + GPL 2.0 +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle BPM 12.2.1.2 Quick Start +# +# Base image of this dockerfile is the server JRE 8 docker image. +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# (1) fmw_12.2.1.2.0_bpm_quickstart_generic.jar & +# fmw_12.2.1.2.0_bpm_quickstart_generic2.jar +# (2) Download from OTN +# http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html +# - Download Queue/Selected Item +# - Oracle SOA Suite for Oracle Middleware (BPM, FMW, Service Oriented +# Architecture +# - Linux x86-64 +# - CONTINUE +# - Download Queue/Select Release +# - Oracle SOA Suite for Oracle Middleware 12.2.1.2.0 for Linux x86-64 +# - CONTINUE +# - Accept Terms +# - Download the following +# - V779125-01_1of2.zip +# Oracle Fusion Middleware 12c (12.2.1.2.0) Business Process Management +# Quick Start for Developers +# - V779125-01_2of2.zip +# Oracle Fusion Middleware 12c (12.2.1.2.0) Business Process Management +# Quick Start for Developers +# - Unzip to get the 2 jars mentioned above +# +# Pull base image +# --------------- +FROM container-registry.oracle.com/java/serverjre:8u131 +# +# Maintainer +# ---------- +MAINTAINER Prashanth Nagaraja +# +# +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +USER root +ENV FMW_JAR1=fmw_12.2.1.2.0_bpm_quickstart_generic.jar \ + FMW_JAR2=fmw_12.2.1.2.0_bpm_quickstart_generic2.jar \ + ORACLE_HOME=/u01/oracle \ + USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \ + PATH=$PATH:$JAVA_HOME/bin:$ORACLE_HOME/oracle_common/common/bin + +# Install OL7 required packages. Refer FMW 12.2.1.2 System requirements +# guide for complete list of packages +# Change the open file limits and kernel parameters that need changing +# Setup filesystem and oracle user +# Go to /u01 as user 'oracle' to proceed with SOA installation +#--------------------------------------------------------------- +# Proxy needs to be set before running yum in /etc/yum.conf +# Useful developer tools in the docker Image +# +RUN yum install -y unzip tar hostname && \ + yum clean all && \ + mkdir -p /u01 /u01/oracle/dockertools && \ + chmod a+xr /u01 && \ + useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ + chown oracle:oracle -R /u01 +# +# Copy files and packages for install +# ----------------------------------- +ADD $FMW_JAR1 $FMW_JAR2 /u01/ +RUN cd /u01 && chmod 755 *.jar && chown oracle:oracle -R /u01 +# +USER oracle +COPY *.response oraInst.loc /u01/ +RUN cd /u01 && \ + $JAVA_HOME/bin/java -jar $FMW_JAR1 -silent -responseFile /u01/soabpm.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ + rm -f /u01/*.jar /u01/oraInst.loc /u01/*.response + +# +# Copy Domain creation scripts +# +USER root +COPY container-scripts/* /u01/oracle/dockertools/ +RUN chmod a+xr /u01/oracle/dockertools/*.* + +# +# Define default command to start bash. +# +USER oracle +WORKDIR $ORACLE_HOME +CMD ["/u01/oracle/dockertools/createDomainAndStart.sh"] diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py new file mode 100755 index 0000000000..4845d1beae --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py @@ -0,0 +1,475 @@ +import os +import sys + +import com.oracle.cie.domain.script.jython.WLSTException as WLSTException + +class SOA12212Provisioner: + + MACHINES = { + 'machine1' : { + 'NMType': 'SSL', + 'ListenAddress': 'localhost', + 'ListenPort': 5658 + } + } + + SOA_CLUSTERS = { + 'soa_cluster' : {} + } + + OSB_CLUSTERS = { + 'osb_cluster' : {} + } + + SERVERS = { + 'AdminServer' : { + 'ListenAddress': '', + 'ListenPort': 7001, + 'Machine': 'machine1' + } + + } + + SOA_SERVERS = { + 'soa_server1' : { + 'ListenAddress': '', + 'ListenPort': 8001, + 'Machine': 'machine1', + 'Cluster': 'soa_cluster' + } + } + + OSB_SERVERS = { + 'osb_server1' : { + 'ListenAddress': '', + 'ListenPort': 9001, + 'Machine': 'machine1', + 'Cluster': 'osb_cluster' + } + } + + + JRF_12212_TEMPLATES = { + 'baseTemplate' : '@@ORACLE_HOME@@/wlserver/common/templates/wls/wls.jar', + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf.ws.async_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.wsmpm_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.ums_template.jar', + '@@ORACLE_HOME@@/em/common/templates/wls/oracle.em_wls_template.jar' + ], + 'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ] + } + + SOA_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/soa/common/templates/wls/oracle.soa_template.jar' + ], + 'serverGroupsToTarget' : [ 'SOA-MGD-SVRS-ONLY' ] + } + + OSB_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/osb/common/templates/wls/oracle.osb_template.jar' + ], + 'serverGroupsToTarget' : [ 'OSB-MGD-SVRS-ONLY' ] + } + + BPM_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/soa/common/templates/wls/oracle.bpm_template.jar' + ], + 'serverGroupsToTarget' : [ 'SOA-MGD-SVRS-ONLY' ] + } + + def __init__(self, oracleHome, javaHome, domainParentDir): + self.oracleHome = self.validateDirectory(oracleHome) + self.javaHome = self.validateDirectory(javaHome) + self.domainParentDir = self.validateDirectory(domainParentDir, create=True) + return + + def configureXADataSources(self): + cd('/JDBCSystemResources/SOADataSource/JdbcResource/SOADataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/EDNDataSource/JdbcResource/EDNDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/OraSDPMDataSource/JdbcResource/OraSDPMDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + return + + def createDomain(self, name, user, password, db, dbPrefix, dbPassword,domainType): + domainHome = self.createBaseDomain(name, user, password,domainType) + + if domainType == "soa" or domainType == "soaosb": + self.extendSoaDomain(domainHome, db, dbPrefix, dbPassword) + + if domainType == "osb" or domainType == "soaosb" : + self.extendOsbDomain(domainHome, db, dbPrefix, dbPassword,domainType) + + if domainType == "bpm": + self.extendBpmDomain(domainHome, db, dbPrefix, dbPassword) + + + def createBaseDomain(self, name, user, password,domainType): + baseTemplate = self.replaceTokens(self.JRF_12212_TEMPLATES['baseTemplate']) + + readTemplate(baseTemplate) + setOption('DomainName', name) + setOption('JavaHome', self.javaHome) + setOption('ServerStartMode', 'prod') + set('Name', domainName) + cd('/Security/' + domainName + '/User/weblogic') + set('Name', user) + set('Password', password) + + + print 'INFO: Creating Node Managers...' + for machine in self.MACHINES: + cd('/') + create(machine, 'Machine') + cd('Machine/' + machine) + create(machine, 'NodeManager') + cd('NodeManager/' + machine) + for param in self.MACHINES[machine]: + set(param, self.MACHINES[machine][param]) + + print 'INFO: Creating Admin server...' + + for server in self.SERVERS: + cd('/') + if server == 'AdminServer': + cd('Server/' + server) + for param in self.SERVERS[server]: + set(param, self.SERVERS[server][param]) + continue + create(server, 'Server') + cd('Server/' + server) + for param in self.SERVERS[server]: + set(param, self.SERVERS[server][param]) + + if domainType == "soa" or domainType == "bpm" or domainType == "soaosb": + for cluster in self.SOA_CLUSTERS: + cd('/') + create(cluster, 'Cluster') + cd('Cluster/' + cluster) + for param in self.SOA_CLUSTERS[cluster]: + set(param, self.SOA_CLUSTERS[cluster][param]) + + for server in self.SOA_SERVERS: + cd('/') + create(server, 'Server') + cd('Server/' + server) + for param in self.SOA_SERVERS[server]: + set(param, self.SOA_SERVERS[server][param]) + + print 'INFO: SOA Servers created.....' + + if domainType == 'osb' or domainType == "soaosb": + + print 'INFO: Creating OSB cluster...' + for cluster in self.OSB_CLUSTERS: + cd('/') + create(cluster, 'Cluster') + cd('Cluster/' + cluster) + for param in self.OSB_CLUSTERS[cluster]: + set(param, self.OSB_CLUSTERS[cluster][param]) + + for server in self.OSB_SERVERS: + cd('/') + create(server, 'Server') + cd('Server/' + server) + for param in self.OSB_SERVERS[server]: + set(param, self.OSB_SERVERS[server][param]) + + + print 'INFO: OSB Servers created.....' + setOption('OverwriteDomain', 'true') + domainHome = self.domainParentDir + '/' + name + + print 'INFO: Writing base domain...' + writeDomain(domainHome) + closeTemplate() + print 'INFO: Base domain created at ' + domainHome + return domainHome + + + def readAndApplyJRFTemplates(self, domainHome): + print 'INFO: Extending domain at ' + domainHome + readDomain(domainHome) + setOption('AppDir', self.domainParentDir + '/applications') + + print 'INFO: Applying JRF templates...' + for extensionTemplate in self.JRF_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + return + + def applySOATemplates(self): + print 'INFO: Applying SOA templates...' + for extensionTemplate in self.SOA_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + return + + def configureJDBCTemplates(self,db,dbPrefix,dbPassword): + print 'INFO: Configuring the Service Table DataSource...' + fmwDb = 'jdbc:oracle:thin:@' + db + cd('/JDBCSystemResource/LocalSvcTblDataSource/JdbcResource/LocalSvcTblDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.OracleDriver') + set('URL', fmwDb) + set('PasswordEncrypted', dbPassword) + + stbUser = dbPrefix + '_STB' + cd('Properties/NO_NAME_0/Property/user') + set('Value', stbUser) + + print 'INFO: Getting Database Defaults...' + getDatabaseDefaults() + return + + def targetSOAServers(self,serverGroupsToTarget): + for server in self.SOA_SERVERS: + if not server == 'AdminServer': + setServerGroups(server, serverGroupsToTarget) + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + server + cd('/Servers/' + server) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def targetSOACluster(self): + for cluster in self.SOA_CLUSTERS: + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + cluster + cd('/Cluster/' + cluster) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + + def targetOSBServers(self,serverGroupsToTarget): + for server in self.OSB_SERVERS: + if not server == 'AdminServer': + setServerGroups(server, serverGroupsToTarget) + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + server + cd('/Servers/' + server) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def targetOSBCluster(self): + for cluster in self.OSB_CLUSTERS: + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + cluster + cd('/Cluster/' + cluster) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def extendSoaDomain(self, domainHome, db, dbPrefix, dbPassword): + self.readAndApplyJRFTemplates(domainHome) + self.applySOATemplates() + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + self.configureXADataSources() + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.SOA_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetSOAServers(serverGroupsToTarget) + + cd('/') + self.targetSOACluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.SOA_CLUSTERS) + "]" + + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.SOA_CLUSTERS)) + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + def extendOsbDomain(self, domainHome, db, dbPrefix, dbPassword,domainType): + self.readAndApplyJRFTemplates(domainHome) + + print 'INFO: Applying OSB templates...' + for extensionTemplate in self.OSB_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + cd('/JDBCSystemResources/SOADataSource/JdbcResource/SOADataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/OraSDPMDataSource/JdbcResource/OraSDPMDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.OSB_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetOSBServers(serverGroupsToTarget) + + cd('/') + self.targetOSBCluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.OSB_CLUSTERS) + "]" + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.OSB_CLUSTERS)) + + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + def extendBpmDomain(self, domainHome, db, dbPrefix, dbPassword): + self.readAndApplyJRFTemplates(domainHome) + + print 'INFO: Applying BPM templates...' + for extensionTemplate in self.BPM_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + self.configureXADataSources() + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.BPM_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetSOAServers(serverGroupsToTarget) + + cd('/') + self.targetSOACluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.SOA_CLUSTERS) + "]" + + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.SOA_CLUSTERS)) + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + ########################################################################### + # Helper Methods # + ########################################################################### + + def validateDirectory(self, dirName, create=False): + directory = os.path.realpath(dirName) + if not os.path.exists(directory): + if create: + os.makedirs(directory) + else: + message = 'Directory ' + directory + ' does not exist' + raise WLSTException(message) + elif not os.path.isdir(directory): + message = 'Directory ' + directory + ' is not a directory' + raise WLSTException(message) + return self.fixupPath(directory) + + + def fixupPath(self, path): + result = path + if path is not None: + result = path.replace('\\', '/') + return result + + + def replaceTokens(self, path): + result = path + if path is not None: + result = path.replace('@@ORACLE_HOME@@', oracleHome) + return result + +############################# +# Entry point to the script # +############################# + +def usage(): + print sys.argv[0] + ' -oh -jh -parent [-name ] ' + \ + '[-user ] [-password ] ' + \ + '-rcuDb [-rcuPrefix ] [-rcuSchemaPwd ] ' + \ + '-domainType ' + sys.exit(0) + + +print "createDomain.py called with the following inputs:" +for index, arg in enumerate(sys.argv): + print "INFO: sys.argv[" + str(index) + "] = " + str(sys.argv[index]) + +if len(sys.argv) < 6: + usage() + +#oracleHome will be passed by command line parameter -oh. +oracleHome = None +#javaHome will be passed by command line parameter -jh. +javaHome = None +#domainParentDir will be passed by command line parameter -parent. +domainParentDir = None +#domainName is hard-coded to soa_domain. You can change to other name of your choice. Command line parameter -name. +domainName = 'soa_domain' +#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user. +domainUser = 'weblogic' +#domainPassword is hard-coded to welcome1. You can change to other password of your choice. Command line parameter -password. +domainPassword = 'welcome1' +#rcuDb will be passed by command line parameter -rcuDb. +rcuDb = None +#change rcuSchemaPrefix to your soainfra schema prefix. Command line parameter -rcuPrefix. +rcuSchemaPrefix = 'DEV12' +#change rcuSchemaPassword to your soainfra schema password. Command line parameter -rcuSchemaPwd. +rcuSchemaPassword = 'welcome1' + +i = 1 +while i < len(sys.argv): + if sys.argv[i] == '-oh': + oracleHome = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-jh': + javaHome = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-parent': + domainParentDir = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-name': + domainName = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-user': + domainUser = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-password': + domainPassword = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuDb': + rcuDb = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuPrefix': + rcuSchemaPrefix = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuSchemaPwd': + rcuSchemaPassword = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-domainType': + domainType = sys.argv[i + 1] + i += 2 + else: + print 'INFO: Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i]) + usage() + sys.exit(1) + + +provisioner = SOA12212Provisioner(oracleHome, javaHome, domainParentDir) +provisioner.createDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword,domainType) diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh new file mode 100755 index 0000000000..cbb9d47536 --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh @@ -0,0 +1,252 @@ +#!/bin/bash +# +export DOMAIN_NAME=${DOMAIN_NAME:-soainfra} +export DOMAIN_ROOT=${DOMAIN_ROOT:-/u01/oracle/user_projects/domains} +export DOMAIN_HOME=${DOMAIN_ROOT}/${DOMAIN_NAME} + +#================================================== +function _int() { + echo "INFO: Stopping container." + echo "INFO: SIGINT received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function _term() { + echo "INFO: Stopping container." + echo "INFO: SIGTERM received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function _kill() { + echo "INFO: SIGKILL received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function rand_pwd(){ + while true; do + s=$(cat /dev/urandom | tr -dc "A-Za-z0-9" | fold -w 8 | head -n 1) + if [[ ${#s} -ge 8 && "$s" = *[A-Z]* && "$s" = *[a-z]* && "$s" = *[0-9]* ]] + then + break + else + echo "INFO: Password does not Match the criteria, re-generating..." >&2 + fi + done + echo "INFO: ${s}" +} + +#================================================== +setupRCU() { + dbType=`echo ${CONNECTION_STRING} | cut -d "/" -f2` + scrName=/u01/oracle/oracle_common/common/sql/iau/scripts/creAuditTabs.sql + + if [ ! -s "${scrName}.orig" ]; then + echo "INFO: Copying RCU backup file" + cp ${scrName} ${scrName}.orig + fi + + if [ "${dbType}" = "XE" -o "${dbType}" = "xe" ]; then + echo "INFO: Setting RCU for XE" + sed -e "s/^@@prepareAuditView.sql/-- @@prepareAuditView.sql/g" ${scrName}.orig > ${scrName} + else + echo "INFO: Setting RCU for ORCL" + cp ${scrName}.orig ${scrName} + fi +} + +#================================================== +#== MAIN starts here... +#================================================== +trap _int SIGINT +trap _term SIGTERM +trap _kill SIGKILL + +echo "INFO: CONNECTION_STRING = ${CONNECTION_STRING:?"Please set CONNECTION_STRING"}" +echo "INFO: RCUPREFIX = ${RCUPREFIX:?"Please set RCUPREFIX"}" + +if [ -z ${DB_PASSWORD} ] +then + echo "" + echo "FATAL: DB System password is empty. Exiting..." + exit 1 +fi; + +if [ -z ${ADMIN_PASSWORD} ] +then + # Auto generate Oracle WebLogic Server admin password + ADMIN_PASSWORD=$(rand_pwd) + echo "" + echo "INFO: Oracle WebLogic Server Password Auto Generated :" + echo " 'weblogic' admin password: $ADMIN_PASSWORD" + echo "" +fi; + +if [ -z ${DB_SCHEMA_PASSWORD} ] +then + # Auto generate Oracle Database Schema password + temp_pwd=$(rand_pwd) + #Password should not start with a number for database + f_str=`echo $temp_pwd|cut -c1|tr [0-9] [A-Z]` + s_str=`echo $temp_pwd|cut -c2-` + DB_SCHEMA_PASSWORD=${f_str}${s_str} + echo "" + echo "INFO: Database Schema password Auto Generated :" + echo " Database schema password: $DB_SCHEMA_PASSWORD" + echo "" +fi + +export CONNECTION_STRING=$CONNECTION_STRING +export RCUPREFIX=$RCUPREFIX +export ADMIN_PASSWORD=$ADMIN_PASSWORD +export DB_PASSWORD=$DB_PASSWORD +export DB_SCHEMA_PASSWORD=$DB_SCHEMA_PASSWORD +export DOMAIN_TYPE=$DOMAIN_TYPE + +export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING +export vol_name=u01 + +echo -e $DB_PASSWORD"\n"$DB_SCHEMA_PASSWORD > /tmp/pwd.txt + +CTR_DIR=/$vol_name/oracle/user_projects/container + +# +# Creating schemas needed for sample domain #### +#=============================================== +# +RUN_RCU="true" +CONFIGURE_DOMAIN="true" + +if [ -d $CTR_DIR ] +then + # First load the Env Data from the env file... + if [ -e $CTR_DIR/contenv.sh ] + then + . $CTR_DIR/contenv.sh + #reset the JDBC URL + export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING + fi +else + mkdir $CTR_DIR +fi + +if [ -e $CTR_DIR/RCU.$RCUPREFIX.suc ] +then + #RCU has already been executed successfully, no need to rerun + RUN_RCU="false" + echo "INFO: SOA RCU has already been loaded. Skipping..." +fi + +if [ "$RUN_RCU" = "true" ] +then + setupRCU + # Run the RCU.. it hasnt been loaded before. If it has + # then drop the prefix and restart. New Domain creation + # scenario + echo "INFO: Dropping Schema $RCUPREFIX..." + /$vol_name/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -selectDependentsForComponents true -schemaPrefix $RCUPREFIX -component OPSS -component STB -component SOAINFRA -f < /tmp/pwd.txt + + echo "INFO: Creating Schema $RCUPREFIX..." + /$vol_name/oracle/oracle_common/bin/rcu -silent -createRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true -selectDependentsForComponents true -variables SOA_PROFILE_TYPE=SMALL,HEALTHCARE_INTEGRATION=NO -schemaPrefix $RCUPREFIX -component OPSS -component STB -component SOAINFRA -f < /tmp/pwd.txt + retval=$? + + if [ $retval -ne 0 ]; + then + echo "ERROR: RCU Loading Failed. Check the RCU logs" + exit + else + # Write the rcu suc file... + touch $CTR_DIR/RCU.$RCUPREFIX.suc + + # Write the env file.. such that the passwords etc.. will be saved and we will + # be able to restart from the RCU + cat > $CTR_DIR/contenv.sh <> $CTR_DIR/SOA.DOMAINCFG.suc + + cat > $CTR_DIR/contenv.sh < $DOMAIN_HOME/servers/AdminServer/security/boot.properties +echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/AdminServer/security/boot.properties + +# +# Password less Managed Server starting +#====================================== +echo "username=weblogic" > $DOMAIN_HOME/servers/$server/security/boot.properties +echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/$server/security/boot.properties + +# +# Setting env variables +#======================= +echo ". $DOMAIN_HOME/bin/setDomainEnv.sh" >> /u01/oracle/.bashrc +echo "export PATH=$PATH:/u01/oracle/common/bin:$DOMAIN_HOME/bin" >> /u01/oracle/.bashrc + +# Now we start the Admin server in this container... +/u01/oracle/dockertools/startAS.sh + +sleep infinity diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh new file mode 100755 index 0000000000..78f6fb457e --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Author: vivek.raj@oracle.com +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +#************************************************************************* +# script is used to start a WebLogic Admin server. +#************************************************************************* +export DOMAIN_HOME=$DOMAIN_ROOT/$DOMAIN_NAME + +# Start Admin server +LOGDIR=${DOMAIN_HOME}/logs +LOGFILE=${LOGDIR}/as.log +STSFILE=${LOGDIR}/as.status +mkdir -p ${LOGDIR} +rm -f ${LOGFILE} ${STSFILE} + +echo "INFO: Starting the Admin Server..." +echo "INFO: Logs = ${LOGFILE}" +$DOMAIN_HOME/bin/startWebLogic.sh > ${LOGFILE} 2>&1 & + +statusfile=/tmp/notifyfifo.$$ +mkfifo "${statusfile}" || exit 1 +{ + # run tail in the background so that the shell can kill tail when notified + # that grep has exited + tail -f ${LOGFILE} & + + # remember tail's PID + tailpid=$! + + # wait for notification that grep has exited + read templine <${statusfile} + echo ${templine} + + # grep has exited, time to go + kill "${tailpid}" +} | { + grep -m 1 " " + + # notify the first pipeline stage that grep is done + echo "RUNNING" > ${STSFILE} + echo "INFO: Admin server is running" + echo > ${statusfile} +} + +# clean up +rm "${statusfile}" +if [ -f ${STSFILE} ]; then + echo "INFO: Admin server running, ready to start managed server" +fi diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh new file mode 100755 index 0000000000..84cb5c9c0d --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh @@ -0,0 +1,98 @@ +#!/bin/bash +# +# Author:vivek.raj@oracle.com + +export DOMAIN_NAME=${DOMAIN_NAME:-soainfra} +export DOMAIN_ROOT=${DOMAIN_ROOT:-/u01/oracle/user_projects/domains} +export DOMAIN_HOME=${DOMAIN_ROOT}/${DOMAIN_NAME} + +#================================================================= +function _int() { + echo "INFO: Stopping container." + echo "INFO: SIGINT received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh $server "http://"$adminhostname:$adminport + exit; +} + +#================================================================= +function _term() { + echo "INFO: Stopping container." + echo "INFO: SIGTERM received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh $server "http://"$adminhostname:$adminport + exit; +} + +#================================================================= +function _kill() { + echo "INFO: SIGKILL received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh $server "http://"$adminhostname:$adminport + exit; +} + +#================================================================= +#== MAIN Starts here... +#================================================================= +trap _int SIGINT +trap _term SIGTERM +trap _kill SIGKILL + +export vol_name=u01 +export adminhostname=$adminhostname +export adminport=$adminport + +# First Update the server in the domain +grepPat=" " +if [ "$DOMAIN_TYPE" = "soa" ] || [ "$DOMAIN_TYPE" = "bpm" ] +then + server="soa_server1" + grepPat="SOA Platform is running and accepting requests" +elif [ "$DOMAIN_TYPE" = "osb" ] +then + server="osb_server1" +else + echo "ERROR: Invalid domain type. Cannot start the servers" + exit +fi + +LOGDIR=${DOMAIN_HOME}/logs +LOGFILE=${LOGDIR}/ms.log +mkdir -p ${LOGDIR} + +export soa_host=`hostname -I` +echo "INFO: Updating the Host name listen address" +/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name $soa_host $server > ${LOGDIR}/mslisten.log 2>&1 + +# Start SOA server +echo "INFO: Starting the managed server ${server}" +$DOMAIN_HOME/bin/startManagedWebLogic.sh $server "http://"$adminhostname:$adminport > ${LOGFILE} 2>&1 & +statusfile=/tmp/notifyfifo.$$ + +echo "INFO: Waiting for the Managed Server to accept requests..." +mkfifo "${statusfile}" || exit 1 +{ + # run tail in the background so that the shell can kill tail when notified + # that grep has exited + tail -f ${LOGFILE} & + # remember tail's PID + tailpid=$! + # wait for notification that grep has exited + read templine <${statusfile} + echo ${templine} + # grep has exited, time to go + kill "${tailpid}" +} | { + grep -m 1 "${grepPat}" + # notify the first pipeline stage that grep is done + echo "RUNNING"> ${LOGDIR}/ms.status + echo "INFO: Managed Server is running" + echo >${statusfile} +} + +# clean up +rm "${statusfile}" +if [ -f ${LOGDIR}/ms.status ]; then + echo "INFO: Managed server has been started" +fi + +childPID=$! +wait $childPID diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py new file mode 100755 index 0000000000..182259fcdf --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py @@ -0,0 +1,49 @@ +#!/usr/bin/python +# +# Author:swati.mukundan@oracle.com +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# SOA on Docker Default Domain +# +# Updates the listen address for managed server with the IP address of the host. +# +# Since : April, 2016 +# Author: swati.mukundan@oracle.com +# ============================================== +import sys +# +# Assigning values to variables +# ================================== +domain_name = os.environ.get("DOMAIN_NAME", "base_domain") +domain_root = os.environ.get("DOMAIN_ROOT", "/u01/oracle/user_projects/domains") + +# +# Reading db details and schema prefix passed from parent script +# ============================================================== +vol_name=sys.argv[1] +manserver_host=sys.argv[2] +server=sys.argv[3] +# +# Setting domain path +# =================== +domain_path = domain_root + '/' + domain_name +# +# +# +# Read domain for updates +# ======================= +readDomain(domain_path) +# +# +# Set listen address +# ================== +cd('/') +cd('/Server/'+server) +cmo.setListenAddress(manserver_host) + +# Creating domain +# ============================== +updateDomain() +closeDomain() +exit() diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download new file mode 100644 index 0000000000..10478c8d03 --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download @@ -0,0 +1,5 @@ +# +# Download Oracle SOA Suite for Oracle Middleware (BPM, FMW, SOA) +# OTN: http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html +# +649c2556d8222ee509cc9831333e6885 fmw_12.2.1.2.0_bpm_quickstart_generic.jar diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download new file mode 100644 index 0000000000..3d50d83af3 --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download @@ -0,0 +1,5 @@ +# +# Download Oracle SOA Suite for Oracle Middleware (BPM, FMW, SOA) +# OTN: http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html +# +4d10e995be556f8168ac7cd39a46f324 fmw_12.2.1.2.0_bpm_quickstart_generic2.jar diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/oraInst.loc b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/oraInst.loc new file mode 100644 index 0000000000..01f1964a55 --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/oraInst.loc @@ -0,0 +1,2 @@ +inventory_loc=/u01/oracle/.inventory +inst_group=oracle diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response new file mode 100644 index 0000000000..e4a4cf7229 --- /dev/null +++ b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response @@ -0,0 +1,13 @@ +# LICENSE CDDL 1.0 + GPL 2.0 +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +[ENGINE] + +#DO NOT CHANGE THIS. +Response File Version=1.0.0.0.0 + +[GENERIC] +INSTALL_TYPE=JDeveloper with Business Process Management + +DECLINE_SECURITY_UPDATES=true +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false diff --git a/OracleSOABPM/dockerfiles/README.md b/OracleSOABPM/dockerfiles/README.md new file mode 100644 index 0000000000..0283b8084d --- /dev/null +++ b/OracleSOABPM/dockerfiles/README.md @@ -0,0 +1,33 @@ +How to Build the image +====================== +Before you Start +---------------- +1. **FIRST TIME ONLY** + - Update the OracleSOABPM/setenv.sh file to point + to the right locations for the following environment variables + specific to your environment (See top of file) + DC_USERHOME, DC_REGISTRY_SOA, DC_REGISTRY_DB + - Update the OracleSOABPM/setenv.sh file with the proxy details + if you have an internal proxy - ensure that the proxy + related env variables are set + http_proxy, https_proxy, no_proxy + - Pull the base image into your local docker cache for builds. + You will need to provide your login credentials. + + ```sh +docker pull container-registry.oracle.com/java/serverjre:8u131 + ``` + +SOA|BPM|OSB Domain images +------------------------- +1. You must have the install binaries downloaded from the + [Oracle Technology Network](http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html) site before proceeding. +2. From the current directory OracleSOABPM/dockerfiles, run + these commands. You will be prompted with all the + information. Carefully review it and Confirm to proceed. + + ```sh +# Use BUILD_OPTS to add extra arguments to the docker build command +export BUILD_OPTS="--no-cache" +sh buildDockerImage.sh -v 12.2.1.2-soabpm + ``` diff --git a/OracleSOABPM/dockerfiles/buildDockerImage.sh b/OracleSOABPM/dockerfiles/buildDockerImage.sh new file mode 100755 index 0000000000..7a8e420891 --- /dev/null +++ b/OracleSOABPM/dockerfiles/buildDockerImage.sh @@ -0,0 +1,140 @@ +#!/bin/bash +# +# Script to build a Docker image for Oracle SOA suite. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. + +#============================================================= +usage() { +cat << EOF + +Usage: buildDockerImage.sh -v [version] + +Builds a Docker Image for Oracle SOA/OSB/BPM +Parameters: + -h: view usage + -v: Release version to build. Required. Allowed values are + 12.2.1.2-soabpm + +LICENSE CDDL 1.0 + GPL 2.0 +Copyright (c) 2016-2017: Oracle and/or its affiliates. All rights reserved. +EOF +exit 0 +} + +#============================================================= +checksumPackages() { + echo "INFO: Checking if required packages are present and valid..." + md5sum -c *.download 2> /dev/null + if [ "$?" -ne 0 ]; then + echo "ERROR: MD5 for required packages to build this image" + echo " did not match. Please make sure to download" + echo " missing files in folder dockerfiles. See" + echo " Dockerfile for more information" + exit $? + fi +} + +#============================================================= +#== MAIN starts here... +#============================================================= +VERSION="NONE" +SKIPMD5=0 +while getopts "hsdgiv:t:" optname; do + case "$optname" in + "h") + usage + ;; + "s") + SKIPMD5=1 + ;; + "v") + VERSION="$OPTARG" + ;; + *) + # Should not occur + echo "ERROR: Invalid argument. buildDockerImage.sh" + ;; + esac +done + +if [ "${VERSION}" = "NONE" ]; then + usage +fi + +. ../setenv.sh + +versionOK=false +if [[ $VERSION =~ .*soabpm.* ]] +then + suffix="-soabpm" + QSVERSION=${VERSION%$suffix} + IMAGE_NAME="${DC_REGISTRY_SOA}/middleware/soabpm:$QSVERSION-dev" + DOCKERFILE_NAME=Dockerfile + versionOK=true +fi + +if [ "${versionOK}" = "false" ]; then + echo "ERROR: Incorrect version ${VERSION} specified" + usage +fi + +# Go into version folder +cd $VERSION + +if [ ! "${SKIPMD5}" -eq 1 ]; then + checksumPackages +else + echo "INFO: Skipped MD5 checksum." +fi + +# Proxy settings - Set your own proxy environment +if [ "${http_proxy}" != "" ]; then + PROXY_SETTINGS="--build-arg http_proxy=${http_proxy}" +fi + +if [ "${https_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg https_proxy=${https_proxy}" +fi + +if [ "${no_proxy}" != "" ]; then + PROXY_SETTINGS="$PROXY_SETTINGS --build-arg no_proxy=${no_proxy}" +fi + +# ################## # +# BUILDING THE IMAGE # +# ################## # +buildCmd="docker build $BUILD_OPTS --force-rm=true $PROXY_SETTINGS -t $IMAGE_NAME -f $DOCKERFILE_NAME ." + +echo "INFO: Image : $IMAGE_NAME" +echo "INFO: Proxy : $PROXY_SETTINGS" +echo "INFO: BUILD_OPTS : ${BUILD_OPTS}" +echo "INFO: CWD : ${VERSION}" +echo "INFO: Build Command" +echo " [${buildCmd}]" +echo " " +read -p "INFO: Ctrl-C to abort or Press any key to continue..." + +# BUILD THE IMAGE (replace all environment variables) +BUILD_START=$(date '+%s') +${buildCmd} || { + echo "ERROR: There was an error building the image." + exit 1 +} +BUILD_END=$(date '+%s') +BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START` + +echo "" + +if [ $? -eq 0 ]; then + cat << EOF +INFO: Oracle SOA suite Docker Image for version: $VERSION + is ready to be extended. + --> $IMAGE_NAME +INFO: Build completed in $BUILD_ELAPSED seconds. + +EOF +else + echo "ERROR: Oracle SOA Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." +fi diff --git a/OracleSOABPM/samples/README.md b/OracleSOABPM/samples/README.md new file mode 100644 index 0000000000..1dd2b5bdd1 --- /dev/null +++ b/OracleSOABPM/samples/README.md @@ -0,0 +1,61 @@ +# Docker Compose to Orchestrate Containers + +1. **FIRST TIME ONLY** + - Update the OracleSOABPM/setenv.sh file to point + to the right locations for the following environment variables + specific to your environment (See top of file) + DC_USERHOME, DC_REGISTRY_SOA, DC_REGISTRY_DB + - Update the OracleSOABPM/setenv.sh file with the proxy details + if you have an internal proxy - ensure that the proxy + related env variables are set + http_proxy, https_proxy, no_proxy + +2. Setup your current environment + ```sh +exec bash (To replace your current shell with bash) +# cd OracleSOABPM/samples +. ../setenv.sh +``` + +3. Setup and start the Database + - Ensure port 1521 is free for use for the database + + ```sh +netstat -an | grep 1521 +``` + - Start the DB Container + + ```sh +docker-compose up -d soadb +docker logs -f soadb + ``` + +4. Starting the Admin Server Container. **DB MUST BE UP** + - Start AS - First Run will run RCU and create the SOA schemas, + Create the needed Domain (SOA/OSB/BPM etc) and Start the Admin + Server + - Subsequent runs should simply start the Admin Server + - Use **soaas|bpmas|osbas** depending on which one you want to start + + ```sh +docker-compose up -d soaas +docker logs -f soaas + ``` + - Verify Admin Server + http://host.acme.com:7001/console (weblogic/welcome1) + +5. Starting the Managed Server Container **ADMINSERVER MUST BE UP** + - Use **soaas|bpmas|osbas** depending on which one you want to start + + ```sh +docker-compose up -d soams +docker logs -f soams + ``` + - Verify Managed Server + SOA|BPM: http://host.acme.com:8001/soa-infra (weblogic/welcome1) + OSB: http://host.acme.com:7001/servicebus (weblogic/welcome1) + +6. [Compose Command line Reference Page](https://docs.docker.com/compose/reference/) + ```sh +docker-compose --help + ``` diff --git a/OracleSOABPM/samples/docker-compose.yml b/OracleSOABPM/samples/docker-compose.yml new file mode 100644 index 0000000000..32a10c29a3 --- /dev/null +++ b/OracleSOABPM/samples/docker-compose.yml @@ -0,0 +1,147 @@ +version: "3.0" + +services: + # + # The Oracle DB Definition + # + soadb: + image: ${DC_REGISTRY_DB}/oracle/database:12.2.0.1-ee + ports: + - "${DC_ORCL_PORT}:1521" + - "${DC_ORCL_OEM_PORT}:5500" + environment: + - ORACLE_SID=${DC_ORCL_SID} + - ORACLE_PDB=${DC_ORCL_PDB} + - ORACLE_PWD=${DC_ORCL_SYSPWD} + container_name: soadb + volumes: + - ${DC_ORCL_DBDATA}:/opt/oracle/oradata + + # + # The SOA Admin Server + # + soaas: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2-dev + container_name: soaas + command: /bin/bash -c "sleep 5s; /u01/oracle/dockertools/createDomainAndStart.sh" + ports: + - "7001:7001" + environment: + - DOMAIN_TYPE=soa + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PASSWORD=${DC_ADMIN_PWD} + - CONNECTION_STRING=${DC_ORCL_HOST}:${DC_ORCL_PORT}/${DC_ORCL_PDB} + - DB_PASSWORD=${DC_ORCL_SYSPWD} + - DB_SCHEMA_PASSWORD=${DC_RCU_SCHPWD} + - RCUPREFIX=${DC_RCU_SOAPFX} + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_SOA}:/u01/oracle/user_projects + + # + # The SOA Managed Server + # + soams: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2-dev + container_name: soams + depends_on: + - "soaas" + command: /bin/bash -c "/u01/oracle/dockertools/startMS.sh" + ports: + - "8001:8001" + - "8002:8002" + environment: + - DOMAIN_TYPE=soa + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PORT=7001 + - adminhostname=${DC_HOSTNAME} + - adminport=7001 + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_SOA}:/u01/oracle/user_projects + + # + # The BPM Admin Server + # + bpmas: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2-dev + container_name: bpmas + command: /bin/bash -c "sleep 5s; /u01/oracle/dockertools/createDomainAndStart.sh" + ports: + - "7001:7001" + environment: + - DOMAIN_TYPE=bpm + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PASSWORD=${DC_ADMIN_PWD} + - CONNECTION_STRING=${DC_ORCL_HOST}:${DC_ORCL_PORT}/${DC_ORCL_PDB} + - DB_PASSWORD=${DC_ORCL_SYSPWD} + - DB_SCHEMA_PASSWORD=${DC_RCU_SCHPWD} + - RCUPREFIX=${DC_RCU_BPMPFX} + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_BPM}:/u01/oracle/user_projects + + # + # The BPM Managed Server + # + bpmms: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2-dev + container_name: bpmms + depends_on: + - "bpmas" + command: /bin/bash -c "/u01/oracle/dockertools/startMS.sh" + ports: + - "8001:8001" + - "8002:8002" + environment: + - DOMAIN_TYPE=bpm + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PORT=7001 + - adminhostname=${DC_HOSTNAME} + - adminport=7001 + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_BPM}:/u01/oracle/user_projects + + # + # The OSB Admin Server + # + osbas: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2-dev + container_name: osbas + command: /bin/bash -c "sleep 5s; /u01/oracle/dockertools/createDomainAndStart.sh" + ports: + - "7001:7001" + environment: + - DOMAIN_TYPE=osb + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PASSWORD=${DC_ADMIN_PWD} + - CONNECTION_STRING=${DC_ORCL_HOST}:${DC_ORCL_PORT}/${DC_ORCL_PDB} + - DB_PASSWORD=${DC_ORCL_SYSPWD} + - DB_SCHEMA_PASSWORD=${DC_RCU_SCHPWD} + - RCUPREFIX=${DC_RCU_OSBPFX} + - MANAGED_SERVER=osb_server1 + volumes: + - ${DC_DDIR_OSB}:/u01/oracle/user_projects + + # + # The OSB Managed Server + # + osbms: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2-dev + container_name: osbms + depends_on: + - "osbas" + command: /bin/bash -c "/u01/oracle/dockertools/startMS.sh" + ports: + - "9001:9001" + - "9002:9002" + environment: + - DOMAIN_TYPE=osb + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PORT=7001 + - adminhostname=${DC_HOSTNAME} + - adminport=7001 + - MANAGED_SERVER=osb_server1 + volumes: + - ${DC_DDIR_OSB}:/u01/oracle/user_projects diff --git a/OracleSOABPM/setenv.sh b/OracleSOABPM/setenv.sh new file mode 100755 index 0000000000..c6af190c14 --- /dev/null +++ b/OracleSOABPM/setenv.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# +#=============================================== +# MUST: Customize this to your local env +#=============================================== +# +# Directory where all domains/db data etc are +# kept. Directories will be created here +export DC_USERHOME=/scratch/${USER}/docker + +# Registry names where requisite standard images +# can be found +export DC_REGISTRY_SOA="localhost" +export DC_REGISTRY_DB="localhost" + +# Proxy Environment +export http_proxy="" +export https_proxy="" +export no_proxy="" + +#=============================================== +exportComposeEnv() { + # + export DC_HOSTNAME=`hostname -f` + # + # Used by Docker Compose from the env + # Oracle DB Parameters + # + export DC_ORCL_PORT=1521 + export DC_ORCL_OEM_PORT=5500 + export DC_ORCL_SID=soadb + export DC_ORCL_PDB=soapdb + export DC_ORCL_SYSPWD=welcome1 + export DC_ORCL_HOST=${DC_HOSTNAME} + # + export DC_ORCL_DBDATA=${DC_USERHOME}/dbdata + # + # AdminServer Password + # + export DC_ADMIN_PWD=welcome1 + # + # RCU Common password for all schemas + Prefix Names + # + export DC_RCU_SCHPWD=welcome1 + export DC_RCU_SOAPFX=SOA01 + export DC_RCU_BPMPFX=BPM01 + export DC_RCU_OSBPFX=OSB01 + # + # Domain directories for the various domain types + # + export DC_DDIR_SOA=${DC_USERHOME}/soadomain + export DC_DDIR_BPM=${DC_USERHOME}/bpmdomain + export DC_DDIR_OSB=${DC_USERHOME}/osbdomain +} + +#=============================================== +createDirs() { + mkdir -p ${DC_ORCL_DBDATA} ${DC_DDIR_SOA} ${DC_DDIR_BPM} ${DC_DDIR_OSB} + chmod 777 ${DC_ORCL_DBDATA} ${DC_DDIR_SOA} ${DC_DDIR_BPM} ${DC_DDIR_OSB} +} + +#=============================================== +#== MAIN starts here +#=============================================== +# +echo "INFO: Setting up SOA Docker Environment..." +exportComposeEnv +createDirs +#echo "INFO: Environment variables" +#env | grep -e "DC_" | sort From 50ac2766cef7f3996599a3f014bd112c6a671081 Mon Sep 17 00:00:00 2001 From: Yagnesh Kotecha Date: Tue, 18 Jul 2017 21:49:11 -0700 Subject: [PATCH 2/2] Addressed review comments --- .../dockerfiles/12.2.1.2-soabpm/Dockerfile | 92 ------------------- ....1.2.0_bpm_quickstart_generic.jar.download | 5 - ...1.2.0_bpm_quickstart_generic2.jar.download | 5 - {OracleSOABPM => OracleSOASuite}/COPYRIGHT | 0 {OracleSOABPM => OracleSOASuite}/LICENSE | 0 {OracleSOABPM => OracleSOASuite}/README.md | 0 .../dockerfiles/12.2.1.2-soabpm/Dockerfile | 45 +++++++++ .../container-scripts/createDomain.py | 0 .../container-scripts/createDomainAndStart.sh | 40 ++++---- .../container-scripts/startAS.sh | 0 .../container-scripts/startMS.sh | 23 ++--- .../container-scripts/updListenAddress.py | 15 +-- .../dockerfiles/12.2.1.2-soabpm/oraInst.loc | 0 .../12.2.1.2-soabpm/soasuite.download | 10 ++ .../12.2.1.2-soabpm/soasuite.response | 4 +- .../dockerfiles/README.md | 11 --- .../dockerfiles/buildDockerImage.sh | 15 ++- .../samples/README.md | 18 +--- .../samples/docker-compose.yml | 12 +-- {OracleSOABPM => OracleSOASuite}/setenv.sh | 6 +- 20 files changed, 109 insertions(+), 192 deletions(-) delete mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile delete mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download delete mode 100644 OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download rename {OracleSOABPM => OracleSOASuite}/COPYRIGHT (100%) rename {OracleSOABPM => OracleSOASuite}/LICENSE (100%) rename {OracleSOABPM => OracleSOASuite}/README.md (100%) create mode 100644 OracleSOASuite/dockerfiles/12.2.1.2-soabpm/Dockerfile rename {OracleSOABPM => OracleSOASuite}/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py (100%) rename {OracleSOABPM => OracleSOASuite}/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh (90%) rename {OracleSOABPM => OracleSOASuite}/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh (100%) rename {OracleSOABPM => OracleSOASuite}/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh (72%) rename {OracleSOABPM => OracleSOASuite}/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py (80%) rename {OracleSOABPM => OracleSOASuite}/dockerfiles/12.2.1.2-soabpm/oraInst.loc (100%) create mode 100644 OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.download rename OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response => OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.response (71%) rename {OracleSOABPM => OracleSOASuite}/dockerfiles/README.md (66%) rename {OracleSOABPM => OracleSOASuite}/dockerfiles/buildDockerImage.sh (90%) rename {OracleSOABPM => OracleSOASuite}/samples/README.md (59%) rename {OracleSOABPM => OracleSOASuite}/samples/docker-compose.yml (90%) rename {OracleSOABPM => OracleSOASuite}/setenv.sh (94%) diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile deleted file mode 100644 index 4218865991..0000000000 --- a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/Dockerfile +++ /dev/null @@ -1,92 +0,0 @@ -# LICENSE CDDL 1.0 + GPL 2.0 -# -# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. -# -# ORACLE DOCKERFILES PROJECT -# -------------------------- -# This is the Dockerfile for Oracle BPM 12.2.1.2 Quick Start -# -# Base image of this dockerfile is the server JRE 8 docker image. -# -# REQUIRED FILES TO BUILD THIS IMAGE -# ---------------------------------- -# (1) fmw_12.2.1.2.0_bpm_quickstart_generic.jar & -# fmw_12.2.1.2.0_bpm_quickstart_generic2.jar -# (2) Download from OTN -# http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html -# - Download Queue/Selected Item -# - Oracle SOA Suite for Oracle Middleware (BPM, FMW, Service Oriented -# Architecture -# - Linux x86-64 -# - CONTINUE -# - Download Queue/Select Release -# - Oracle SOA Suite for Oracle Middleware 12.2.1.2.0 for Linux x86-64 -# - CONTINUE -# - Accept Terms -# - Download the following -# - V779125-01_1of2.zip -# Oracle Fusion Middleware 12c (12.2.1.2.0) Business Process Management -# Quick Start for Developers -# - V779125-01_2of2.zip -# Oracle Fusion Middleware 12c (12.2.1.2.0) Business Process Management -# Quick Start for Developers -# - Unzip to get the 2 jars mentioned above -# -# Pull base image -# --------------- -FROM container-registry.oracle.com/java/serverjre:8u131 -# -# Maintainer -# ---------- -MAINTAINER Prashanth Nagaraja -# -# -# Environment variables required for this build (do NOT change) -# ------------------------------------------------------------- -USER root -ENV FMW_JAR1=fmw_12.2.1.2.0_bpm_quickstart_generic.jar \ - FMW_JAR2=fmw_12.2.1.2.0_bpm_quickstart_generic2.jar \ - ORACLE_HOME=/u01/oracle \ - USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \ - PATH=$PATH:$JAVA_HOME/bin:$ORACLE_HOME/oracle_common/common/bin - -# Install OL7 required packages. Refer FMW 12.2.1.2 System requirements -# guide for complete list of packages -# Change the open file limits and kernel parameters that need changing -# Setup filesystem and oracle user -# Go to /u01 as user 'oracle' to proceed with SOA installation -#--------------------------------------------------------------- -# Proxy needs to be set before running yum in /etc/yum.conf -# Useful developer tools in the docker Image -# -RUN yum install -y unzip tar hostname && \ - yum clean all && \ - mkdir -p /u01 /u01/oracle/dockertools && \ - chmod a+xr /u01 && \ - useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \ - chown oracle:oracle -R /u01 -# -# Copy files and packages for install -# ----------------------------------- -ADD $FMW_JAR1 $FMW_JAR2 /u01/ -RUN cd /u01 && chmod 755 *.jar && chown oracle:oracle -R /u01 -# -USER oracle -COPY *.response oraInst.loc /u01/ -RUN cd /u01 && \ - $JAVA_HOME/bin/java -jar $FMW_JAR1 -silent -responseFile /u01/soabpm.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ - rm -f /u01/*.jar /u01/oraInst.loc /u01/*.response - -# -# Copy Domain creation scripts -# -USER root -COPY container-scripts/* /u01/oracle/dockertools/ -RUN chmod a+xr /u01/oracle/dockertools/*.* - -# -# Define default command to start bash. -# -USER oracle -WORKDIR $ORACLE_HOME -CMD ["/u01/oracle/dockertools/createDomainAndStart.sh"] diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download deleted file mode 100644 index 10478c8d03..0000000000 --- a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic.jar.download +++ /dev/null @@ -1,5 +0,0 @@ -# -# Download Oracle SOA Suite for Oracle Middleware (BPM, FMW, SOA) -# OTN: http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html -# -649c2556d8222ee509cc9831333e6885 fmw_12.2.1.2.0_bpm_quickstart_generic.jar diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download b/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download deleted file mode 100644 index 3d50d83af3..0000000000 --- a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/fmw_12.2.1.2.0_bpm_quickstart_generic2.jar.download +++ /dev/null @@ -1,5 +0,0 @@ -# -# Download Oracle SOA Suite for Oracle Middleware (BPM, FMW, SOA) -# OTN: http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html -# -4d10e995be556f8168ac7cd39a46f324 fmw_12.2.1.2.0_bpm_quickstart_generic2.jar diff --git a/OracleSOABPM/COPYRIGHT b/OracleSOASuite/COPYRIGHT similarity index 100% rename from OracleSOABPM/COPYRIGHT rename to OracleSOASuite/COPYRIGHT diff --git a/OracleSOABPM/LICENSE b/OracleSOASuite/LICENSE similarity index 100% rename from OracleSOABPM/LICENSE rename to OracleSOASuite/LICENSE diff --git a/OracleSOABPM/README.md b/OracleSOASuite/README.md similarity index 100% rename from OracleSOABPM/README.md rename to OracleSOASuite/README.md diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/Dockerfile b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/Dockerfile new file mode 100644 index 0000000000..1dd4aea593 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/Dockerfile @@ -0,0 +1,45 @@ +# LICENSE CDDL 1.0 + GPL 2.0 +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle SOA Suite 12.2.1.2 +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# See soasuite.download file in this directory +# +# Pull base image +# --------------- +FROM middleware/fmw-infrastructure:12.2.1.2 +# +# Maintainer +# ---------- +MAINTAINER Prashanth Nagaraja +# +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +USER root +ENV FMW_JAR1=fmw_12.2.1.2.0_soa.jar \ + FMW_JAR2=fmw_12.2.1.2.0_osb.jar + +# +# Copy files and packages for install +# ----------------------------------- +ADD $FMW_JAR1 $FMW_JAR2 /u01/ +COPY container-scripts/* /u01/oracle/dockertools/ +RUN cd /u01 && chmod 755 *.jar && chmod a+xr /u01/oracle/dockertools/*.* +# +USER oracle +COPY *.response oraInst.loc /u01/ +RUN cd /u01 && \ + $JAVA_HOME/bin/java -jar $FMW_JAR1 -silent -responseFile /u01/soasuite.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ + $JAVA_HOME/bin/java -jar $FMW_JAR2 -silent -responseFile /u01/soasuite.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="Service Bus" && \ + rm -f /u01/*.jar /u01/oraInst.loc /u01/*.response + +# +# Define default command to start bash. +# +WORKDIR $ORACLE_HOME +CMD ["/u01/oracle/dockertools/createDomainAndStart.sh"] diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py similarity index 100% rename from OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py rename to OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh similarity index 90% rename from OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh rename to OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh index cbb9d47536..1b3f10dd9c 100755 --- a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh @@ -60,6 +60,17 @@ setupRCU() { fi } +#================================================== +updateListenAddress() { + mkdir -p ${DOMAIN_HOME}/logs + + export thehost=`hostname -I` + echo "INFO: Updating the listen address - ${thehost} ${ADMIN_HOST}" + cmd="/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name ${thehost} AdminServer ${ADMIN_HOST}" + echo ${cmd} + ${cmd} > ${DOMAIN_HOME}/logs/aslisten.log 2>&1 +} + #================================================== #== MAIN starts here... #================================================== @@ -101,19 +112,12 @@ then echo "" fi -export CONNECTION_STRING=$CONNECTION_STRING -export RCUPREFIX=$RCUPREFIX -export ADMIN_PASSWORD=$ADMIN_PASSWORD -export DB_PASSWORD=$DB_PASSWORD -export DB_SCHEMA_PASSWORD=$DB_SCHEMA_PASSWORD -export DOMAIN_TYPE=$DOMAIN_TYPE - export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING export vol_name=u01 echo -e $DB_PASSWORD"\n"$DB_SCHEMA_PASSWORD > /tmp/pwd.txt -CTR_DIR=/$vol_name/oracle/user_projects/container +CTR_DIR=/$vol_name/oracle/user_projects/container/${DOMAIN_NAME} # # Creating schemas needed for sample domain #### @@ -132,7 +136,7 @@ then export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING fi else - mkdir $CTR_DIR + mkdir -p $CTR_DIR fi if [ -e $CTR_DIR/RCU.$RCUPREFIX.suc ] @@ -197,6 +201,7 @@ then echo "ERROR: Domain Configuration failed. Please check the logs" exit else + updateListenAddress # Write the Domain suc file... touch $CTR_DIR/SOA.DOMAINCFG.suc echo ${cfgCmd} >> $CTR_DIR/SOA.DOMAINCFG.suc @@ -212,21 +217,10 @@ EOF fi fi -if [ "$DOMAIN_TYPE" = "soa" ] || [ "$DOMAIN_TYPE" = "bpm" ] -then - server="soa_server1" -elif [ "$DOMAIN_TYPE" = "osb" ] -then - server="osb_server1" -else - echo "FATAL: Invalid domain type. Cannot start the servers" - exit 1 -fi - # # Creating domain env file #========================= -mkdir -p $DOMAIN_HOME/servers/AdminServer/security $DOMAIN_HOME/servers/$server/security +mkdir -p $DOMAIN_HOME/servers/AdminServer/security $DOMAIN_HOME/servers/${MANAGED_SERVER}/security # # Password less Adminserver starting @@ -237,8 +231,8 @@ echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/AdminServer/security/boo # # Password less Managed Server starting #====================================== -echo "username=weblogic" > $DOMAIN_HOME/servers/$server/security/boot.properties -echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/$server/security/boot.properties +echo "username=weblogic" > $DOMAIN_HOME/servers/${MANAGED_SERVER}/security/boot.properties +echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/${MANAGED_SERVER}/security/boot.properties # # Setting env variables diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh similarity index 100% rename from OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh rename to OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh similarity index 72% rename from OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh rename to OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh index 84cb5c9c0d..eba56720bb 100755 --- a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh @@ -10,7 +10,7 @@ export DOMAIN_HOME=${DOMAIN_ROOT}/${DOMAIN_NAME} function _int() { echo "INFO: Stopping container." echo "INFO: SIGINT received, shutting down Managed Server!" - $DOMAIN_HOME/bin/stopManagedWebLogic.sh $server "http://"$adminhostname:$adminport + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} exit; } @@ -18,14 +18,14 @@ function _int() { function _term() { echo "INFO: Stopping container." echo "INFO: SIGTERM received, shutting down Managed Server!" - $DOMAIN_HOME/bin/stopManagedWebLogic.sh $server "http://"$adminhostname:$adminport + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} exit; } #================================================================= function _kill() { echo "INFO: SIGKILL received, shutting down Managed Server!" - $DOMAIN_HOME/bin/stopManagedWebLogic.sh $server "http://"$adminhostname:$adminport + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} exit; } @@ -37,18 +37,13 @@ trap _term SIGTERM trap _kill SIGKILL export vol_name=u01 -export adminhostname=$adminhostname -export adminport=$adminport -# First Update the server in the domain -grepPat=" " if [ "$DOMAIN_TYPE" = "soa" ] || [ "$DOMAIN_TYPE" = "bpm" ] then - server="soa_server1" grepPat="SOA Platform is running and accepting requests" elif [ "$DOMAIN_TYPE" = "osb" ] then - server="osb_server1" + grepPat=" " else echo "ERROR: Invalid domain type. Cannot start the servers" exit @@ -58,13 +53,13 @@ LOGDIR=${DOMAIN_HOME}/logs LOGFILE=${LOGDIR}/ms.log mkdir -p ${LOGDIR} -export soa_host=`hostname -I` -echo "INFO: Updating the Host name listen address" -/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name $soa_host $server > ${LOGDIR}/mslisten.log 2>&1 +export thehost=`hostname -I` +echo "INFO: Updating the listen address - ${thehost} ${ADMIN_HOST}" +/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name $thehost ${MANAGED_SERVER} ${ADMIN_HOST} > ${LOGDIR}/mslisten.log 2>&1 # Start SOA server -echo "INFO: Starting the managed server ${server}" -$DOMAIN_HOME/bin/startManagedWebLogic.sh $server "http://"$adminhostname:$adminport > ${LOGFILE} 2>&1 & +echo "INFO: Starting the managed server ${MANAGED_SERVER}" +$DOMAIN_HOME/bin/startManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} > ${LOGFILE} 2>&1 & statusfile=/tmp/notifyfifo.$$ echo "INFO: Waiting for the Managed Server to accept requests..." diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py similarity index 80% rename from OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py rename to OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py index 182259fcdf..e06eb38a89 100755 --- a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py @@ -1,21 +1,14 @@ #!/usr/bin/python # -# Author:swati.mukundan@oracle.com -# # Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. -# -# SOA on Docker Default Domain -# # Updates the listen address for managed server with the IP address of the host. -# -# Since : April, 2016 -# Author: swati.mukundan@oracle.com # ============================================== +# import sys # # Assigning values to variables -# ================================== -domain_name = os.environ.get("DOMAIN_NAME", "base_domain") +# ============================= +domain_name = os.environ.get("DOMAIN_NAME", "soainfra") domain_root = os.environ.get("DOMAIN_ROOT", "/u01/oracle/user_projects/domains") # @@ -24,6 +17,7 @@ vol_name=sys.argv[1] manserver_host=sys.argv[2] server=sys.argv[3] +exthost=sys.argv[4] # # Setting domain path # =================== @@ -41,6 +35,7 @@ cd('/') cd('/Server/'+server) cmo.setListenAddress(manserver_host) +cmo.setExternalDNSName(exthost) # Creating domain # ============================== diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/oraInst.loc b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/oraInst.loc similarity index 100% rename from OracleSOABPM/dockerfiles/12.2.1.2-soabpm/oraInst.loc rename to OracleSOASuite/dockerfiles/12.2.1.2-soabpm/oraInst.loc diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.download b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.download new file mode 100644 index 0000000000..c6c825387e --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.download @@ -0,0 +1,10 @@ +# +# Download Oracle SOA Suite for Oracle Middleware (BPM, FMW, SOA) OTN: +# http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html +# +# - V789369-01.zip - Oracle Fusion Middleware 12c (12.2.1.2.0) SOA Suite +# and Business Process Management +# - V779126-01.zip - Oracle Fusion Middleware 12c (12.2.1.2.0) Service Bus +# +87bc97d2240150930262249812b24a1a fmw_12.2.1.2.0_soa.jar +208dc087e3cbb679e6938d8416d1bf39 fmw_12.2.1.2.0_osb.jar diff --git a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.response similarity index 71% rename from OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response rename to OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.response index e4a4cf7229..19faeb98bc 100644 --- a/OracleSOABPM/dockerfiles/12.2.1.2-soabpm/soabpm.response +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.response @@ -7,7 +7,9 @@ Response File Version=1.0.0.0.0 [GENERIC] -INSTALL_TYPE=JDeveloper with Business Process Management +#INSTALL_TYPE=JDeveloper with Business Process Management +#INSTALL_TYPE=Service Bus +INSTALL_TYPE=BPM DECLINE_SECURITY_UPDATES=true SECURITY_UPDATES_VIA_MYORACLESUPPORT=false diff --git a/OracleSOABPM/dockerfiles/README.md b/OracleSOASuite/dockerfiles/README.md similarity index 66% rename from OracleSOABPM/dockerfiles/README.md rename to OracleSOASuite/dockerfiles/README.md index 0283b8084d..afb733630d 100644 --- a/OracleSOABPM/dockerfiles/README.md +++ b/OracleSOASuite/dockerfiles/README.md @@ -7,16 +7,6 @@ Before you Start to the right locations for the following environment variables specific to your environment (See top of file) DC_USERHOME, DC_REGISTRY_SOA, DC_REGISTRY_DB - - Update the OracleSOABPM/setenv.sh file with the proxy details - if you have an internal proxy - ensure that the proxy - related env variables are set - http_proxy, https_proxy, no_proxy - - Pull the base image into your local docker cache for builds. - You will need to provide your login credentials. - - ```sh -docker pull container-registry.oracle.com/java/serverjre:8u131 - ``` SOA|BPM|OSB Domain images ------------------------- @@ -28,6 +18,5 @@ SOA|BPM|OSB Domain images ```sh # Use BUILD_OPTS to add extra arguments to the docker build command -export BUILD_OPTS="--no-cache" sh buildDockerImage.sh -v 12.2.1.2-soabpm ``` diff --git a/OracleSOABPM/dockerfiles/buildDockerImage.sh b/OracleSOASuite/dockerfiles/buildDockerImage.sh similarity index 90% rename from OracleSOABPM/dockerfiles/buildDockerImage.sh rename to OracleSOASuite/dockerfiles/buildDockerImage.sh index 7a8e420891..0ee7ce5aa5 100755 --- a/OracleSOABPM/dockerfiles/buildDockerImage.sh +++ b/OracleSOASuite/dockerfiles/buildDockerImage.sh @@ -16,9 +16,11 @@ Parameters: -h: view usage -v: Release version to build. Required. Allowed values are 12.2.1.2-soabpm + -s: Skip checksum verification LICENSE CDDL 1.0 + GPL 2.0 Copyright (c) 2016-2017: Oracle and/or its affiliates. All rights reserved. + EOF exit 0 } @@ -28,10 +30,13 @@ checksumPackages() { echo "INFO: Checking if required packages are present and valid..." md5sum -c *.download 2> /dev/null if [ "$?" -ne 0 ]; then - echo "ERROR: MD5 for required packages to build this image" - echo " did not match. Please make sure to download" - echo " missing files in folder dockerfiles. See" - echo " Dockerfile for more information" + cat <