@@ -48,73 +48,81 @@ MAINTAINER Richard Killen <richard.killen@oracle.com>
4848ARG WDT_ARCHIVE
4949ARG WDT_VARIABLE
5050ARG WDT_MODEL
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
51+ ARG CUSTOM_ADMIN_NAME=admin-server
52+ ARG CUSTOM_ADMIN_HOST=wlsadmin
53+ ARG CUSTOM_ADMIN_PORT=7001
54+ ARG CUSTOM_MANAGED_SERVER_PORT=8001
55+ ARG CUSTOM_DOMAIN_NAME=base_domain
56+ ARG CUSTOM_DEBUG_PORT=8453
5657
57- RUN echo DOMAIN_NAME=${DOMAIN_FOLDER_NAME}
5858# Persist arguments - for ports to expose and container to use
5959# Create a placeholder for the manager server name. This will be provided when run the container
60+ # Weblogic and Domain locations
61+ # Set the start derby in admin server flag to true. Override this in the runtime properties
62+ # The boot.properties will be created under the DOMAIN_HOME when the admin server container is run
63+ # WDT installation
6064# ---------------------------
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
65+ ENV ADMIN_NAME=${CUSTOM_ADMIN_NAME} \
66+ ADMIN_HOST=${CUSTOM_ADMIN_HOST} \
67+ ADMIN_PORT=${CUSTOM_ADMIN_PORT} \
68+ MANAGED_SERVER_NAME=${MANAGED_SERVER_NAME} \
69+ MANAGED_SERVER_PORT=${CUSTOM_MANAGED_SERVER_PORT} \
70+ DEBUG_PORT=${CUSTOM_DEBUG_PORT} \
71+ DERBY_FLAG="true" \
72+ ORACLE_HOME=/u01/oracle \
73+ DOMAIN_NAME=${CUSTOM_DOMAIN_NAME} \
74+ DOMAIN_PARENT=${ORACLE_HOME}/user_projects/domains
6875
69- ENV DOMAIN_PARENT=$ORACLE_HOME/user_projects/domains
70-
71- # WLS Configuration - oracle home and domain home
72- # The boot.properties will be created under the DOMAIN_HOME when the AdminServer container is run
73- # WDT install location and container scripts location
74- # ---------------------------
75- ENV DOMAIN_HOME=$DOMAIN_PARENT/${DOMAIN_NAME} \
76+ ENV DOMAIN_HOME=${DOMAIN_PARENT}/${DOMAIN_NAME} \
7677 PROPERTIES_FILE_DIR=$ORACLE_HOME/properties \
7778 WDT_HOME="/u01" \
7879 SCRIPT_HOME="${ORACLE_HOME}" \
79- PATH=$PATH:${ORACLE_HOME}/oracle_common/common/bin:${ORACLE_HOME}/wlserver/common/bin:$DOMAIN_HOME/bin:${ORACLE_HOME}
80-
80+ PATH=$PATH:${ORACLE_HOME}/oracle_common/common/bin:${ORACLE_HOME}/wlserver/common/bin:${ DOMAIN_HOME}:${DOMAIN_HOME} /bin:${ORACLE_HOME}
81+
8182COPY weblogic-deploy.zip ${WDT_HOME}
8283COPY container-scripts/* ${SCRIPT_HOME}/
8384
8485# Create the properties file directory and the domain home parent with the correct permissions / owner.
8586# Unzip and install the WDT image.
8687# Export variable file values into the environment
8788USER root
88- RUN chmod +xw ${SCRIPT_HOME}/*.sh && \
89- mkdir -p +xwr ${PROPERTIES_FILE_DIR} && \
89+ RUN chmod +xw $SCRIPT_HOME/*.sh && \
90+ chown -R oracle:oracle ${SCRIPT_HOME} && \
91+ mkdir -p +xwr $PROPERTIES_FILE_DIR && \
92+ chown -R oracle:oracle $PROPERTIES_FILE_DIR && \
9093 mkdir -p $DOMAIN_PARENT && \
94+ chown -R oracle:oracle $DOMAIN_PARENT && \
9195 chmod -R a+xwr $DOMAIN_PARENT && \
9296 cd ${WDT_HOME} && \
9397 $JAVA_HOME/bin/jar xf ./weblogic-deploy.zip && \
9498 rm weblogic-deploy.zip && \
9599 chmod +xw weblogic-deploy/bin/*.sh && \
96- chmod -R +xw weblogic-deploy/lib/python
100+ chmod -R +xw weblogic-deploy/lib/python && \
101+ chown -R oracle:oracle weblogic-deploy
102+
103+ # Persist the WDT tool home location
104+ ENV WDT_HOME=$WDT_HOME/weblogic-deploy
97105
98106# Copy the WDT model, archive file, variable file and credential secrets to the property file directory.
99107# These files will be removed after the image is built.
100108# Be sure to build with --force-rm to eliminate this container layer
101109
102- COPY ${WDT_MODEL} ${WDT_ARCHIVE} ${WDT_VARIABLE} properties/docker_build/*.properties ${PROPERTIES_FILE_DIR}/
110+ COPY ${WDT_MODEL} ${WDT_ARCHIVE} ${WDT_VARIABLE} properties/docker-build/*.properties ${PROPERTIES_FILE_DIR}/
111+ # --chown for COPY is available in docker version 18 'COPY --chown oracle:oracle'
112+ RUN chown -R oracle:oracle ${PROPERTIES_FILE_DIR}
103113
104114# Create the domain home in the docker image.
105115#
106116# The create domain tool creates a domain at the DOMAIN_HOME location
107117# The domain name is set using the value in the model / variable files
108118# The domain name can be different from the DOMAIN_HOME domain folder name.
109-
110- ENV WDT_HOME=$WDT_HOME/weblogic-deploy
111-
119+ #
112120# Set WORKDIR for @@PWD@@ global token in model file
113121WORKDIR $ORACLE_HOME
122+ USER oracle
114123RUN if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file $PROPERTIES_FILE_DIR/${WDT_MODEL##*/}" ; fi && \
115124 if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file $PROPERTIES_FILE_DIR/${WDT_ARCHIVE##*/}" ; fi && \
116125 if [ -n "$WDT_VARIABLE" ]; then VARIABLE_OPT="-variable_file $PROPERTIES_FILE_DIR/${WDT_VARIABLE##*/}" ; fi && \
117- echo parent $DOMAIN_PARENT && \
118126 ${WDT_HOME}/bin/createDomain.sh \
119127 -oracle_home $ORACLE_HOME \
120128 -java_home $JAVA_HOME \
@@ -123,16 +131,17 @@ RUN if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file $PROPERTIES_FILE_DIR/${W
123131 $VARIABLE_OPT \
124132 $MODEL_OPT \
125133 $ARCHIVE_OPT && \
126- chown -R oracle:oracle $DOMAIN_PARENT && \
134+ chmod -R a+x $DOMAIN_HOME/bin/*.sh && \
127135 rm -rf $PROPERTIES_FILE_DIR
128136
137+ # Mount the domain home and the WDT home for easy access.
129138VOLUME $DOMAIN_HOME
139+ VOLUME $WDT_HOME
130140
131141# Expose admin server, managed server port and domain debug port
132- EXPOSE $ADMIN_PORT $MS_PORT $DEBUG_PORT
142+ EXPOSE $ADMIN_PORT $MANAGED_SERVER_PORT $DEBUG_PORT
133143
134- # Define default command to start bash.
135- WORKDIR $SCRIPT_HOME
136- USER oracle
144+ WORKDIR $DOMAIN_HOME
137145
138- CMD ["./startWLSDomain.sh" ]
146+ # Define default command to start bash.
147+ CMD ["/u01/oracle/startAdminServer.sh" ]
0 commit comments