Skip to content

Commit 0e9080d

Browse files
committed
resolve merge conflicts
2 parents 364b576 + 7367dd1 commit 0e9080d

File tree

3 files changed

+40
-15
lines changed

3 files changed

+40
-15
lines changed

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The following prerequisites must be handled prior to running the create domain s
88
* Make sure the WebLogic operator is running.
99
* Create a Kubernetes namespace for the domain unless the intention is to use the default namespace.
1010
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain.
11-
* Build the Oracle WebLogic image `oracle/weblogic:12.2.1.3-developer`. Refer to [Oracle WebLogic Server on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles/12.2.1.3).
11+
* Build the Oracle WebLogic image `oracle/weblogic:12.2.1.3-developer`. Refer to [Oracle WebLogic Server on Docker](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/dockerfiles/12.2.1.3). If a different `baseImage` (see Configuration table below) is specified, the specified image needs to be built locally or pulled from a repository.
1212

1313
## Use the script to create a domain
1414

@@ -28,11 +28,8 @@ The script will perform the following steps:
2828
* Create a properties file, `domain.properties`, in the directory that is created above. This properties file will be used to create a sample WebLogic Server domain.
2929
* Clone the weblogic docker-images project via the `git clone https://github.com/oracle/docker-images.git` into the current directory.
3030
* Replace the built-in username and password in the `properties/docker_build/domain_security.properties` file with the `username` and `password` that are supplied in the command line via the `-u` and `-p` options. These credentials need to match the WebLogic domain admin credentials in the secret that is specified via `weblogicCredentialsSecretName` property in the `create-domain-inputs.yaml` file.
31-
* Build a Docker image based on the Docker sample, [Example Image with a WebLogic Server Domain](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image). It will create a sample WebLogic Server domain in the Docker image. Also, you can run the Docker sample, [Example Image with a WebLogic Server Domain](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image), manually with the generated `domain.properties` to create a domain home image. **Note**: Oracle recommends keeping the domain home image private in the local repository.
32-
* Create a Kubernetes domain YAML file, `domain.yaml`, in the directory that is created above. This YAML file can be used to create the Kubernetes resource using the `kubectl create -f` or `kubectl apply -f` command:
33-
```
34-
kubectl apply -f /path/to/output-directory/weblogic-domains/<domainUID>/domain.yaml
35-
```
31+
* Build a Docker image based on the Docker sample, [Example Image with a WebLogic Server Domain using the Oracle WebLogic Deploy Tooling (WDT)](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image-wdt) and [Example Image with a WebLogic Server Domain using WLST](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image). It will create a sample WebLogic Server domain in the Docker image. Also, you can run the Docker sample, [Example Image with a WebLogic Server Domain](https://github.com/oracle/docker-images/tree/master/OracleWebLogic/samples/12213-domain-home-in-image), manually with the generated `domain.properties` to create a domain home image. **Note**: Oracle recommends keeping the domain home image private in the local repository.
32+
* Create a Kubernetes domain YAML file, `domain.yaml`, in the directory that is created above. This YAML file can be used to create the Kubernetes resource using the `kubectl create -f` or `kubectl apply -f` command.
3633

3734
As a convenience, using the `-e` option, the script can optionally create the domain object, which in turn results in the creation of the corresponding WebLogic Server pods and services.
3835

@@ -71,13 +68,14 @@ The following parameters can be provided in the inputs file.
7168
| `adminPort` | Port number for the Administration Server inside the Kubernetes cluster. | `7001` |
7269
| `adminNodePort` | Port number of the Administration Server outside the Kubernetes cluster. | `30701` |
7370
| `adminServerName` | Name of the Administration Server. | `admin-server` |
74-
| `baseImage` | The image that is used to build the domain-home-in-image Docker image. If not specified, use the built-in base image `oracle/weblogic:12.2.1.3-developer`. | `oracle/weblogic:12.2.1.3-developer` |
71+
| `baseImage` | The image that is used to build the domain-home-in-image Docker image. If not specified, use the built-in base image `oracle/weblogic:12.2.1.3-developer`. The image specified here needs to be built locally or pulled from a repository before the `create-domain.sh` script is executed. | `oracle/weblogic:12.2.1.3-developer` |
7572
| `clusterName` | Name of the WebLogic cluster instance to generate for the domain. | `cluster-1` |
7673
| `clusterType` | Type of the WebLogic Cluster. Legal values are `CONFIGURED` or `DYNAMIC`. | `DYNAMIC` |
7774
| `configuredManagedServerCount` | Number of Managed Server instances to generate for the domain. | `2` |
7875
| `domainUID` | Unique ID that will be used to identify this particular domain. Used as the name of the generated WebLogic domain as well as the name of the Kubernetes domain resource. This ID must be unique across all domains in a Kubernetes cluster. This ID cannot contain any character that is not valid in a Kubernetes service name. | `domain1` |
7976
| `exposeAdminNodePort` | Boolean indicating if the Administration Server is exposed outside of the Kubernetes cluster. | `false` |
8077
| `exposeAdminT3Channel` | Boolean indicating if the T3 administrative channel is exposed outside the Kubernetes cluster. | `false` |
78+
| `imagePath` | The relative directory of the WebLogic domain home in image Docker image in `https://github.com/oracle/docker-images.git` project under the `docker-images/OracleWebLogic/samples` directory. | `12213-domain-home-in-image-wdt` |
8179
| `includeServerOutInPodLog` | Boolean indicating whether to include server .out to the pod's stdout. | `true` |
8280
| `initialManagedServerReplicas` | Number of Managed Servers to initially start for the domain. | `2` |
8381
| `javaOptions` | Java options for starting the Administration and Managed Servers. A Java option can have references to one or more of the following pre-defined variables to obtain WebLogic domain information: `$(DOMAIN_NAME)`, `$(DOMAIN_HOME)`, `$(ADMIN_NAME)`, `$(ADMIN_PORT)`, and `$(SERVER_NAME)`. | `-Dweblogic.StdoutDebugEnabled=false` |

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,17 @@ exposeAdminNodePort: false
7070
# Name of the domain namespace
7171
namespace: default
7272

73-
#Java Option for Weblogic Server
73+
# Java Option for Weblogic Server
7474
javaOptions: -Dweblogic.StdoutDebugEnabled=false
7575

76-
#Base image used to build the domain home in image Docker image
77-
#If not specified, use the built-in base image oracle/weblogic:12.2.1.3-developer
76+
# Base image used to build the domain home in image Docker image
77+
# If not specified, use the built-in base image oracle/weblogic:12.2.1.3-developer
7878
baseImage: oracle/weblogic:12.2.1.3-developer
7979

80+
# The relative directory of the WebLogic domain home in image Docker image in the i
81+
# `https://github.com/oracle/docker-images.git` project under the `docker-images/OracleWebLogic/samples` directory.
82+
# If not specified, use 12213-domain-home-in-image-wdt.
83+
# Another possible value is 12213-domain-home-in-image which uses WLST script instead of WDT to
84+
# generate the domain home.
85+
imagePath: 12213-domain-home-in-image-wdt
86+

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,36 @@ function createFiles {
234234
function createDomainHome {
235235
cp ${domainPropertiesOutput} ./docker-images/OracleWebLogic/samples/12213-domain-home-in-image/properties/docker_build
236236

237-
cd docker-images/OracleWebLogic/samples/12213-domain-home-in-image
237+
if [ -z $imagePath ]; then
238+
imagePath="12213-domain-home-in-image-wdt"
239+
fi
240+
241+
cd docker-images/OracleWebLogic/samples/${imagePath}
242+
243+
# 12213-domain-home-in-image use one properties file for the credentials
244+
usernameFile="properties/docker_build/domain_security.properties"
245+
passwordFile="properties/docker_build/domain_security.properties"
238246

239-
sed -i -e "s|myuser|${username}|g" properties/docker_build/domain_security.properties
240-
sed -i -e "s|mypassword1|${password}|g" properties/docker_build/domain_security.properties
247+
# 12213-domain-home-in-image-wdt uses two properties files for the credentials
248+
if [ ! -f $usernameFile ]; then
249+
usernameFile="properties/docker-build/adminuser.properties"
250+
passwordFile="properties/docker-build/adminpass.properties"
251+
fi
252+
253+
sed -i -e "s|myuser|${username}|g" $usernameFile
254+
sed -i -e "s|mypassword1|${password}|g" $passwordFile
255+
256+
# use the existence of build-archive.sh file to determine if we need to download WDT
257+
if [ -f "build-archive.sh" ]; then
258+
sh ./build-archive.sh
259+
wget https://github.com/oracle/weblogic-deploy-tooling/releases/download/weblogic-deploy-tooling-0.14/weblogic-deploy.zip
260+
fi
241261

242262
if [ ! -z $baseImage ]; then
243-
sed -i -e "s|oracle/weblogic:12.2.1.3-developer|${baseImage}|g" Dockerfile
263+
sed -i -e "s|\(FROM \).*|\1 ${baseImage}|g" Dockerfile
244264
fi
245265

246-
./build.sh
266+
sh ./build.sh
247267

248268
if [ "$?" != "0" ]; then
249269
fail "Create domain ${domainName} failed."

0 commit comments

Comments
 (0)