Sunday, October 15, 2017

Build Weblogic Docker image

Oracle Docker image repository https://github.com/oracle/docker-images


Weblogic image https://github.com/oracle/docker-images/tree/master/OracleWebLogic


1. Build Java image

Download latest Java 8 JRE

dave@localhost docker-images]$ ls -1 ./OracleJava/java-8
build.sh
Dockerfile
server-jre-8u131-linux-x64.tar.gz.download
server-jre-8u144-linux-x64.tar.gz



2. Build Weblogic 12.2.1.2 image

Download Weblogic 12.2.1 installer  http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-for-dev-1703574.html

[dave@localhost docker-images]$ ls -1 ./OracleWebLogic/dockerfiles/
12.1.3
12.2.1
12.2.1.1
12.2.1.2
buildDockerImage.sh
[dave@localhost docker-images]$ ls -1 ./OracleWebLogic/dockerfiles/12.2.1.2
Checksum.developer
Checksum.generic
container-scripts
Dockerfile.developer
Dockerfile.generic
fmw_12.2.1.2.0_wls_Disk1_1of1.zip
fmw_12.2.1.2.0_wls_Disk1_1of1.zip.download
fmw_12.2.1.2.0_wls_quick_Disk1_1of1.zip.download
install.file
oraInst.loc
README.md


Run script
./OracleWebLogic/dockerfiles/buildDockerImage.sh -v 12.2.1.2 -g

[dave@localhost dockerfiles]$ ./buildDockerImage.sh -v 12.2.1.2 -g
Checking if required packages are present and valid...
fmw_12.2.1.2.0_wls_Disk1_1of1.zip: OK
md5sum: WARNING: 1 line is improperly formatted
=====================
Building image 'oracle/weblogic:12.2.1.2-generic' ...
Sending build context to Docker daemon  829.6MB
Step 1/13 : FROM oracle/serverjre:8
 ---> 51c243388334
Step 2/13 : MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
 ---> Running in 3cc123fdaa4f
Removing intermediate container 3cc123fdaa4f
 ---> 092fff463648
Step 3/13 : ENV ORACLE_HOME=/u01/oracle     USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom"     SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh     PATH=$PATH:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
 ---> Running in 04c6eea7844c
Removing intermediate container 04c6eea7844c
 ---> 0a29fe157ea7
Step 4/13 : RUN mkdir -p /u01 &&     chmod a+xr /u01 &&     useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle
 ---> Running in 33d5472a0320
Removing intermediate container 33d5472a0320
 ---> 289030b6953d
Step 5/13 : COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
 ---> d21b12b16163
Step 6/13 : ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     DOMAIN_HOME=/u01/oracle/user_projects/domains/${DOMAIN_NAME:-base_domain}     ADMIN_PORT="${ADMIN_PORT:-7001}"     ADMIN_USERNAME="${ADMIN_USERNAME:-weblogic}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMIN_PASSWORD="${ADMIN_PASSWORD:-""}"
 ---> Running in f83a3bad5d97
Removing intermediate container f83a3bad5d97
 ---> 6bb5a3073c44
Step 7/13 : ENV FMW_PKG=fmw_12.2.1.2.0_wls_Disk1_1of1.zip     FMW_JAR=fmw_12.2.1.2.0_wls.jar
 ---> Running in 4e716494a790
Removing intermediate container 4e716494a790
 ---> 76fdd9a2493d
Step 8/13 : COPY $FMW_PKG install.file oraInst.loc /u01/
 ---> 1407f6c45390
Step 9/13 : RUN  chown oracle:oracle -R /u01 &&      chmod +xr $SCRIPT_FILE
 ---> Running in 0c24be9827e6
Removing intermediate container 0c24be9827e6
 ---> 5eaf260ec2af
Step 10/13 : USER oracle
 ---> Running in a069a933c070
Removing intermediate container a069a933c070
 ---> 0fa1e8c0908c
Step 11/13 : 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 INSTALL_TYPE="WebLogic Server" &&     rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/oraInst.loc /u01/install.file
 ---> Running in 9ff357945a0c
/
Launcher log file is /tmp/OraInstall2017-10-15_01-59-00PM/launcher2017-10-15_01-59-00PM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2494.393 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 3855 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 7520 MB    Passed


Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-10-15_01-59-00PM
Log: /tmp/OraInstall2017-10-15_01-59-00PM/install2017-10-15_01-59-00PM.log
Setting ORACLE_HOME to /u01/oracle
Setting INSTALL_TYPE to WebLogic Server
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Skipping Software Updates
Validations are disabled for this session.
Verifying data
Copying Files
Percent Complete : 10
Percent Complete : 20
Percent Complete : 30
Percent Complete : 40
Percent Complete : 50
Percent Complete : 60
Percent Complete : 70
Percent Complete : 80
Percent Complete : 90
Percent Complete : 100

The installation of Oracle Fusion Middleware 12c WebLogic Server and Coherence 12.2.1.2.0 completed successfully.
Logs successfully copied to /u01/oracle/.inventory/logs.
Removing intermediate container 9ff357945a0c
 ---> 6a5a31abe912
Step 12/13 : WORKDIR ${ORACLE_HOME}
Removing intermediate container 0d6b38ee3a57
 ---> a5172a9ffdf3
Step 13/13 : CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]
 ---> Running in bdfedddc7b2e
