Skip to content

Commit 7552532

Browse files
authored
Remove "su" command and move common commands to the head of the file
1 parent 04be747 commit 7552532

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

OracleWebLogic/dockerfiles/12.2.1.1/Dockerfile.generic

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,45 +33,48 @@ FROM oracle/serverjre:8
3333
# ----------
3434
MAINTAINER Monica Riccelli <[email protected]>
3535

36-
# WLS Configuration (editable during build time)
37-
# ------------------------------
38-
ARG ADMIN_PASSWORD
39-
40-
41-
# Environment variables required for this build (do NOT change)
42-
# -------------------------------------------------------------
43-
ENV FMW_PKG=fmw_12.2.1.1.0_wls_Disk1_1of1.zip \
44-
FMW_JAR=fmw_12.2.1.1.0_wls.jar \
45-
SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
36+
# Common environment variables required for this build (do NOT change)
37+
# --------------------------------------------------------------------
38+
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
4639
ORACLE_HOME=/u01/oracle \
4740
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
4841
DEBUG_FLAG=true \
4942
PRODUCTION_MODE=dev \
5043
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
5144
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
52-
ADMIN_PORT="${ADMIN_PORT:-8001}" \
45+
ADMIN_PORT="${ADMIN_PORT:-7001}" \
5346
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
54-
55-
# Copy packages
56-
# -------------
57-
COPY $FMW_PKG install.file oraInst.loc /u01/
47+
48+
# Copy scripts
49+
#-------------
5850
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
5951

6052
# Setup filesystem and oracle user
61-
# Install and configure Oracle JDK
6253
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
63-
# ------------------------------------------------------------
54+
# ------------------------------------------------------------
6455
RUN chmod a+xr /u01 && \
6556
chmod +xr $SCRIPT_FILE && \
6657
useradd -b /u01 -M -s /bin/bash oracle && \
6758
chown oracle:oracle -R /u01 && \
68-
echo oracle:oracle | chpasswd && \
69-
yum -y install util-linux && yum clean all && \
70-
cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - && \
71-
su -c "$JAVA_HOME/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE=\"WebLogic Server\"" - oracle && \
59+
echo oracle:oracle | chpasswd
60+
61+
# Environment variables required for this build (do NOT change)
62+
# -------------------------------------------------------------
63+
ENV FMW_PKG=fmw_12.2.1.1.0_wls_Disk1_1of1.zip \
64+
FMW_JAR=fmw_12.2.1.1.0_wls.jar
65+
66+
# Copy packages
67+
# -------------
68+
COPY $FMW_PKG install.file oraInst.loc /u01/
69+
70+
# Install
71+
# ------------------------------------------------------------
72+
USER oracle
73+
RUN cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - && \
74+
$JAVA_HOME/bin/java -jar /u01/$FMW_JAR -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \
7275
rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
7376

74-
WORKDIR ${ORACLE_HOME}
77+
WORKDIR ${ORACLE_HOME}
7578

7679
# Define default command to start script.
7780
CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]

0 commit comments

Comments
 (0)