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
2024# --build-arg WDT_MODEL=simple-topology.yaml \
2125# --build-arg WDT_ARCHIVE=archive.zip \
22- # --build-arg WDT_VARIABLE=simple-topology .properties \
26+ # --build-arg WDT_VARIABLE=domain .properties \
2327# --force-rm=true \
2428# -t 12213-domain-wdt .
2529#
30+ # If the ADMIN_HOST, ADMIN_PORT, MS_PORT, DOMAIN_NAME are not provided, the variables
31+ # are set to default values. (The values shown in the build statement).
32+ #
33+ # You must insure that the build arguments align with the values in the model.
34+ # The sample model replaces the attributes with tokens that are resolved fromn values in the
35+ # corresponding property file domain.properties. The container-scripts/setEnv.sh script
36+ # demonstrates parsing the variable file to build a string of --build-args that can
37+ # be passed on the docker builds command.
38+ #
2639# Pull base image
2740# ---------------
2841# FROM store/oracle/weblogic:12.2.1.3
@@ -35,31 +48,36 @@ MAINTAINER Richard Killen <richard.killen@oracle.com>
3548ARG WDT_ARCHIVE
3649ARG WDT_VARIABLE
3750ARG WDT_MODEL
38- ARG ADMIN_HOST
39- ARG ADMIN_PORT
40- ARG MS_PORT
41- ARG DOMAIN_DIR
42- ARG DEBUG_PORT
51+ ARG ARG_ADMIN_HOST=wlsadmin
52+ ARG ARG_ADMIN_PORT=7001
53+ ARG ARG_MS_PORT=8001
54+ ARG ARG_DOMAIN_NAME=base_domain
55+ ARG ARG_DEBUG_PORT=8453
56+
57+ RUN echo DOMAIN_NAME=${DOMAIN_FOLDER_NAME}
58+ # Persist arguments - for ports to expose and container to use
59+ # Create a placeholder for the manager server name. This will be provided when run the container
60+ # ---------------------------
61+ ENV ADMIN_HOST=${ARG_ADMIN_HOST} \
62+ ADMIN_PORT=${ARG_ADMIN_PORT} \
63+ MS_NAME="" \
64+ MS_PORT=${ARG_MS_PORT} \
65+ DEBUG_PORT=${ARG_DEBUG_PORT} \
66+ DOMAIN_NAME=${ARG_DOMAIN_NAME} \
67+ ORACLE_HOME=/u01/oracle
68+
69+ ENV DOMAIN_PARENT=$ORACLE_HOME/user_projects/domains
4370
4471# WLS Configuration - oracle home and domain home
4572# The boot.properties will be created under the DOMAIN_HOME when the AdminServer container is run
73+ # WDT install location and container scripts location
4674# ---------------------------
47- ENV ORACLE_HOME=/u01/oracle \
48- PROPERTIES_FILE_DIR="$ORACLE_HOME/properties" \
49- DOMAIN_PARENT="${ORACLE_HOME}/user_projects/domains" \
50- DOMAIN_HOME="${DOMAIN_PARENT}/${DOMAIN_DIR:-TESTDOMAON}" \
51- ADMIN_HOST="${ADMIN_HOST:-wlsadmin}" \
52- ADMIN_PORT="${ADMIN_PORT:-7001}" \
53- MS_PORT="${MS_PORT:-8001}" \
54- DEBUG_PORT="${DEBUG_PORT:-8453}" \
75+ ENV DOMAIN_HOME=$DOMAIN_PARENT/${DOMAIN_NAME} \
76+ PROPERTIES_FILE_DIR=$ORACLE_HOME/properties \
77+ WDT_HOME="/u01" \
78+ SCRIPT_HOME="${ORACLE_HOME}" \
5579 PATH=$PATH:${ORACLE_HOME}/oracle_common/common/bin:${ORACLE_HOME}/wlserver/common/bin:$DOMAIN_HOME/bin:${ORACLE_HOME}
5680
57- # WDT install and WDT user files
58- # ------------------------------------------------------------
59- ENV WDT_HOME="/u01" \
60- SCRIPT_HOME="${ORACLE_HOME}"
61-
62- # Add files required to build this image and run a container from the image
6381COPY weblogic-deploy.zip ${WDT_HOME}
6482COPY container-scripts/* ${SCRIPT_HOME}/
6583
@@ -93,19 +111,20 @@ ENV WDT_HOME=$WDT_HOME/weblogic-deploy
93111
94112# Set WORKDIR for @@PWD@@ global token in model file
95113WORKDIR $ORACLE_HOME
96- RUN if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file $PROPERTIES_FILE_DIR/$WDT_MODEL" ; fi && \
97- if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file $PROPERTIES_FILE_DIR/$WDT_ARCHIVE" ; fi && \
98- if [ -n "$WDT_VARIABLE" ]; then VARIABLE_OPT="-variable_file $PROPERTIES_FILE_DIR/$WDT_VARIABLE" ; fi && \
114+ RUN if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file $PROPERTIES_FILE_DIR/${WDT_MODEL##*/}" ; fi && \
115+ if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file $PROPERTIES_FILE_DIR/${WDT_ARCHIVE##*/}" ; fi && \
116+ if [ -n "$WDT_VARIABLE" ]; then VARIABLE_OPT="-variable_file $PROPERTIES_FILE_DIR/${WDT_VARIABLE##*/}" ; fi && \
117+ echo parent $DOMAIN_PARENT && \
99118 ${WDT_HOME}/bin/createDomain.sh \
100- -oracle_home ${ ORACLE_HOME} \
101- -java_home ${ JAVA_HOME} \
102- -domain_home ${ DOMAIN_HOME} \
119+ -oracle_home $ORACLE_HOME \
120+ -java_home $JAVA_HOME \
121+ -domain_home $DOMAIN_HOME \
103122 -domain_type WLS \
104123 $VARIABLE_OPT \
105124 $MODEL_OPT \
106125 $ARCHIVE_OPT && \
107- chown -R oracle:oracle ${ DOMAIN_PARENT} && \
108- rm -rf ${ PROPERTIES_FILE_DIR}
126+ chown -R oracle:oracle $DOMAIN_PARENT && \
127+ rm -rf $PROPERTIES_FILE_DIR
109128
110129VOLUME $DOMAIN_HOME
111130
0 commit comments