Skip to content

Commit 9650906

Browse files
committed
Issue #130 - Add a docker sample that creates a domain from a WDT model
1 parent 4e65259 commit 9650906

File tree

5 files changed

+208
-0
lines changed

5 files changed

+208
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved.
2+
#
3+
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
4+
#
5+
# ORACLE DOCKERFILES PROJECT
6+
# --------------------------
7+
# This Dockerfile extends the Oracle WebLogic image by creating a sample domain.
8+
#
9+
# Util scripts are copied into the image enabling users to plug NodeManager
10+
# automatically into the AdminServer running on another container.
11+
#
12+
# HOW TO BUILD THIS IMAGE
13+
# -----------------------
14+
# Put all downloaded files in the same directory as this Dockerfile
15+
# Run:
16+
# $ sudo docker build \
17+
# --build-arg WDT_MODEL=simple-topology.yaml \
18+
# -t 12213-domain-wdt .
19+
#
20+
# Pull base image
21+
# ---------------
22+
FROM store/oracle/weblogic:12.2.1.3
23+
24+
# Maintainer
25+
# ----------
26+
MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
27+
28+
ARG WDT_MODEL
29+
ARG WDT_ARCHIVE
30+
31+
# WLS Configuration
32+
# ---------------------------
33+
ENV ADMIN_HOST="wlsadmin" \
34+
NM_PORT="5556" \
35+
MS_PORT="8001" \
36+
DEBUG_PORT="8453" \
37+
ORACLE_HOME=/u01/oracle \
38+
SCRIPT_FILE=/u01/oracle/createAndStartWLSDomain.sh \
39+
CONFIG_JVM_ARGS="-Dweblogic.security.SSL.ignoreHostnameVerification=true" \
40+
PATH=$PATH:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain}/bin:/u01/oracle
41+
42+
# Domain and Server environment variables
43+
# ------------------------------------------------------------
44+
ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
45+
PRE_DOMAIN_HOME=/u01/oracle/user_projects \
46+
ADMIN_PORT="${ADMIN_PORT:-7001}" \
47+
WDT_MODEL="$WDT_MODEL" \
48+
WDT_ARCHIVE="$WDT_ARCHIVE"
49+
50+
# Add files required to build this image
51+
COPY container-scripts/* /u01/oracle/
52+
COPY weblogic-deploy.zip /u01
53+
COPY ${WDT_MODEL} ${ARCHIVE_FILE} /u01/
54+
55+
#Create directory where domain will be written to
56+
USER root
57+
RUN chmod +xw /u01/oracle/*.sh && \
58+
chmod +xw /u01/oracle/*.py && \
59+
mkdir -p $PRE_DOMAIN_HOME && \
60+
mkdir -p $PRE_DOMAIN_HOME/domains && \
61+
chmod a+xr $PRE_DOMAIN_HOME && \
62+
chown -R oracle:oracle $PRE_DOMAIN_HOME && \
63+
cd /u01 && \
64+
$JAVA_HOME/bin/jar xf /u01/weblogic-deploy.zip && \
65+
chmod +xw /u01/weblogic-deploy/bin/*.sh && \
66+
chmod -R +xw /u01/weblogic-deploy/lib/python && \
67+
if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file /u01/$WDT_MODEL"; fi && \
68+
if [ -n "$WDT_ARCHIVE" ]; then MODEL_OPT="-archive_file /u01/$WDT_ARCHIVE"; fi && \
69+
/u01/weblogic-deploy/bin/createDomain.sh \
70+
-oracle_home /u01/oracle \
71+
-java_home ${JAVA_HOME} \
72+
-domain_parent /u01/oracle/user_projects/domains \
73+
-domain_type WLS \
74+
$MODEL_OPT \
75+
$ARCHIVE_OPT
76+
77+
VOLUME $PRE_DOMAIN_HOME
78+
# Expose Node Manager default port, and also default for admin and managed server
79+
EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT $DEBUG_PORT
80+
81+
USER oracle
82+
WORKDIR $ORACLE_HOME
83+
84+
# Define default command to start bash.
85+
CMD ["/u01/oracle/startWLSDomain.sh"]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
#
3+
#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved.
4+
#
5+
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6+
#
7+
docker build \
8+
--build-arg WDT_MODEL=simple-topology.yaml \
9+
-t 12213-domain-wdt .
10+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ADMIN_PORT=7001
2+
ADMIN_HOST=wlsadmin
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
#
3+
#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved.
4+
#
5+
#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6+
#
7+
# Start the Domain.
8+
9+
# determine the domain name. there is only one domain directory.
10+
export DOMAIN_NAME=`ls /u01/oracle/user_projects/domains | head -1`
11+
12+
#Define DOMAIN_HOME
13+
export DOMAIN_HOME=/u01/oracle/user_projects/domains/$DOMAIN_NAME
14+
15+
# Start Admin Server and tail the logs
16+
${DOMAIN_HOME}/startWebLogic.sh
17+
touch ${DOMAIN_HOME}/servers/AdminServer/logs/AdminServer.log
18+
tail -f ${DOMAIN_HOME}/servers/AdminServer/logs/AdminServer.log &
19+
20+
childPID=$!
21+
wait $childPID
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
domainInfo:
2+
AdminUserName: weblogic
3+
AdminPassword: welcome1
4+
ServerStartMode: dev
5+
topology:
6+
Name: my_domain
7+
AdminServerName: AdminServer
8+
Cluster:
9+
mycluster:
10+
ClientCertProxyEnabled: true
11+
Server:
12+
AdminServer:
13+
Machine: machine1
14+
ListenPort: 7001
15+
SSL:
16+
Enabled: true
17+
ListenPort: 7002
18+
m1:
19+
Machine: machine1
20+
ListenPort: 9003
21+
Cluster: mycluster
22+
ServerStart:
23+
ClassPath: '@@PWD@@/src/test/resources/nosuch.jar'
24+
Arguments: '-Dosgi=true'
25+
SSL:
26+
Enabled: true
27+
ListenPort: 9004
28+
m2:
29+
Machine: machine1
30+
ListenPort: 9005
31+
Cluster: mycluster
32+
ServerStart:
33+
ClassPath: '@@PWD@@/src/test/resources/nosuch.jar'
34+
Arguments: '-Dosgi=true'
35+
SSL:
36+
Enabled : true
37+
ListenPort: 9006
38+
ServerTemplate:
39+
template1:
40+
Machine: machine1
41+
ListenPort: 9008
42+
SSL:
43+
Enabled: true
44+
ListenPort: 9009
45+
Machine:
46+
machine1:
47+
Notes: The only machine
48+
NodeManager:
49+
NMType: SSL
50+
ListenPort: 5556
51+
Notes: The only node manager
52+
SecurityConfiguration:
53+
NodeManagerUsername: weblogic
54+
NodeManagerPasswordEncrypted: welcome1
55+
JMX:
56+
InvocationTimeoutSeconds: 40
57+
Notes: JMX notes
58+
ManagedServerNotificationsEnabled: true
59+
JTA:
60+
MaxTransactions: 4
61+
Notes: JTA notes
62+
resources:
63+
JDBCStore:
64+
JDBCStore99:
65+
Notes: JDBC store notes
66+
Target: m1
67+
DataSource: Generic1
68+
JDBCSystemResource:
69+
Generic1:
70+
Target: mycluster
71+
JdbcResource:
72+
JDBCDataSourceParams:
73+
JNDIName: [ jdbc/generic1, jdbc/special1 ]
74+
GlobalTransactionsProtocol: TwoPhaseCommit
75+
JDBCDriverParams:
76+
DriverName: oracle.jdbc.xa.client.OracleXADataSource
77+
URL: 'jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=slc05til.us.oracle.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=orcl.us.oracle.com)))'
78+
PasswordEncrypted: welcome1
79+
Properties:
80+
user:
81+
Value: jshum
82+
oracle.net.CONNECT_TIMEOUT:
83+
Value: 5000
84+
oracle.jdbc.ReadTimeout:
85+
Value: 30000
86+
JDBCConnectionPoolParams:
87+
InitialCapacity: 3
88+
MaxCapacity: 15
89+
TestTableName: SQL ISVALID
90+
TestConnectionsOnReserve: true

0 commit comments

Comments
 (0)