|
| 1 | +#Copyright (c) 2014-2018 Oracle and/or its affiliates. All rights reserved. |
| 2 | +# |
| 3 | +#Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. |
| 4 | +# |
| 5 | +# ORACLE DOCKERFILES PROJECT |
| 6 | +# -------------------------- |
| 7 | +# This Dockerfile extends the Oracle WebLogic image by creating a sample domain. |
| 8 | +# |
| 9 | +# Util scripts are copied into the image enabling users to plug NodeManager |
| 10 | +# automatically into the AdminServer running on another container. |
| 11 | +# |
| 12 | +# HOW TO BUILD THIS IMAGE |
| 13 | +# ----------------------- |
| 14 | +# Put all downloaded files in the same directory as this Dockerfile |
| 15 | +# Build the deployment archive file using the build-archive.sh script. |
| 16 | +# $ ./build-archive.sh |
| 17 | +# |
| 18 | +# Run: |
| 19 | +# $ sudo docker build \ |
| 20 | +# --build-arg WDT_MODEL=simple-topology.yaml \ |
| 21 | +# --build-arg WDT_ARCHIVE=archive.zip \ |
| 22 | +# -t 12213-domain-wdt . |
| 23 | +# |
| 24 | +# Pull base image |
| 25 | +# --------------- |
| 26 | +FROM store/oracle/weblogic:12.2.1.3 |
| 27 | + |
| 28 | +# Maintainer |
| 29 | +# ---------- |
| 30 | +MAINTAINER Monica Riccelli <monica.riccelli@oracle.com> |
| 31 | + |
| 32 | +ARG WDT_MODEL |
| 33 | +ARG WDT_ARCHIVE |
| 34 | + |
| 35 | +# WLS Configuration |
| 36 | +# --------------------------- |
| 37 | +ENV ADMIN_HOST="wlsadmin" \ |
| 38 | + NM_PORT="5556" \ |
| 39 | + MS_PORT="8001" \ |
| 40 | + DEBUG_PORT="8453" \ |
| 41 | + ORACLE_HOME=/u01/oracle \ |
| 42 | + SCRIPT_FILE=/u01/oracle/createAndStartWLSDomain.sh \ |
| 43 | + CONFIG_JVM_ARGS="-Dweblogic.security.SSL.ignoreHostnameVerification=true" \ |
| 44 | + PATH=$PATH:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain}/bin:/u01/oracle |
| 45 | + |
| 46 | +# Domain and Server environment variables |
| 47 | +# ------------------------------------------------------------ |
| 48 | +ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}" \ |
| 49 | + PRE_DOMAIN_HOME=/u01/oracle/user_projects \ |
| 50 | + ADMIN_PORT="${ADMIN_PORT:-7001}" \ |
| 51 | + WDT_MODEL="$WDT_MODEL" \ |
| 52 | + WDT_ARCHIVE="$WDT_ARCHIVE" |
| 53 | + |
| 54 | +# Add files required to build this image |
| 55 | +COPY container-scripts/* /u01/oracle/ |
| 56 | +COPY weblogic-deploy.zip /u01 |
| 57 | +COPY ${WDT_MODEL} ${ARCHIVE_FILE} /u01/ |
| 58 | + |
| 59 | +#Create directory where domain will be written to |
| 60 | +USER root |
| 61 | +RUN chmod +xw /u01/oracle/*.sh && \ |
| 62 | + chmod +xw /u01/oracle/*.py && \ |
| 63 | + mkdir -p $PRE_DOMAIN_HOME && \ |
| 64 | + mkdir -p $PRE_DOMAIN_HOME/domains && \ |
| 65 | + chmod a+xr $PRE_DOMAIN_HOME && \ |
| 66 | + chown -R oracle:oracle $PRE_DOMAIN_HOME && \ |
| 67 | + cd /u01 && \ |
| 68 | + $JAVA_HOME/bin/jar xf /u01/weblogic-deploy.zip && \ |
| 69 | + chmod +xw /u01/weblogic-deploy/bin/*.sh && \ |
| 70 | + chmod -R +xw /u01/weblogic-deploy/lib/python && \ |
| 71 | + if [ -n "$WDT_MODEL" ]; then MODEL_OPT="-model_file /u01/$WDT_MODEL"; fi && \ |
| 72 | + if [ -n "$WDT_ARCHIVE" ]; then ARCHIVE_OPT="-archive_file /u01/$WDT_ARCHIVE"; fi && \ |
| 73 | + /u01/weblogic-deploy/bin/createDomain.sh \ |
| 74 | + -oracle_home $ORACLE_HOME \ |
| 75 | + -java_home ${JAVA_HOME} \ |
| 76 | + -domain_parent $PRE_DOMAIN_HOME/domains \ |
| 77 | + -domain_type WLS \ |
| 78 | + -variable_file /u01/oracle/domain.properties \ |
| 79 | + $MODEL_OPT \ |
| 80 | + $ARCHIVE_OPT && \ |
| 81 | + chown -R oracle:oracle $PRE_DOMAIN_HOME |
| 82 | + |
| 83 | +VOLUME $PRE_DOMAIN_HOME |
| 84 | +# Expose Node Manager default port, and also default for admin and managed server |
| 85 | +EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT $DEBUG_PORT |
| 86 | + |
| 87 | +USER oracle |
| 88 | +WORKDIR $ORACLE_HOME |
| 89 | + |
| 90 | +# Define default command to start bash. |
| 91 | +CMD ["/u01/oracle/startWLSDomain.sh"] |
0 commit comments