Oracle WebLogic 14.1.1 under Podman

Posted by Dirk Nachbar on Monday, May 18, 2020
Since a few weeks the latest release of the Oracle WebLogic Server 14.1.1.0.0 is available and I was testing it already on native Linux Servers and within Docker.
Now it's time to check Oracle WebLogic Server 14.1.1.0.0 under Podman https://podman.io 

At first you will need an Oracle Linux 8.2 Server with podman. A really good instruction you can find at oracle-base.com https://oracle-base.com/articles/linux/podman-install-on-oracle-linux-ol8

As a starting point, just clone my GitHub Repository https://github.com/DirkNachbar/Docker there you will find some Dockerfiles for Oracle WebLogic Server 14.1.1.0.0

The first task is to create a JDK 11 Podman Image.

Under my GitHub Repository in the subdirectory OracleWebLogic/dockerfiles/14.1.1.0.0/serverjre/java-11 you will find a Dockerfile for a JDK 11 Image.
Simply download from Oracle Technology Network https://www.oracle.com/java/technologies/javase-jdk11-downloads.html the Linux Compressed Archive of the JDK 11 and place it in the directory OracleWebLogic/dockerfiles/14.1.1.0.0/serverjre/java-11
Then just run the podman build command as follows:

[root@podman java-11]# 
[root@podman java-11]# cat Dockerfile
#
# Dockerfile for creating Oracle JDK 11 Images based on OL latest
#
FROM oraclelinux:7-slim

MAINTAINER Dirk Nachbar <https://dirknachbar.blogspot.com>

ENV JAVA_PKG=jdk-11*linux-x64_bin.tar.gz \
    JAVA_HOME=/usr/java/default

ADD $JAVA_PKG /usr/java/

