Skip to content

Commit 8682342

Browse files
Changes to readme and copyright
1 parent c6ddf1a commit 8682342

File tree

2 files changed

+65
-16
lines changed

2 files changed

+65
-16
lines changed

samples/docker-domain/Dockerfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved.
1+
#Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
22
#
33
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44
#
@@ -11,19 +11,21 @@
1111
#
1212
# HOW TO BUILD THIS IMAGE
1313
# -----------------------
14-
# Put all downloaded files in the same directory as this Dockerfile
14+
1515
# Build the deployment archive file using the build-archive.sh script.
1616
# $ ./build-archive.sh
1717
#
1818
# Run:
1919
# $ sudo docker build \
20-
# --build-arg ADMIN_HOST=wlsadmin
21-
# --build-arg ADMIN_PORT=7001
22-
# --build-arg MS_PORT=8001
23-
# --build-arg DOMAIN_NAME=base_domain
20+
# --build-arg CUSTOM_ADMIN_HOST=wlsadmin \
21+
# --build-arg CUSTOM_ADMIN_PORT=7001 \
22+
# --build-arg CUSTOM_ADMIN_NAME=7001 \
23+
# --build-arg CUSTOM_MANAGED_SERVER_PORT=8001 \
24+
# --build-arg CUSTOM_DOMAIN_NAME=base_domain \
25+
# --build-arg CUSTOM_DEBUG_PORT=8453 \
2426
# --build-arg WDT_MODEL=simple-topology.yaml \
2527
# --build-arg WDT_ARCHIVE=archive.zip \
26-
# --build-arg WDT_VARIABLE=domain.properties \
28+
# --build-arg WDT_VARIABLE=properties/docker-build/domain.properties \
2729
# --force-rm=true \
2830
# -t 12213-domain-wdt .
2931
#
@@ -34,7 +36,7 @@
3436
# The sample model replaces the attributes with tokens that are resolved fromn values in the
3537
# corresponding property file domain.properties. The container-scripts/setEnv.sh script
3638
# demonstrates parsing the variable file to build a string of --build-args that can
37-
# be passed on the docker builds command.
39+
# be passed on the docker build command.
3840
#
3941
# Pull base image
4042
# ---------------
@@ -83,8 +85,7 @@ COPY weblogic-deploy.zip ${WDT_HOME}
8385
COPY container-scripts/* ${SCRIPT_HOME}/
8486

8587
# Create the properties file directory and the domain home parent with the correct permissions / owner.
86-
# Unzip and install the WDT image.
87-
# Export variable file values into the environment
88+
# Unzip and install the WDT image and change the permissions / owner.
8889
USER root
8990
RUN chmod +xw $SCRIPT_HOME/*.sh && \
9091
chown -R oracle:oracle ${SCRIPT_HOME} && \
@@ -143,5 +144,5 @@ EXPOSE $ADMIN_PORT $MANAGED_SERVER_PORT $DEBUG_PORT
143144

144145
WORKDIR $DOMAIN_HOME
145146

146-
# Define default command to start bash.
147+
# Define default command to start Admin Server in a container.
147148
CMD ["/u01/oracle/startAdminServer.sh"]

samples/docker-domain/README.md

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,78 @@ This sample deploys a simple, one-page web application contained in a ZIP archiv
3333

3434
$ ./build-archive.sh
3535

36-
To build this sample, run:
36+
The sample requires the Admin Host, Admin Port and Admin Name. It also requires the Managed Server port and the domain Debug
37+
Port. The ports will be EXPOSED through Docker The other arguments are persisted in the image to be used when running a
38+
container. If an attribute is not provided as a --build-arg on the build command, the following defaults are set.
39+
40+
CUSTOM_ADMIN_NAME = admin-server
41+
The value is persisted to the image as ADMIN_NAME
42+
43+
CUSTOM_ADMIN_HOST = wlsadmin
44+
The value is persisted to the image as ADMIN_HOST
45+
46+
CUSTOM_ADMIN_PORT = 7001
47+
The value is persisted to the image as ADMIN_PORT
48+
49+
CUSTOM_MANAGED_SERVER_PORT = 8001
50+
The value is persisted to the image as MANAGED_SERVER_PORT
51+
52+
CUSTOM_DEBUG_PORT = 8453
53+
The value is persisted to the image as DEBUG_PORT
54+
55+
CUSTOM_DOMAIN_NAME = base_domain
56+
The value is persisted to the image as DEBUG_NAME
57+
58+
To build this sample taking the defaults, run:
3759

3860
$ docker build \
3961
--build-arg WDT_MODEL=simple-topology.yaml \
4062
--build-arg WDT_ARCHIVE=archive.zip \
41-
--build-arg WDT_VARIABLE=container-scripts/domain.properties \
63+
--build-arg WDT_VARIABLE=properties/docker-build/domain.properties \
4264
--force-rm=true \
4365
-t 12213-domain-wdt .
4466

4567
This will use the model, variable and archive files in the sample directory.
4668

47-
The Admin Server and each Managed Server are run in containers from this build image. The admin server credentials, required for running the admin server or a managed server, are provided in a properties file. This sample contains a credentials properties file in the properties/docker_run directory, which can be mounted into a volume on the container image. It is the responsibility of the user to mange the properties file in this mounted container volume.
69+
This sample provides a script which will read the model variable file and parse the domain, admin and managed server information
70+
into a string of --build-arg statements. This build arg string is exported as environment variable BUILD_ARG.
71+
The sample script specifically parses the sample variable file. Use it as an example to parse a custom variable file.
72+
This will insure that the values docker exposes and persists in the image are the same values configured in the domain.
73+
74+
To parse the sample variable file and build the sample, run:
75+
76+
$ container-scripts/setEnv.sh properties/docker-build/domain.properties
77+
78+
$ docker build \
79+
$BUILD_ARG \
80+
--build-arg WDT_MODEL=simple-topology.yaml \
81+
--build-arg WDT_ARCHIVE=archive.zip \
82+
--build-arg WDT_VARIABLE=properties/docker-build/domain.properties \
83+
--force-rm=true \
84+
-t 12213-domain-wdt .
85+
86+
This sample provides a Derby Data Source that is targeted to the Managed Server cluster. The Derby database is created
87+
in the Admin Server container when the container is run. To turn off the database create, set DERBY_FLAG="false" in the
88+
runtime security.properties used on the docker run statement.
89+
90+
The Admin Server and each Managed Server are run in containers from this build image. In this sample, the admin server
91+
credentials, required for running both the admin server and a managed server, are provided on the docker run command in
92+
a properties file. The sample properties file also sets the JAVA_OPTS for the running Admin or Managed server. The
93+
properties file also contains the DERBY_FLAG to control the Derby database create. Mount the properties/docker-run directory
94+
to the container. This directory contains the properties file security.properties. It is the responsibility of
95+
the user to manage this volume, and the security.properties, in the container.
4896

4997
To start the containerized Administration Server, run:
5098

5199
$ docker run -d --name wlsadmin --hostname wlsadmin -p 7001:7001 -v <sample-directory>/properties/docker_run:/u01/oracle/properties 12213-domain-wdt
52100

53101
To start a containerized Managed Server (ms-1) to self-register with the Administration Server above, run:
54102

55-
$ docker run -d --name ms-1 --link wlsadmin:wlsadmin -p 9001:9001 -v <sample-directory>/properties/docker_run:/u01/oracle/properties -e MS_NAME=ms-1 12213-domain-wdt startManagedServer.sh
103+
$ docker run -d --name ms-1 --link wlsadmin:wlsadmin -p 9001:9001 -v <sample-directory>/properties/docker_run:/u01/oracle/properties -e MANAGED_SERVER_NAME=managed-server-1 12213-domain-wdt startManagedServer.sh
56104

57105
To start an additional Managed Server (in this example ms-2), run:
58106

59-
$ docker run -d --name ms-2 --link wlsadmin:wlsadmin -p 9002:9001 -v <sample-directory>/properties/docker_run/:/u01/oracle/properties -e MS_NAME=ms-2 12213-domain-wdt startManagedServer.sh
107+
$ docker run -d --name ms-2 --link wlsadmin:wlsadmin -p 9002:9001 -v <sample-directory>/properties/docker_run/:/u01/oracle/properties -e MANAGED_SERVER_NAME=managed-server-2 12213-domain-wdt startManagedServer.sh
60108

61109
The above scenario from this sample will give you a WebLogic domain with a dynamic cluster set up on a single host environment.
62110

0 commit comments

Comments
 (0)