Skip to content

Commit ec52a79

Browse files
Changes to properties
1 parent e2b0063 commit ec52a79

File tree

8 files changed

+135
-79
lines changed

8 files changed

+135
-79
lines changed

samples/docker-domain/Dockerfile

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -29,70 +29,81 @@ FROM oracle/weblogic:12.2.1.3-developer
2929

3030
# Maintainer
3131
# ----------
32-
MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
32+
MAINTAINER Richard Killen <richard.killen@oracle.com>
3333

3434
ARG WDT_MODEL
3535
ARG WDT_ARCHIVE
36+
ARG WDT_VARIABLE
3637

3738
# WLS Configuration
3839
# ---------------------------
39-
ENV ADMIN_HOST="wlsadmin" \
40-
NM_PORT="5556" \
41-
MS_PORT="8001" \
42-
DEBUG_PORT="8453" \
43-
ORACLE_HOME=/u01/oracle \
44-
SCRIPT_FILE=/u01/oracle/createAndStartWLSDomain.sh \
45-
CONFIG_JVM_ARGS="-Dweblogic.security.SSL.ignoreHostnameVerification=true" \
46-
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
40+
ENV ORACLE_HOME=/u01/oracle \
41+
PROPERTIES_FILE_DIR="${ORACLE_HOME}/properties" \
42+
SCRIPT_FILE=${ORACLE_HOME}/createAndStartWLSDomain.sh \
43+
DOMAIN_HOME_PARENT=${ORACLE_HOME}/user_projects/domains \
44+
DOMAIN_HOME="${DOMAIN_HOME_PARENT}/${DOMAIN_NAME}-base_domain}" \
45+
PATH=$PATH:${ORACLE_HOME}/oracle_common/common/bin:${ORACLE_HOME}/wlserver/common/bin:${DOMAIN_HOME}/bin:${ORACLE_HOME}
4746

48-
# Domain and Server environment variables
47+
# WDT install and WDT user files
48+
# COPY
4949
# ------------------------------------------------------------
50-
ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
51-
PRE_DOMAIN_HOME=/u01/oracle/user_projects \
52-
ADMIN_PORT="${ADMIN_PORT:-7001}" \
50+
ENV COPY_PROPERTIES="poperties/docker_build" \
51+
INSTALL_HOME="/u01" \
5352
WDT_MODEL="$WDT_MODEL" \
54-
WDT_ARCHIVE="$WDT_ARCHIVE"
53+
WDT_ARCHIVE="$WDT_ARCHIVE" \
54+
WDT_VARIABLE="WDT_VARIABLE"
5555

