forked from oracle/docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
138 lines (128 loc) · 5.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Copyright (c) 2020 Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
#
# Author: OIG Development
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Dockerfile for Oracle IDM 12.2.1.4 Quick Start
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) fmw_12.2.1.4.0_idm_generic.jar
#
# Pull base image
# ---------------
FROM fmw-soa:12.2.1.4.0 as base
#
#
# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
ENV FMW_JAR=fmw_12.2.1.4.0_idm_generic.jar \
#ENV FMW_JAR=fmw_12.2.1.4.0_idmquickstart_generic.jar \
ORACLE_HOME=/u01/oracle \
PATCH_DIR=/tmp/patches \
OPATCH_PATCH_DIR=/tmp/opatch \
OPATCH_NO_FUSER=true \
HEALTH_SCRIPT_FILE=/u01/oracle/dockertools/get_healthcheck_url.sh \
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
PATH=$PATH:$JAVA_HOME/bin:$ORACLE_HOME/oracle_common/common/bin \
DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
DOMAIN_ROOT="${DOMAIN_ROOT:-/u01/oracle/user_projects/domains}" \
DOMAIN_HOME="${DOMAIN_ROOT:-/u01/oracle/user_projects/domains}"/"${DOMAIN_NAME:-base_domain}" \
ADMIN_PORT="${ADMIN_PORT:-7001}" \
SOA_PORT="${SOA_PORT:-8001}" \
OIM_PORT="${OIM_PORT:-14000}" \
OIM_SSL_PORT="${OIM_SSL_PORT:-14002}" \
PATH=$PATH:/u01/oracle \
DOMAIN_TYPE="oim"
FROM base as builder
USER root
RUN mkdir -p /u01 && \
mkdir -p /u01/oracle/dockertools && \
mkdir ${PATCH_DIR} && \
mkdir ${OPATCH_PATCH_DIR} && \
chown -R oracle:root /u01 && \
chown -R oracle:root ${PATCH_DIR} && \
chown -R oracle:root ${OPATCH_PATCH_DIR}
#
# Copy files and packages for install
# -----------------------------------
COPY *.response oraInst.loc fmw_12.2.1.4.0_idm_generic* /u01/
COPY container-scripts/* /u01/oracle/dockertools/
COPY --chown=oracle:root Dockerfile patches/* ${PATCH_DIR}/
COPY --chown=oracle:root Dockerfile opatch_patch/* ${OPATCH_PATCH_DIR}/
RUN chmod a+xr /u01/oracle/dockertools/*.*
USER oracle
RUN cd /u01 && \
$JAVA_HOME/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/idmqs.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \
rm -f /u01/*.jar /u01/oraInst.loc /u01/*.response \
rm -f ${OPATCH_PATCH_DIR}/Dockerfile && \
rm -f ${PATCH_DIR}/Dockerfile
#
# Apply patch to OPatch
#
WORKDIR ${ORACLE_HOME}
RUN opatchzip=`ls ${OPATCH_PATCH_DIR}/p*.zip 2>/dev/null`; \
if [ ! -z "$opatchzip" ]; then \
cd ${OPATCH_PATCH_DIR}; \
echo -e "\nBelow patch present in opatch_patch directory. Applying this patch:" ; \
ls p*.zip ; \
echo -e "" ; \
opatchfile=`ls p*.zip` ; \
$JAVA_HOME/bin/jar xf $opatchfile ; \
$JAVA_HOME/bin/java -jar ${OPATCH_PATCH_DIR}/6880880/opatch_generic.jar -silent oracle_home=$ORACLE_HOME; \
if [ $? -ne 0 ]; then \
echo "Applying patch to opatch Failed" ; \
exit 1 ; \
fi; \
cd /tmp; \
rm ${OPATCH_PATCH_DIR}/*.zip; \
rm -r ${OPATCH_PATCH_DIR}/; \
fi
#
# Apply product patches
#
RUN patchzips=`ls ${PATCH_DIR}/p*.zip 2>/dev/null`; \
if [ ! -z "$patchzips" ]; then \
cd ${PATCH_DIR}; \
echo -e "\nBelow patches present in patches directory. Applying these patches:"; \
ls p*.zip; \
echo -e ""; \
$ORACLE_HOME/OPatch/opatch napply -silent -oh $ORACLE_HOME -jre $JAVA_HOME -phBaseDir ${PATCH_DIR}; \
if [ $? -ne 0 ]; then \
echo "opatch apply Failed"; \
exit 1; \
fi; \
$ORACLE_HOME/OPatch/opatch util cleanup -silent -oh ${ORACLE_HOME}; \
if [ $? -ne 0 ]; then \
echo "opatch cleanup Failed"; \
exit 1; \
fi; \
cd /tmp; \
rm ${PATCH_DIR}/*.zip; \
rm -r ${PATCH_DIR}/; \
rm -rf ${ORACLE_HOME}/cfgtoollogs/opatch/*; \
echo -e "\nPatches applied in OIG Oracle Home are:"; \
cd $ORACLE_HOME/OPatch; \
$ORACLE_HOME/OPatch/opatch lspatches; \
else \
echo -e "\nNo patches present in patches directory. Skipping patch application."; \
fi
RUN cp -rf /u01/oracle/idm/server/ConnectorDefaultDirectory /u01/oracle/idm/server/ConnectorDefaultDirectory_orig && \
rm -rf /u01/oracle/idm/server/ConnectorDefaultDirectory && \
ln -s /u01/oracle/user_projects/domains/ConnectorDefaultDirectory /u01/oracle/idm/server/ConnectorDefaultDirectory && \
if $ORACLE_HOME/OPatch/opatch lsinventory -oh $ORACLE_HOME -jre $JAVA_HOME | egrep -q '23855729|24204843|24325050' ; then \
echo "Ready End Point already Configured."; \
else \
sed -i 's|true</ready|false</ready|g' /u01/oracle/idm/server/apps/oim.ear/META-INF/weblogic-application.xml; \
fi
FROM base as FINAL_BUILD
COPY --from=builder --chown=oracle:root /u01 /u01
USER oracle
HEALTHCHECK --start-period=5m --interval=1m CMD curl -k -s --fail `$HEALTH_SCRIPT_FILE` || exit 1
WORKDIR $ORACLE_HOME
#
# Define default command to start bash.
CMD ["/u01/oracle/dockertools/createDomainAndStart.sh"]