-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathDockerfile.developer
executable file
·116 lines (98 loc) · 4.44 KB
/
Dockerfile.developer
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
# 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.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Dockerfile for WebLogic 14.1.1.0 Quick Install Distro
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# fmw_14.1.1.0.0_wls_lite_quick_Disk1_1of1.zip
# Download the Developer Quick installer from http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
# $ docker build -f Dockerfile.developer -t oracle/weblogic:14.1.1.0-developer .
#
# IMPORTANT
# ---------
# The resulting image of this Dockerfile contains a WLS Empty Domain.
#
# From the Oracle Docker GitHub Project
# --------------------------------------
ARG JAVA_VERSION=jdk:8-ol8
FROM oracle/$JAVA_VERSION AS builder
# Labels
LABEL provider="Oracle" \
maintainer="Monica Riccelli <[email protected]>" \
issues="https://github.com/oracle/docker-images/issues" \
port.admin.listen="7001" \
port.administration="9002"
# Common environment variables required for this build (do NOT change)
# --------------------------------------------------------------------
ENV ORACLE_HOME=/u01/oracle \
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
# Setup filesystem and oracle user
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
# ------------------------------------------------------------
RUN mkdir /u01 && \
useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \
chown oracle:root -R /u01 && \
chmod -R 775 /u01
# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
ENV FMW_PKG=fmw_14.1.1.0.0_wls_lite_quick_Disk1_1of1.zip \
FMW_JAR=fmw_14.1.1.0.0_wls_lite_quick_generic.jar
# Copy packages
# -------------
COPY --chown=oracle:root $FMW_PKG install.file oraInst.loc /u01/
# Install
# ------------------------------------------------------------
USER oracle
RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \
${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 && \
rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/install.file && \
rm -rf /u01/oracle/cfgtoollogs
# Final image stage
FROM oracle/$JAVA_VERSION AS runtime
ENV ORACLE_HOME=/u01/oracle \
USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh \
HEALTH_SCRIPT_FILE=/u01/oracle/get_healthcheck_url.sh \
PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
# Build arguments
ARG DOMAIN_NAME
ARG ADMIN_LISTEN_PORT
ARG ADMIN_NAME
ARG ADMINISTRATION_PORT_ENABLED
ARG ADMINISTRATION_PORT
# Domain and Server environment variables
# ------------------------------------------------------------
ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \
ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}" \
ADMIN_NAME="${ADMIN_NAME:-AdminServer}" \
DEBUG_FLAG=true \
PRODUCTION_MODE=dev \
ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}" \
ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}"
# Setup filesystem and oracle user
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
# ------------------------------------------------------------
RUN mkdir -p /u01 && \
chmod 775 /u01 && \
useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle && \
chown oracle:root /u01
COPY --from=builder --chown=oracle:root /u01 /u01
# Copy scripts
#-------------
COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py container-scripts/get_healthcheck_url.sh /u01/oracle/
RUN chmod +xr $SCRIPT_FILE $HEALTH_SCRIPT_FILE && \
chown oracle:root $SCRIPT_FILE /u01/oracle/create-wls-domain.py $HEALTH_SCRIPT_FILE
USER oracle
HEALTHCHECK --start-period=10s --timeout=30s --retries=3 CMD curl -k -s --fail `$HEALTH_SCRIPT_FILE` || exit 1
WORKDIR ${ORACLE_HOME}
# Define default command to start script.
CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]