RUN export JAVA_DIR=$(ls -1 -d /usr/java/*) && \
    ln -s $JAVA_DIR /usr/java/latest && \
    ln -s $JAVA_DIR /usr/java/default && \
    alternatives --install /usr/bin/java java $JAVA_DIR/bin/java 20000 && \
    alternatives --install /usr/bin/javac javac $JAVA_DIR/bin/javac 20000 && \
    alternatives --install /usr/bin/jar jar $JAVA_DIR/bin/jar 20000

# Execute the podman build command

[root@podman java-11] podman build -t oracle/jdk:11 .
STEP 1: FROM oraclelinux:7-slim
STEP 2: MAINTAINER Dirk Nachbar <https://dirknachbar.blogspot.com>
0a8a2a2490e09457a55c815b8c0e7b84712162282b7dca2290972ae74ab03dcf
STEP 3: ENV JAVA_PKG=jdk-11*linux-x64_bin.tar.gz     JAVA_HOME=/usr/java/default
e308caf489693447f398651473cdbb1b54f77ace324a06831ed518bb0341be3e
STEP 4: ADD $JAVA_PKG /usr/java/
0a2f357d4e064545764064f1ee9e84d6b95dff8e1077d0326a9361bafe58ab41
STEP 5: RUN export JAVA_DIR=$(ls -1 -d /usr/java/*) &&     ln -s $JAVA_DIR /usr/java/latest &&     ln -s $JAVA_DIR /usr/java/default &&     alternatives --install /usr/bin/java java $JAVA_DIR/bin/java 20000 &&     alternatives --install /usr/bin/javac javac $JAVA_DIR/bin/javac 20000 &&     alternatives --install /usr/bin/jar jar $JAVA_DIR/bin/jar 20000
STEP 6: COMMIT oracle/jdk:11
14e68c77ac48b34e8d6ffda5614c03a787c949a920576e1432d8d7fa9697726f

# Check the JDK 11 Image

[root@podman jdk11]# podman images
REPOSITORY                      TAG      IMAGE ID       CREATED          SIZE
localhost/oracle/jdk            11       14e68c77ac48   25 seconds ago   986 MB
docker.io/library/oraclelinux   7-slim   3f15c01b91bb   13 days ago      126 MB

Now as next we can build the Oracle WebLogic Image. For this download the Oracle WebLogic 14c Generic Installer from https://www.oracle.com/middleware/technologies/fusionmiddleware-downloads.html and place the installer (dont unzip it) into the subirectory OracleWebLogic/dockerfiles/14.1.1.0.0
After you have placed the Generic Installer, you can execute the podman build to build the Oracle WebLogic Image as follows

[root@podman 14.1.1.0.0]#
[root@podman 14.1.1.0.0] podman build -t oracle/weblogic:14.1.1.0.0-optimized -f Dockerfile.optimized
STEP 1: FROM oracle/jdk:11 AS base
STEP 2: MAINTAINER Dirk Nachbar <https://dirknachbar.blogspot.com>
a24b9133c927b4ccff67f37c775bf53680e861da472fefd909bc22b775603ca8
STEP 3: ENV ORACLE_HOME=/u01/oracle     USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom"     SCRIPT_FILE=/u01/oracle/createAndStartEmptyDomain.sh     PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin
239b6e6b88f8f4926dde93e5b10517a695f240c481c5034556066d93d13a59c1
STEP 4: RUN mkdir -p /u01 &&     chmod a+xr /u01 &&     useradd -b /u01 -d /u01/oracle -m -s /bin/bash oracle
49b27820a188efa1c3fb125ba35737819f6c9a5810599ca0f83cf5a39980b13e
STEP 5: COPY container-scripts/createAndStartEmptyDomain.sh container-scripts/create-wls-domain.py /u01/oracle/
9daad5ed3cfd18e0a9e9450374cb6530e18186141da4b7c63d96465981e9c886
STEP 6: ENV DOMAIN_NAME="${DOMAIN_NAME:-base_domain}"     ADMIN_LISTEN_PORT="${ADMIN_LISTEN_PORT:-7001}"     ADMIN_NAME="${ADMIN_NAME:-AdminServer}"     ADMINISTRATION_PORT_ENABLED="${ADMINISTRATION_PORT_ENABLED:-true}"     ADMINISTRATION_PORT="${ADMINISTRATION_PORT:-9002}"
4a0f6a9cda24712750ab4897e3c3c423b3c90880053668d6fb097c5373ad54fa
STEP 7: ENV FMW_PKG=fmw_14.1.1.0.0_wls_Disk1_1of1.zip     FMW_JAR=fmw_14.1.1.0.0_wls.jar
1cf02aa4288004bf699f95255d76c9dbefe2c197c449ef530374afdde4883b9b
STEP 8: FROM 1cf02aa4288004bf699f95255d76c9dbefe2c197c449ef530374afdde4883b9b AS builder
STEP 9: COPY $FMW_PKG install.file oraInst.loc /u01/
4cb0de51b444f880fe3ec0605147bda1ec5a86b46d3ca0bae8e4a4a9e5358b67
STEP 10: RUN  chown oracle:oracle -R /u01 &&      chmod +xr $SCRIPT_FILE
7556f584bf843d9b6741a247d6dc66113ecec2ee6207f8e21a93dc25ca7f952e
STEP 11: USER oracle
cc27e8664abbc4c7ee210588ccac3b2e1b8c8b41129bf88de67914cae68b7ea3
STEP 12: RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - &&     ls /u01 &&     ${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
/
fmw_14.1.1.0.0_wls.jar     install.file  oracle
fmw_14.1.1.0.0_wls_Disk1_1of1.zip  oraInst.loc
Launcher log file is /tmp/OraInstall2020-05-18_09-19-42AM/launcher2020-05-18_09-19-42AM.log.
Extracting the installer . . . . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2194.918 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 4067 MB    Passed
Checking temp space: must be greater than 300 MB.   Actual 23718 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2020-05-18_09-19-42AM
Log: /tmp/OraInstall2020-05-18_09-19-42AM/install2020-05-18_09-19-42AM.log
Setting ORACLE_HOME...
Setting INSTALL_TYPE...
Copyright (c) 1996, 2020, 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 14.1.1 WebLogic Server and Coherence 14.1.1.0.0 completed successfully.
Logs successfully copied to /u01/oracle/.inventory/logs.
5975a5d295923d0d13875bbb180de5acde5e7cb93cf51f8ebe03fea72fe362c8
STEP 13: FROM 1cf02aa4288004bf699f95255d76c9dbefe2c197c449ef530374afdde4883b9b
STEP 14: COPY --chown=oracle:oracle --from=builder $ORACLE_HOME $ORACLE_HOME
bc0e5e9a75ae49cf0800317c5e2da309ae76b036a76ba9528a783f4c06ad5ba6
STEP 15: COPY --chown=oracle:oracle --from=builder $JAVA_HOME $JAVA_HOME
133eb7a4a072b4e2d3d4a50f606f7908fb4adcdd6a7b9479748a9afdc7f8518f
STEP 16: WORKDIR ${ORACLE_HOME}
bfba2b46902c13dd3b4d6fa5e0cdb3a157202140e20c67c931694eced8c82525
STEP 17: CMD ["/u01/oracle/createAndStartEmptyDomain.sh"]
STEP 18: COMMIT oracle/weblogic:14.1.1.0.0-optimized
fba87010a1c6b16a7760af38681f37496163885badb4bd0f0e2515f6fd27edf8

# Now let's verify the podman Image for the WebLogic 14.1.1.0.0 

[root@podman 14.1.1.0.0] podman images
REPOSITORY                      TAG                    IMAGE ID       CREATED       SIZE
localhost/oracle/weblogic       14.1.1.0.0-optimized   fba87010a1c6   2 hours ago   3.11 GB
localhost/oracle/jdk            11                     14e68c77ac48   3 hours ago   986 MB
docker.io/library/oraclelinux   7-slim                 3f15c01b91bb   13 days ago   126 MB

The final step is to create a pod and a running container with Oracle WebLogic Server 14.1.1.0.0.
The pod creation and the container creation can be done within one single command:

[root@podman 14.1.1.0.0]#
[root@podman 14.1.1.0.0] podman run -d --name [Name of your Container] --pod=new:[Pod Name] \
             -p 7001:7001 -p 9002:9002 \
             -v [Directory to your domain.properties file]:/u01/oracle/properties \
             -e ADMINISTRATION_PORT_ENABLED=true -e DOMAIN_NAME=[WebLogic Domain Name] \
             oracle/weblogic:14.1.1.0.0-optimized
# E.g.:
[root@podman 14.1.1.0.0] podman run -d --name wls1411optimized --pod=new:pod_wls1411 \
             -p 7001:7001 -p 9002:9002 \
             -v /work/Docker/OracleWebLogic/dockerfiles/14.1.1.0.0/properties:/u01/oracle/properties \
             -e ADMINISTRATION_PORT_ENABLED=true -e DOMAIN_NAME=OptimizedDomain \
             oracle/weblogic:14.1.1.0.0-optimized

# Let's check the pod creation:
[root@podman 14.1.1.0.0] podman pod ls
POD ID         NAME          STATUS    CREATED          # OF CONTAINERS   INFRA ID
4e0b599d0083   pod_wls1411   Running   12 seconds ago   2                 68ccf98d911a

# Let's check the WebLogic Container:
[root@podman 14.1.1.0.0] podman ps
CONTAINER ID  IMAGE                                           COMMAND               CREATED         STATUS             PORTS                   NAMES
5a1e9a6fcd3a  localhost/oracle/weblogic:14.1.1.0.0-optimized  /u01/oracle/creat...  42 seconds ago  Up 41 seconds ago  0.0.0.0:7001->7001/tcp  wls1411optimized

As you can see, it's really easy to get Oracle WebLogic Server 14c up and running under Podman.