Skip to content

Commit 2efbe49

Browse files
committed
Remove "su" command and move common commands to the head of the file
Remove "su" command and move common commands to the head of the file Move Environment vars DEBUG and PRODUCTION_MODE Remove environment variables DEBUG and PRODUCTION_MODE Move Environment variables DEBUG_FLAG and PRODUCTION_MODE Remove environment variables DEBUG_FLAG and PRODUCTION_MODE Remove yum install and su command Remove yum install Fix install command Fixed the order of RUN command Fixed the order of the RUN Correct order of RUN command Change port numbers for consistency Change port numbers for consistency Change port number for consistency Change port number for consistency Change port number for consistency Change port number for consistency Change port number for consistency Change port number for consistency Change port numbers for consistency Change port number for consistency Change port number for consistency Change port numbers for consistency Correct install Correct install command Remove "su" command and move common commands to the head of the file Move chmod $SCRIPT_FILE to second RUN Refactor to minimize layers Refactor to minimize layers Refactor to minimize layers Refactor to minimize layers Refactor to minimize layers Refactor to minimize layers Refactor to minimize layers Refactor to minimize layers Refactor to minimize layers Create directory /u01/oracle and chmod SCRIPT_FILE Correct RUN Create directory /u01/oracle and chmod SCRIPT_FILE Create directory /u01/oracle and chmod SCRIPT_FILE Create directory /u01/oracle and chmod SCRIPT_FILE Create directory /u01/oracle and chmod SCRIPT_FILE Create directory /u01/oracle and chmod SCRIPT_FILE Create directory /u01/oracle and chmod SCRIPT_FILE Create directory /u01/oracle Create directory /u01/oracle Remove yum install util-linux and move all common commands in Dockerfiles to the header of the file to reuse layers for efficiency
1 parent 6908370 commit 2efbe49

File tree

21 files changed

+184
-150
lines changed

21 files changed

+184
-150
lines changed

OracleWebLogic/dockerfiles/12.1.3/Dockerfile.developer

+19-11
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,27 @@ FROM oracle/serverjre:8
4040
# ----------
4141
MAINTAINER Bruno Borges <[email protected]>
4242

43-
# Environment variables required for this build (do NOT change)
44-
# -------------------------------------------------------------
45-
ENV FMW_PKG=wls1213_dev_update3.zip \
46-
MW_HOME=/u01/oracle \
47-
ORACLE_HOME=/u01/oracle \
43+
# Environment variables required for this build
44+
# ---------------------------------------------
45+
ENV ORACLE_HOME=/u01/oracle \
4846
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
4947
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin
5048

