48
48
ARG WDT_ARCHIVE
49
49
ARG WDT_VARIABLE
50
50
ARG 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
56
57
57
- RUN echo DOMAIN_NAME=${DOMAIN_FOLDER_NAME}
58
58
# Persist arguments - for ports to expose and container to use
59
59
# 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
60
64
# ---------------------------
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
68
75
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} \
76
77
PROPERTIES_FILE_DIR=$ORACLE_HOME/properties \
77
78
WDT_HOME="/u01" \
78
79
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
+
81
82
COPY weblogic-deploy.zip ${WDT_HOME}
82
83
COPY container-scripts/* ${SCRIPT_HOME}/
83
84
84
85
# Create the properties file directory and the domain home parent with the correct permissions / owner.
85
86
# Unzip and install the WDT image.
86
87
# Export variable file values into the environment
87
88
USER 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 && \
90
93
mkdir -p $DOMAIN_PARENT && \
94
+ chown -R oracle:oracle $DOMAIN_PARENT && \
91
95
chmod -R a+xwr $DOMAIN_PARENT && \
92
96
cd ${WDT_HOME} && \
93
97
$JAVA_HOME/bin/jar xf ./weblogic-deploy.zip && \
94
98
rm weblogic-deploy.zip && \
95
99
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
97
105
98
106
# Copy the WDT model, archive file, variable file and credential secrets to the property file directory.
99
107
# These files will be removed after the image is built.
100
108
# Be sure to build with --force-rm to eliminate this container layer
101
109
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}
103
113
104
114
# Create the domain home in the docker image.
105
115
#
106
116
# The create domain tool creates a domain at the DOMAIN_HOME location
107
117
# The domain name is set using the value in the model / variable files
108
118
# The domain name can be different from the DOMAIN_HOME domain folder name.
109
-
110
- ENV WDT_HOME=$WDT_HOME/weblogic-deploy
111
-
119
+ #
112
120
# Set WORKDIR for @@PWD@@ global token in model file
113
121
WORKDIR $ORACLE_HOME
122
+ USER oracle
114
123
RUN if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file $PROPERTIES_FILE_DIR/${WDT_MODEL##*/}" ; fi && \
115
124
if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file $PROPERTIES_FILE_DIR/${WDT_ARCHIVE##*/}" ; fi && \
116
125
if [ -n "$WDT_VARIABLE" ]; then VARIABLE_OPT="-variable_file $PROPERTIES_FILE_DIR/${WDT_VARIABLE##*/}" ; fi && \
117
- echo parent $DOMAIN_PARENT && \
118
126
${WDT_HOME}/bin/createDomain.sh \
119
127
-oracle_home $ORACLE_HOME \
120
128
-java_home $JAVA_HOME \
@@ -123,16 +131,17 @@ RUN if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file $PROPERTIES_FILE_DIR/${W
123
131
$VARIABLE_OPT \
124
132
$MODEL_OPT \
125
133
$ARCHIVE_OPT && \
126
- chown -R oracle:oracle $DOMAIN_PARENT && \
134
+ chmod -R a+x $DOMAIN_HOME/bin/*.sh && \
127
135
rm -rf $PROPERTIES_FILE_DIR
128
136
137
+ # Mount the domain home and the WDT home for easy access.
129
138
VOLUME $DOMAIN_HOME
139
+ VOLUME $WDT_HOME
130
140
131
141
# 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
133
143
134
- # Define default command to start bash.
135
- WORKDIR $SCRIPT_HOME
136
- USER oracle
144
+ WORKDIR $DOMAIN_HOME
137
145
138
- CMD ["./startWLSDomain.sh" ]
146
+ # Define default command to start bash.
147
+ CMD ["/u01/oracle/startAdminServer.sh" ]
0 commit comments