Removing intermediate container bdfedddc7b2e
 ---> 692cfcc733f2
Successfully built 692cfcc733f2
Successfully tagged oracle/weblogic:12.2.1.2-generic

  WebLogic Docker Image for 'generic' version 12.2.1.2 is ready to be extended: 
    
    --> oracle/weblogic:12.2.1.2-generic

  Build completed in 981 seconds.



List Docker images
[dave@localhost dockerfiles]$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
oracle/weblogic     12.2.1.2-generic    692cfcc733f2        2 minutes ago       2.77GB
oracle/serverjre    8                   51c243388334        About an hour ago   269MB
oraclelinux         7-slim              c0feb50f7527        2 months ago        118MB
wildfly-mgmt        latest              3ea63bcef45a        11 months ago       583MB
docker-whale        latest              04c2ee13ff82        12 months ago       256MB
ubuntu              latest              c73a085dc378        12 months ago       127MB
jboss/wildfly       latest              4c99bd2cd264        13 months ago       583MB
hello-world         latest              c54a2cc56cbb        15 months ago       1.85kB
docker/whalesay     latest              6b362a9f73eb        2 years ago         247MB


Build Weblogic domain image

Go to dir
/home/dave/docker/docker-images/OracleWebLogic/samples/12212-domain

Run
docker build -t 12212-domain .

[dave@localhost 12212-domain]$ docker build -t 12212-domain .
Sending build context to Docker daemon   29.7kB
Step 1/10 : FROM oracle/weblogic:12.2.1.2-generic
 ---> 692cfcc733f2
Step 2/10 : MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>
 ---> Running in b6c764bf4555
 ---> c42ce3fb8dc0
Step 3/10 : ENV ADMIN_HOST="wlsadmin"     NM_PORT="5556"     MS_PORT="8001"     DEBUG_PORT="8453"     ORACLE_HOME=/u01/oracle     SCRIPT_FILE=/u01/oracle/createAndStartWLSDomain.sh     CONFIG_JVM_ARGS="-Dweblogic.security.SSL.ignoreHostnameVerification=true"      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
 ---> Running in 2a8fc02da8bf
 ---> b10912a412d6
Step 4/10 : ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     PRE_DOMAIN_HOME=/u01/oracle/user_projects/domains     ADMIN_PORT="${ADMIN_PORT:-7001}"      ADMIN_USERNAME="${ADMIN_USERNAME:-weblogic}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMIN_PASSWORD="${ADMIN_PASSWORD:-weblogic123}"     CLUSTER_NAME="${CLUSTER_NAME:-DockerCluster}"     DEBUG_FLAG=true     PRODUCTION_MODE=dev
 ---> Running in 0a8c04cdceb4
 ---> 98988294cf7c
Step 5/10 : COPY container-scripts/* /u01/oracle/
 ---> 6552e8159b31
Step 6/10 : RUN mkdir -p $PRE_DOMAIN_HOME &&     chmod a+xr $PRE_DOMAIN_HOME &&     chown oracle:oracle -R $PRE_DOMAIN_HOME
 ---> Running in d98390d3d688
 ---> 7344002fdbc5
Step 7/10 : EXPOSE $NM_PORT $ADMIN_PORT $MS_PORT $DEBUG_PORT
 ---> Running in 4b5af2a7a1f7
 ---> b76eba7d94a0
Step 8/10 : USER oracle
 ---> Running in 41d00ab1aff6
 ---> 201878e35274
Step 9/10 : WORKDIR $ORACLE_HOME
 ---> d763bf1840a0
Step 10/10 : CMD ["/u01/oracle/createAndStartWLSDomain.sh"]
 ---> Running in 3782f7fc5ba1
 ---> 187bd2277dd8
Removing intermediate container 4b5af2a7a1f7
Removing intermediate container 41d00ab1aff6
Removing intermediate container 48eef663f19a
Removing intermediate container 3782f7fc5ba1
Removing intermediate container b6c764bf4555
Removing intermediate container 2a8fc02da8bf
Removing intermediate container 0a8c04cdceb4
Removing intermediate container d98390d3d688
Successfully built 187bd2277dd8
Successfully tagged 12212-domain:latest
[dave@localhost 12212-domain]$ 


List Docker images
[dave@localhost dockerfiles]$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
12212-domain        latest              187bd2277dd8        2 minutes ago       2.77GB
oracle/weblogic     12.2.1.2-generic    692cfcc733f2        11 minutes ago      2.77GB
oracle/serverjre    8                   51c243388334        About an hour ago   269MB
oraclelinux         7-slim              c0feb50f7527        2 months ago        118MB
wildfly-mgmt        latest              3ea63bcef45a        11 months ago       583MB


Run the domain image
[dave@localhost dockerfiles]$ docker run -d --name=wlsadmin -p 7001:7001 12212-domain
dd00fa33169ac3c4fbed8df3374632766ce4601694f8434c48b8d8814f9b12f0
[dave@localhost dockerfiles]$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                                                  NAMES
dd00fa33169a        12212-domain        "/u01/oracle/creat..."   30 seconds ago      Up 25 seconds       5556/tcp, 8001/tcp, 8453/tcp, 0.0.0.0:7001->7001/tcp   wlsadmin


Wait for start and then check the Weblogic console via http://localhost:7001/console

No comments:

Post a Comment