49+
# Setup required packages, filesystem, and oracle user.
50+
# Install and configure Oracle JDK
51+
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
52+
# ------------------------------------------------------------
53+
RUN mkdir -p /u01/oracle && \
54+
chmod a+xr /u01 && \
55+
useradd -b /u01 -m -s /bin/bash oracle && \
56+
echo oracle:oracle | chpasswd && \
57+
chown oracle:oracle -R /u01
58+
59+
# Environment variables required for this build (do NOT change)
60+
# -------------------------------------------------------------
61+
ENV FMW_PKG=wls1213_dev_update3.zip \
62+
MW_HOME=/u01/oracle
63+
5164
# Copy packages
5265
# -------------
5366
COPY $FMW_PKG /u01/
@@ -56,16 +69,11 @@ COPY $FMW_PKG /u01/
5669
# Install and configure Oracle JDK
5770
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
5871
# ------------------------------------------------------------
59-
RUN chmod a+xr /u01 && \
60-
useradd -b /u01 -m -s /bin/bash oracle && \
61-
echo oracle:oracle | chpasswd && \
62-
yum -y install util-linux && yum clean all && \
63-
$JAVA_HOME/bin/jar xf /u01/$FMW_PKG && \
72+
RUN $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && \
6473
mv wls12130/* $ORACLE_HOME && rmdir wls12130 && \
6574
cd $ORACLE_HOME && \
6675
sh configure.sh -silent && \
6776
find $ORACLE_HOME -name "*.sh" -exec chmod a+x {} \; && \
68-
chown oracle:oracle -R /u01 && \
6977
rm /u01/$FMW_PKG
7078

7179
WORKDIR $ORACLE_HOME

OracleWebLogic/dockerfiles/12.1.3/Dockerfile.generic

+13-11
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,31 @@ MAINTAINER Bruno Borges <[email protected]>
4343

4444
# Environment variables required for this build
4545
# ---------------------------------------------
46-
ENV FMW_PKG=fmw_12.1.3.0.0_wls.jar \
47-
ORACLE_HOME=/u01/oracle \
46+
ENV ORACLE_HOME=/u01/oracle \
4847
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
4948
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin
5049

51-
# Copy packages and files
52-
# -----------------------
53-
COPY $FMW_PKG install.file oraInst.loc /u01/
54-
5550
# Setup required packages, filesystem, and oracle user.
5651
# Install and configure Oracle JDK
5752
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
5853
# ------------------------------------------------------------
59-
RUN chmod a+xr /u01 && \
54+
RUN mkdir -p /u01/oracle && \
55+
chmod a+xr /u01 && \
6056
useradd -b /u01 -m -s /bin/bash oracle && \
6157
echo oracle:oracle | chpasswd && \
62-
yum -y install util-linux && yum clean all && \
63-
su -c "$JAVA_HOME/bin/java -jar /u01/$FMW_PKG -ignoreSysPrereqs -novalidation -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME ORACLE_HOME=$ORACLE_HOME" - oracle && \
64-
chown oracle:oracle -R /u01 && \
58+
chown oracle:oracle -R /u01
59+
60+
ENV FMW_PKG=fmw_12.1.3.0.0_wls.jar
61+
62+
# Copy packages and files
63+
# -----------------------
64+
COPY $FMW_PKG install.file oraInst.loc /u01/
65+
66+
USER oracle
67+
RUN $JAVA_HOME/bin/java -jar /u01/$FMW_PKG -ignoreSysPrereqs -novalidation -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="WebLogic Server" && \
6568
rm /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
6669

6770
WORKDIR $ORACLE_HOME
68-
USER oracle
6971

7072
# Define default command to start bash.
7173
CMD ["bash"]

OracleWebLogic/dockerfiles/12.2.1.1/Dockerfile.developer

+20-16
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,41 @@ MAINTAINER Monica Riccelli <[email protected]>
3535

3636
# Common environment variables required for this build (do NOT change)
3737
# --------------------------------------------------------------------
38-
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
39-
ORACLE_HOME=/u01/oracle \
38+
# Common environment variables required for this build (do NOT change)
39+
# --------------------------------------------------------------------
40+
ENV ORACLE_HOME=/u01/oracle \
4041
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
41-
DEBUG_FLAG=true \
42-
PRODUCTION_MODE=dev \
43-
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
44-
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
45-
ADMIN_PORT="${ADMIN_PORT:-7001}" \
4642
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
47-
48-
# Copy scripts
49-
#-------------
50-
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
51-
43+
5244
# Setup filesystem and oracle user
5345
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
5446
# ------------------------------------------------------------
55-
RUN chmod a+xr /u01 && \
56-
chmod +xr $SCRIPT_FILE && \
47+
RUN mkdir -p /u01/oracle && \
48+
chmod a+xr /u01 && \
5749
useradd -b /u01 -M -s /bin/bash oracle && \
5850
chown oracle:oracle -R /u01 && \
59-
echo oracle:oracle | chpasswd
51+
echo oracle:oracle | chpasswd
52+
53+
# Copy scripts
54+
#-------------
55+
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
56+
57+
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
58+
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
59+
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
60+
ADMIN_PORT="${ADMIN_PORT:-7001}"
6061

6162
# Environment variables required for this build (do NOT change)
6263
# -------------------------------------------------------------
6364
ENV FMW_PKG=fmw_12.2.1.1.0_wls_quick_Disk1_1of1.zip \
64-
FMW_JAR=fmw_12.2.1.1.0_wls_quick.jar
65+
FMW_JAR=fmw_12.2.1.1.0_wls_quick.jar \
66+
DEBUG_FLAG=true \
67+
PRODUCTION_MODE=dev
6568

6669
# Copy packages
6770
# -------------
6871
COPY $FMW_PKG install.file oraInst.loc /u01/
72+
RUN chmod +xr $SCRIPT_FILE
6973

7074
# Install
7175
# ------------------------------------------------------------

OracleWebLogic/dockerfiles/12.2.1.1/Dockerfile.generic

+17-17
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,28 @@ MAINTAINER Monica Riccelli <[email protected]>
3535

3636
# Common environment variables required for this build (do NOT change)
3737
# --------------------------------------------------------------------
38-
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
39-
ORACLE_HOME=/u01/oracle \
38+
ENV ORACLE_HOME=/u01/oracle \
4039
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
41-
DEBUG_FLAG=true \
42-
PRODUCTION_MODE=dev \
43-
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
44-
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
45-
ADMIN_PORT="${ADMIN_PORT:-7001}" \
4640
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
4741

48-
# Copy scripts
49-
#-------------
50-
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
51-
5242
# Setup filesystem and oracle user
5343
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
5444
# ------------------------------------------------------------
55-
RUN chmod a+xr /u01 && \
56-
chmod +xr $SCRIPT_FILE && \
45+
RUN mkdir -p /u01/oracle && \
46+
chmod a+xr /u01 && \
5747
useradd -b /u01 -M -s /bin/bash oracle && \
5848
chown oracle:oracle -R /u01 && \
59-
echo oracle:oracle | chpasswd
60-
49+
echo oracle:oracle | chpasswd
50+
51+
# Copy scripts
52+
#-------------
53+
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
54+
55+
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
56+
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
57+
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
58+
ADMIN_PORT="${ADMIN_PORT:-7001}"
59+
6160
# Environment variables required for this build (do NOT change)
6261
# -------------------------------------------------------------
6362
ENV FMW_PKG=fmw_12.2.1.1.0_wls_Disk1_1of1.zip \
@@ -66,12 +65,13 @@ ENV FMW_PKG=fmw_12.2.1.1.0_wls_Disk1_1of1.zip \
6665
# Copy packages
6766
# -------------
6867
COPY $FMW_PKG install.file oraInst.loc /u01/
68+
RUN chmod +xr $SCRIPT_FILE
6969

7070
# Install
7171
# ------------------------------------------------------------
72-
USER oracle
72+
USER oracle
7373
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 && \
74+
$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" && \
7575
rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
7676

7777
WORKDIR ${ORACLE_HOME}

OracleWebLogic/dockerfiles/12.2.1.2/Dockerfile.developer

+17-14
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,41 @@ MAINTAINER Monica Riccelli <[email protected]>
3535

3636
# Common environment variables required for this build (do NOT change)
3737
# --------------------------------------------------------------------
38-
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
39-
ORACLE_HOME=/u01/oracle \
38+
ENV ORACLE_HOME=/u01/oracle \
4039
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
41-
DEBUG_FLAG=true \
42-
PRODUCTION_MODE=dev \
43-
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
44-
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
45-
ADMIN_PORT="${ADMIN_PORT:-7001}" \
4640
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
4741

48-
# Copy scripts
49-
#-------------
50-
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
51-
5242
# Setup filesystem and oracle user
5343
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
5444
# ------------------------------------------------------------
55-
RUN chmod a+xr /u01 && \
56-
chmod +xr $SCRIPT_FILE && \
45+
RUN mkdir -p /u01/oracle && \
46+
chmod a+xr /u01 && \
5747
useradd -b /u01 -M -s /bin/bash oracle && \
5848
chown oracle:oracle -R /u01 && \
5949
echo oracle:oracle | chpasswd
50+
51+
# Copy scripts
52+
#-------------
53+
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
6054

55+
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
56+
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
57+
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
58+
ADMIN_PORT="${ADMIN_PORT:-7001}"
59+
6160
# Environment variables required for this build (do NOT change)
6261
# -------------------------------------------------------------
6362
ENV FMW_PKG=fmw_12.2.1.2.0_wls_quick_Disk1_1of1.zip \
64-
FMW_JAR=fmw_12.2.1.2.0_wls_quick.jar
63+
FMW_JAR=fmw_12.2.1.2.0_wls_quick.jar \
64+
DEBUG_FLAG=true \
65+
PRODUCTION_MODE=dev
6566

6667
# Copy packages
6768
# -------------
6869
COPY $FMW_PKG install.file oraInst.loc /u01/
6970

71+
RUN chmod +xr $SCRIPT_FILE
72+
7073
# Install
7174
# ------------------------------------------------------------
7275
USER oracle

OracleWebLogic/dockerfiles/12.2.1.2/Dockerfile.generic

+15-15
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,27 @@ MAINTAINER Monica Riccelli <[email protected]>
3535

3636
# Common environment variables required for this build (do NOT change)
3737
# --------------------------------------------------------------------
38-
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
39-
ORACLE_HOME=/u01/oracle \
38+
ENV ORACLE_HOME=/u01/oracle \
4039
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
41-
DEBUG_FLAG=true \
42-
PRODUCTION_MODE=dev \
43-
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
44-
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
45-
ADMIN_PORT="${ADMIN_PORT:-7001}" \
4640
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
4741

48-
# Copy scripts
49-
#-------------
50-
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
51-
5242
# Setup filesystem and oracle user
5343
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
54-
# ------------------------------------------------------------
55-
RUN chmod a+xr /u01 && \
56-
chmod +xr $SCRIPT_FILE && \
44+
# ------------------------------------------------------------
45+
RUN mkdir -p /u01/oracle && \
46+
chmod a+xr /u01 && \
5747
useradd -b /u01 -M -s /bin/bash oracle && \
5848
chown oracle:oracle -R /u01 && \
59-
echo oracle:oracle | chpasswd
49+
echo oracle:oracle | chpasswd
50+
51+
# Copy scripts
52+
#-------------
53+
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
6054

55+
ENV SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
56+
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
57+
DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain} \
58+
ADMIN_PORT="${ADMIN_PORT:-7001}"
6159

6260
# Environment variables required for this build (do NOT change)
6361
# -------------------------------------------------------------
@@ -67,10 +65,12 @@ ENV FMW_PKG=fmw_12.2.1.2.0_wls_Disk1_1of1.zip \
6765
# Copy packages
6866
# -------------
6967
COPY $FMW_PKG install.file oraInst.loc /u01/
68+
RUN chmod +xr $SCRIPT_FILE
7069

7170
# Install
7271
# ------------------------------------------------------------
7372
USER oracle
73+
7474
RUN cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - && \
7575
$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" && \
7676
rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file

OracleWebLogic/dockerfiles/12.2.1/Dockerfile.developer

+23-17
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,39 @@ FROM oracle/serverjre:8
4040
# ----------
4141
MAINTAINER Bruno Borges <[email protected]>
4242

43-
# Environment variables required for this build (do NOT change)
44-
# -------------------------------------------------------------
45-
ENV FMW_PKG=fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip \
46-
FMW_JAR=fmw_12.2.1.0.0_wls_quick.jar \
47-
ORACLE_HOME=/u01/oracle \
43+
#Common ENV
44+
#-----------
45+
ENV ORACLE_HOME=/u01/oracle \
4846
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
49-
DEBUG_FLAG=true\
50-
PRODUCTION_MODE=dev\
5147
PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin
5248

53-
# Copy packages
54-
# -------------
55-
COPY $FMW_PKG install.file oraInst.loc /u01/
56-
5749
# Setup filesystem and oracle user
58-
# Install and configure Oracle JDK
5950
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
6051
# ------------------------------------------------------------
61-
RUN chmod a+xr /u01 && \
52+
RUN mkdir -p /u01/oracle && \
53+
chmod a+xr /u01 && \
6254
useradd -b /u01 -m -s /bin/bash oracle && \
6355
echo oracle:oracle | chpasswd && \
64-
cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - && \
65-
su -c "$JAVA_HOME/bin/java -jar /u01/$FMW_JAR -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME" - oracle && \
66-
chown oracle:oracle -R /u01 && \
67-
rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
56+
chown oracle:oracle -R /u01
6857

58+
# Environment variables required for this build (do NOT change)
59+
# -------------------------------------------------------------
60+
ENV FMW_PKG=fmw_12.2.1.0.0_wls_quick_Disk1_1of1.zip \
61+
FMW_JAR=fmw_12.2.1.0.0_wls_quick.jar \
62+
DEBUG_FLAG=true\
63+
PRODUCTION_MODE=dev
64+
65+
# Copy packages
66+
# -------------
67+
COPY $FMW_PKG install.file oraInst.loc /u01/
68+
69+
# Install
70+
#-------------------------------------------------------------
6971
USER oracle
72+
RUN cd /u01 && $JAVA_HOME/bin/jar xf /u01/$FMW_PKG && cd - && \
73+
$JAVA_HOME/bin/java -jar /u01/$FMW_JAR -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \
74+
rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
75+
7076
WORKDIR $ORACLE_HOME
7177

7278
# Define default command to start bash.

0 commit comments

Comments
 (0)