5656
# Add files required to build this image
57-
COPY container-scripts/* /u01/oracle/
58-
COPY weblogic-deploy.zip /u01
59-
COPY ${WDT_MODEL} ${ARCHIVE_FILE} /u01/
60-
61-
# this file contains credentials.
62-
# be sure to build with --force-rm to eliminate this container layer
63-
COPY properties /u01/oracle
57+
COPY container-scripts/* ${INSTALL_HOME}
58+
COPY weblogic-deploy.zip ${INSTALL_HOME}
6459

65-
# Create directory where domain will be written to
6660
USER root
67-
RUN chmod +xw /u01/oracle/*.sh && \
68-
chmod +xw /u01/oracle/*.py && \
69-
mkdir -p $PRE_DOMAIN_HOME && \
70-
mkdir -p $PRE_DOMAIN_HOME/domains && \
71-
chmod a+xr $PRE_DOMAIN_HOME && \
72-
chown -R oracle:oracle $PRE_DOMAIN_HOME && \
73-
cd /u01 && \
74-
$JAVA_HOME/bin/jar xf /u01/weblogic-deploy.zip && \
75-
chmod +xw /u01/weblogic-deploy/bin/*.sh && \
76-
chmod -R +xw /u01/weblogic-deploy/lib/python && \
77-
if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file /u01/$WDT_MODEL"; fi && \
78-
if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file /u01/$WDT_ARCHIVE"; fi && \
61+
RUN chmod +xw ${INSTALL_HOME}/*.sh && \
62+
mkdir +xwr ${PROPERTIES_FILE_DIR} && \
63+
chown -R oracle:oracle ${PROPERTIES_FILE_DIR} && \
64+
mkdir -p $DOMAIN_HOME_PARENT && \
65+
chown -R oracle:oracle $DOMAIN_HOME_PARENT && \
66+
chmod -R a+xwr $DOMAIN_HOME_PARENT
67+
68+
COPY ${WDT_MODEL} ${WDT_ARCHIVE} ${WDT_VARIABLE} ${COPY_PROPERTIES}/*.properties ${PROPERTIES_FILE_DIR}/
69+
70+
# export domain and server specific variables into environment
71+
RUN /bin/sh ${INSTALL_HOME}/setEnv.sh
72+
73+
# Default values - these values will be replaced by the values in the properties file
74+
# The DOMAIN_NAME in the variable file can be different than the DOMAIN NAME in the DOMAIN_HOME
75+
ENV DOMAIN_NAME="${DOMAIN_NAME:-base-domain}" \
76+
ADMIN_HOST="${ADMIN_HOST:-wlsadmin}" \
77+
ADMIN_PORT="${ADMIN_PORT:-7001}" \
78+
MS_PORT="${MS_PORT:-8001}" \
79+
DEBUG_PORT="${DEBUG_PORT:-8453}" \
80+
DOMAIN_HOME="${DOMAIN_PARENT}\${DOMAIN
81+
PATH=${PATH}:
82+
83+
# Run the WDT createDomain to create the domain home in the image
84+
RUN cd ${INSTALL_HOME} && \
85+
$JAVA_HOME/bin/jar xf ${INSTALL_HOME_BASE}/weblogic-deploy.zip && \
86+
chmod +xw ${INSTALL_HOME_BASE}/weblogic-deploy/bin/*.sh && \
87+
chmod -R +xw ${INSTALL_HOME_BASE}/weblogic-deploy/lib/python && \
88+
if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-archive_file ${INSTALL_HOME_BASE}/$WDT_ARCHIVE"; fi && \
89+
if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file ${INSTALL_HOME_BASE}/$WDT_ARCHIVE"; fi && \
90+
if [ -n "$WDT_VARIABLE" ]; then VARIABLE_OPT="-variable_file ${INSTALL_HOME_BASE}/$WDT_VARIABLE"; fi && \
7991
/u01/weblogic-deploy/bin/createDomain.sh \
8092
-oracle_home $ORACLE_HOME \
8193
-java_home ${JAVA_HOME} \
82-
-domain_parent $PRE_DOMAIN_HOME/domains \
94+
-domain_home ${DOMAIN_HOME} \
8395
-domain_type WLS \
84-
-variable_file /u01/oracle/domain.properties \
96+
$VARIABLE_OPT \
8597
$MODEL_OPT \
8698
$ARCHIVE_OPT && \
87-
chown -R oracle:oracle $PRE_DOMAIN_HOME && \
88-
rm /u01/oracle/domain.properties
99+
rm ${PROPERTIES_FILE_DIR}/*
89100
90101
VOLUME $PRE_DOMAIN_HOME
91102
# Expose Node Manager default port, and also default for admin and managed server
92-
EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT $DEBUG_PORT
103+
EXPOSE $ADMIN_PORT $MS_PORT $DEBUG_PORT
93104
94105
USER oracle
95106
WORKDIR $ORACLE_HOME
96107
97108
# Define default command to start bash.
98-
CMD ["/u01/oracle/startWLSDomain.sh"]
109+
CMD ["${ORACLE_HOME}/startWLSDomain.sh"]
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
4+
# The Universal Permissive License (UPL), Version 1.0
5+
#
6+
# Set the Domain environment variables.
7+
8+
if [ ! -e "$WDT_VARIABLE" ]; then
9+
echo "A properties file with variable definitions should be supplied."
10+
goto envexit
11+
fi
12+
13+
DOMAIN_NAME=`awk '{print $1}' $WDT_VARIABLE | grep ^DOMAIN_NAME= | cut -d "=" -f2`
14+
if [ -n "$DOMAIN_NAME" ]; then
15+
export DOMAIN_NAME
16+
fi
17+
18+
ADMIN_HOST=`awk '{print $1}' $WDT_VARIABLE | grep ^ADMIN_HOST= | cut -d "=" -f2`
19+
if [ -n "$ADMIN_HOST" ]; then
20+
export ADMIN_HOST
21+
fi
22+
23+
ADMIN_PORT=`awk '{print $1}' $WDT_VARIABLE | grep ^ADMIN_PORT= | cut -d "=" -f2`
24+
if [ -n "$ADMIN_PORT" ]; then
25+
export ADMIN_PORT
26+
fi
27+
28+
MS_PORT=`awk '{print $1}' $WDT_VARIABLE | grep ^MS_PORT= | cut -d "=" -f2`
29+
if [ -n "$MS_PORT" ]; then
30+
export MS_PORT
31+
fi
32+
33+
DEBUG_PORT=`awk '{print $1}' $WDT_VARIABLE | grep ^MS_PORT= | cut -d "=" -f2`
34+
if [ -n "$DEBUG_PORT" ]; then
35+
export DEBUG_PORT
36+
fi
37+
38+
envexit:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ADMIN_PASS=welcome1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ADMIN_USER=weblogic
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ADMIN_USER=weblogic
2+
ADMIN_PASS=welcome1
3+
DOMAIN_NAME=my_domain

samples/docker-domain/properties/domain.properties

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# These variables are used for substitution in the WDT model file.
2+
# Any port that will be exposed through Docker is put in this file.
3+
# The sample Dockerfile will get the ports from this file and not the WDT model.
4+
DOMAIN_NAME=my_domain
5+
DB_USER=dba
6+
DB_PASSWORD=dba1
7+
ADMIN_PORT=7001
8+
ADMIN_HOST=wlsadmin
9+
ADMIN_NAME=admin-server
10+
DEBUG_PORT=8453
11+
ADMIN_HOST=wlsadmin
12+
MANAGED_SERVER_PORT
13+
MANAGED_SERVER_NAME_BASE=ms-
14+
CONFIGURED_MANAGED_SERVER_COUNT=2
15+
CLUSTER_NAME=cluster-1
16+
DEBUG_FLAG=true
17+
PRODUCTION_MODE_ENABLED=true
18+
CLUSTER_TYPE=DYNAMIC
19+
JAVA_OPTIONS="-Dweblogic.StdoutDebugEnabled=false -Dweblogic.security.SSL.ignoreHostnameVerification=true"
20+
#Derby Data Source parameters
21+
dsname=DockerDS
22+
dsdbname=default;create=true
23+
dsjndiname=jdbc/DockerDS
24+
dsdriver=org.apache.derby.jdbc.ClientDataSource
25+
dsurl=jdbc:derby://localhost:1527/default;ServerName=localhost;databaseName=default;create=true
26+
dsusername=dbuser
27+
dspassword=dbpassword
28+
dstestquery=SQL SELECT 1 FROM SYS.SYSTABLES
29+
dsinitalcapacity=0
30+
dsmaxcapacity=1
Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,32 @@
11
domainInfo:
2-
AdminUserName: '@@PROP:username@@'
3-
AdminPassword: '@@PROP:password@@'
4-
ServerStartMode: prod
2+
AdminUserName: '@@FILE:/u01/oracle/properties/adminuser.properties@@'
3+
AdminPassword: '@@FILE:/u01/oracle/properties/adminpass.properties@@'
4+
ServerStartMode: '@@PROP:PRODUCTION_MODE_ENABLED@@'
55
topology:
66
Name: '@@PROP:DOMAIN_NAME@@'
7-
AdminServerName: AdminServer
7+
AdminServerName: '@@PROP:ADMIN_NAME@@'
8+
DebugPort
89
Cluster:
9-
mycluster:
10+
'@@PROP:CLUSTER_NAME@@':
11+
ClusterType: '@@PROP:CLUSTER_TYPE@@PROP'
1012
ClientCertProxyEnabled: true
1113
ClusterMessagingMode: unicast
1214
DynamicServers:
1315
ServerTemplate: template1
1416
CalculatedListenPorts: false
15-
ServerNamePrefix: 'ms-'
17+
ServerNamePrefix: '@@PROP:MANAGED_SERVER_NAME_BASE@@'
1618
DynamicClusterSize: 2
1719
MaxDynamicClusterSize: 8
1820
Server:
1921
AdminServer:
20-
Machine: machine1
2122
ListenPort: '@@PROP:ADMIN_PORT@@'
2223
ServerTemplate:
2324
template1:
24-
Machine: machine1
25-
ListenPort: 9001
26-
Machine:
27-
machine1:
28-
Notes: The only machine
29-
NodeManager:
30-
NMType: SSL
31-
ListenPort: 5556
32-
Notes: The only node manager
33-
SecurityConfiguration:
34-
NodeManagerUsername: '@@PROP:NM_USER@@'
35-
NodeManagerPasswordEncrypted: '@@PROP:NM_PASSWORD@@'
36-
JMX:
37-
InvocationTimeoutSeconds: 40
38-
Notes: JMX notes
39-
ManagedServerNotificationsEnabled: true
40-
JTA:
41-
MaxTransactions: 4
42-
Notes: JTA notes
25+
ListenPort: '@@PROP:MS_PORT@@'
4326
resources:
4427
JDBCSystemResource:
4528
Generic1:
46-
Target: mycluster
29+
Target: '@@PROP:CLUSTER_NAME@@'
4730
JdbcResource:
4831
JDBCDataSourceParams:
4932
JNDIName: [ jdbc/generic1, jdbc/special1 ]
@@ -67,7 +50,7 @@ appDeployments:
6750
# Quote needed because of hyphen in string
6851
'simple-app':
6952
SourcePath: 'wlsdeploy/applications/simple-app.war'
70-
Target: mycluster
53+
Target: '@@PROP:CLUSTER_NAME@@'
7154
ModuleType: war
7255
StagingMode: nostage
7356
PlanStagingMode: nostage

0 commit comments

Comments
 (0)