본문 바로가기
프로그램 활용/클라우드 가상화 도커

Docker + Apache + Oracle 14c + Oracle 19c

by 3604 2023. 7. 28.
728x90

Docker + Apache + Oracle 14c + Oracle 19c

 

Ravi Verma

Ravi Vermacnfcj:

Published Jan 25, 2021

Most of the Oracle 14c scripts are Oracle's files on GitHub. I have enhanced them for my purposes.

This article has an ambitious goal: Set up 3-tier database application entirely in Docker. I have saved all the scripts at GitHub and the links are given below.

In this article, I will share the following steps:

  1. Create JDK 11 Docker Image
  2. Create an Oracle WebLogic 14c Docker image
  3. Deploy a Database Java Application in a Docker container
  4. Create an Apache Docker Image
  5. Configure the Apache Image to Proxy to the WebLogic Application

All the configuration files I have used are at GitHub in the following folders:

 

 

A VERY IMPORTANT POINT

 

I am mentioning this early in the article as this is critical. We must make sure that the uid and gid on the host system and within the Docker container match.

Here are the values on the host.

[rverma@dockerhost ~]$ cat /etc/group
.....
oinstall:x:54321:oracle
.......

[rverma@dockerhost ~]$ cat /etc/passwd | grep oracle
oracle:x:54321:54321::/home/oracle:/bin/bash
[rverma@dockerhost ~]$

Here are the values from the Docker container

[rverma@dockerhost ~]$ docker run -it weblogic/hsoftdev cat /etc/group
oinstall:x:54321:
[oracle@dockerhost ~]$ docker run -it weblogic/hsoftdev cat /etc/passwd | grep oracle
oracle:x:54321:54321::/u01/oracle:/bin/bash
[oracle@dockerhost ~]$

If the uid and gid of the oracle account do not match, you must take care of it.

If you follow this article to the end, you will view the deployed application in a browser as follows:

The diagram below shows how the Docker containers described in this article work together.

The diagram above depicts the following components.

  1. DockerHost Server(192.168.1.23) running OracleLinux.
[oracle@dockerhost WebLogic14c]$ uname -ar
Linux dockerhost.hqsft.com 5.4.17-2036.102.0.2.el8uek.x86_64 #2 SMP Tue Jan 5 12:46:40 PST 2021 x86_64 x86_64 x86_64 GNU/Linux

2. Docker Network (172.19.0.0/16)

3. Apache running at the Docker IP 172.19.5.12

4. Oracle Weblogic 14c at the Docker IP 172.19.5.11

5. Oracle 19c Database at the Docker IP 172.19.5.10

  1. Create JDK 11 Docker Image

1.1 Directory structure

Following snippet displays the directory structure for creating the Docker image. You will have to download jdk-11.0.9_linux-x64_bin.tar.gz from Oracle's website at (https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)

[oracle@dockerhost OracleJava]$ tree
.
└── java-11
    ├── build.sh
    ├── Dockerfile
    ├── jdk-11.0.9_linux-x64_bin.tar.gz
    └── jdk-11.0.9_linux-x64_bin.tar.gz.download

1.2 Dockerfile

[oracle@dockerhost java-11]$ pwd
/opt/OracleJava/java-11
[oracle@dockerhost java-11]$ cat Dockerfile
# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
#
# 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 Oracle JDK 11
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
#
# (1) jdk-11.XX_linux-x64_bin.tar.gz
#     Download from https://www.oracle.com/java/technologies/javase-jdk11-downloads.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
#      $ docker build -t oracle/jdk:11 ..
#
# This command is already scripted on build.sh so you can alternatively run
#               $ bash build.sh
#
# The builder image will be use to uncompress the tar.gz file with the Java Runtime.


FROM oraclelinux:8 as builder


MAINTAINER Aurelio Garcia-Ribeyro <aurelio.garciaribeyro@oracle.com>


RUN set -eux; \
        yum install -y \
                gzip \
                tar telnet vim \
        ; \
        rm -rf /var/cache/yum


# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8


# Environment variables for the builder image.
# Required to validate that you are using the correct file


ENV JAVA_PKG=jdk-11.0.9_linux-x64_bin.tar.gz \
        JAVA_SHA256=5c149faddf9deb5a2f63438e7cd8f7d21e7300c93ebbc43dc83a6e3b90d554a7 \
        JAVA_HOME=/usr/java/jdk-11


##
COPY $JAVA_PKG /tmp/jdk.tgz
RUN set -eux; \
        echo "$JAVA_SHA256 */tmp/jdk.tgz" | sha256sum -c -; \
        mkdir -p "$JAVA_HOME"; \
        tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1; \
        rm /tmp/jdk.tgz;


## Get a fresh version of SLIM for the final image
FROM oraclelinux:7-slim


# Default to UTF-8 file.encoding
ENV LANG en_US.UTF-8


ENV JAVA_VERSION=11.0.8 \
        JAVA_HOME=/usr/java/jdk-11


ENV     PATH $JAVA_HOME/bin:$PATH


# Copy the uncompressed Java Runtime from the builder image
COPY --from=builder $JAVA_HOME $JAVA_HOME
RUN set -eux; \
        yum install -y \
# JDK assumes freetype is available
                freetype fontconfig \
        ; \
        rm -rf /var/cache/yum; \
        ln -sfT "$JAVA_HOME" /usr/java/default; \
        ln -sfT "$JAVA_HOME" /usr/java/latest; \
        for bin in "$JAVA_HOME/bin/"*; do \
                base="$(basename "$bin")"; \
                [ ! -e "/usr/bin/$base" ]; \
                alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
        done; \
# -Xshare:dump will create a CDS archive to improve startup in subsequent runs
        java -Xshare:dump; \
        java --version; \
        javac --version


CMD ["jshell"]

</aurelio.garciaribeyro@oracle.com>

1.3 build.sh

[oracle@dockerhost java-11]$ cat build.sh
# Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.


#!/bin/sh
docker build -t oracle/jdk:11 .

1.4 Build the JDK 11 Docker Image

[oracle@dockerhost java-11]$ ./build.sh
Sending build context to Docker daemon  181.6MB
Step 1/14 : FROM oraclelinux:8 as builder
 ---> f4a1f2c861ca
....
....
....
 ---> Using cache
 ---> 4b1252013a25
Successfully built 4b1252013a25
Successfully tagged oracle/jdk:11

2. Build WebLogic14c Image

2.1 Directory Structure

[oracle@dockerhost WebLogic14c]$ ls
14.1.1.0  buildDockerImage.sh
[oracle@dockerhost WebLogic14c]$ tree
.
├── 14.1.1.0
│   ├── Checksum.developer
│   ├── Checksum.generic
│   ├── Checksum.slim
│   ├── container-scripts
│   │   ├── createAndStartEmptyDomain.sh
│   │   ├── create-wls-domain.py
│   │   ├── createWLSDomain.sh
│   │   ├── domain.properties
│   │   ├── domain_security.properties
│   │   ├── get_healthcheck_url.sh
│   │   ├── setEnv.sh
│   │   ├── startManagedServer.sh
│   │   ├── waitForAdminServer.sh
│   │   └── wlst
│   ├── Dockerfile
│   ├── Dockerfile.developer-11
│   ├── Dockerfile.developer-8
│   ├── Dockerfile.generic-11
│   ├── Dockerfile.generic-11.save
│   ├── Dockerfile.generic-8
│   ├── Dockerfile.slim-11
│   ├── Dockerfile.slim-8
│   ├── domain.properties
│   ├── fmw_14.1.1.0.0_wls_Disk1_1of1.zip
│   ├── fmw_14.1.1.0.0_wls_Disk1_1of1.zip.download
│   ├── fmw_14.1.1.0.0_wls_quick_Disk1_1of1.zip.download
│   ├── fmw_14.1.1.0.0_wls_quick_slim_Disk1_1of1.zip.download
│   ├── install.file
│   ├── __MACOSX
│   ├── oraInst.loc
│   ├── properties
│   │   ├── domain.properties
│   │   └── domain_security.properties
│   ├── README.md
│   ├── run_admin_server.sh
│   └── run_managed_server.sh
└── buildDockerImage.sh

2.2 Build Oracle WebLogic 14c

[oracle@dockerhost WebLogic14c]$ ./buildDockerImage.sh -v 14.1.1.0 -g -s -j 11
Set- WebLogic's Version 14.1.1.0
Set- Distribution:Generic
Set- Skip md5sum
Set- JDK Version 11
Version= 14.1.1.0 Distribution= generic-11
Skipped MD5 checksum.
=====================
Building image 'oracle/weblogic:14.1.1.0-generic-11' ...
Building image using Dockerfile.'generic-11'
Sending build context to Docker daemon  931.4MB

Removing intermediate container ea784f1db3e8
 ---> 887ff02d3132
Successfully built 887ff02d3132
Successfully tagged oracle/weblogic:14.1.1.0-generic-11


  WebLogic Docker Image for 'generic-11' version 14.1.1.0 is ready to be extended:


    --> oracle/weblogic:14.1.1.0-generic-11


  Build completed in 114 seconds.

3. Extend the Oracle WebLogic 14c Image with Custom Application

3.1 Directory Structure

[oracle@dockerhost weblogic]$ tree
.
├── adminserver.sh
├── build.sh
├── console
├── container-scripts
│   ├── create-wls-domain.py
│   ├── createWLSDomain.sh
│   ├── datasource.properties
│   ├── datasource.properties.derby
│   ├── datasource.properties.oracle
│   ├── ds-deploy.py
│   ├── jms-deploy.py
│   ├── setEnv.sh
│   ├── shutdown-servers.py
│   ├── startAdminServer.sh
│   ├── startManagedServer.sh
│   ├── waitForAdminServer.sh
│   └── wlst
├── dadminserver.sh
├── dmanaged.sh
├── Dockerfile
├── jks
│   ├── cert.pem
│   ├── dockerdb.hqsft.com.crt
│   ├── fullchain.pem
│   ├── identity.jks
│   ├── identity.jks.old
│   ├── keystore.p12
│   ├── privkey.pem
│   ├── trust.jks
│   └── trust.jks.old
├── logs
│   ├── access.log
│   ├── capesadmin.log
│   ├── capes.log
│   ├── debug.log
│   ├── DEV1.log
│   ├── hsoftadmin.log
│   └── PROD1.log
├── otData.war
├── properties
│   ├── docker-build
│   │   ├── domain.properties
│   │   └── domain_security.properties
│   └── docker-run
│       └── security.properties
├── README.md
├── rebuild.sh
├── Reports
│   └── CAPES
└── setDomainEnv.sh

3.2 Dockerfile

[oracle@dockerhost weblogic]$ cat Dockerfile
#Copyright (c) 2014, 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 Dockerfile extends the Oracle WebLogic image by creating a sample domain.
#
# Util scripts are copied into the image enabling users to plug NodeManager
# automatically into the AdminServer running on another container.
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# Run:
#      $ sudo docker build -t 12213-domain-home-image
#
# Pull base image
# ---------------
#FROM oracle/weblogic:12.2.1.3-generic
#FROM oracle/weblogic:12213-opatch-upgrade
FROM oracle/weblogic:14.1.1.0-generic-11
# Maintainer
# ----------
MAINTAINER Monica Riccelli <monica.riccelli@oracle.com>


ARG CUSTOM_DOMAIN_NAME="${CUSTOM_DOMAIN_NAME:-domain1}"
ARG CUSTOM_ADMIN_PORT="${CUSTOM_ADMIN_PORT:-7001}"
ARG CUSTOM_ADMIN_SERVER_SSL_PORT="${CUSTOM_ADMIN_SERVER_SSL_PORT:-7002}"
ARG CUSTOM_MANAGED_SERVER_PORT="${CUSTOM_MANAGED_SERVER_PORT:-8001}"
ARG CUSTOM_MANAGED_SERVER_SSL_PORT="${CUSTOM_MANAGED_SERVER_SSL_PORT:-8002}"
ARG CUSTOM_DEBUG_PORT="${CUSTOM_DEBUG_PORT:-8453}"
ARG CUSTOM_ADMIN_NAME="${CUSTOM_ADMIN_NAME:-admin-server}"
ARG CUSTOM_ADMIN_HOST="${CUSTOM_ADMIN_HOST:-wlsadmin}"
ARG CUSTOM_CLUSTER_NAME="${CUSTOM_CLUSTER_NAME:-DockerCluster}"
ARG CUSTOM_SSL_ENABLED="${CUSTOM_SSL_ENABLED:-false}"


# WLS Configuration
# ---------------------------
ENV ORACLE_HOME=/u01/oracle \
    PROPERTIES_FILE_DIR="/u01/oracle/properties" \
    SSL_ENABLED="${CUSTOM_SSL_ENABLED}" \
    DOMAIN_NAME="${CUSTOM_DOMAIN_NAME}" \
    DOMAIN_HOME="/u01/oracle/user_projects/domains/${CUSTOM_DOMAIN_NAME}" \
    ADMIN_PORT="${CUSTOM_ADMIN_PORT}" \
    ADMIN_SERVER_SSL_PORT="${CUSTOM_ADMIN_SERVER_SSL_PORT}" \
    ADMIN_NAME="${CUSTOM_ADMIN_NAME}" \
    ADMIN_HOST="${CUSTOM_ADMIN_HOST}" \
    CLUSTER_NAME="${CUSTOM_CLUSTER_NAME}" \
    MANAGED_SERVER_PORT="${CUSTOM_MANAGED_SERVER_PORT}" \
    MANAGED_SERVER_SSL_PORT="${CUSTOM_MANAGED_SERVER_SSL_PORT}" \
    MANAGED_SERV_NAME="${CUSTOM_MANAGED_SERV_NAME}" \
    DEBUG_PORT="8453" \
 #   AS_HOME="${DOMAIN_HOME}/servers/${ADMIN_NAME}" \
 #   MS_HOME="${DOMAIN_HOME}/servers/hsoftdev" \
    PATH=$PATH:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:${DOMAIN_HOME}:${DOMAIN_HOME}/bin:/u01/oracle


# Add files required to build this image
USER root
RUN yum -y install telnet vim && yum -y clean all
RUN mkdir -p /u01/oracle/user_projects/domains/hsoftdev/servers/hsoftadmin/logs
RUN touch /u01/oracle/user_projects/domains/hsoftdev/servers/hsoftadmin/logs/access.log
RUN chown -R oracle:oinstall /u01/oracle/user_projects/domains/hsoftdev/servers/
COPY --chown=oracle:oinstall container-scripts/* /u01/oracle/
COPY jks/identity.jks /u01/oracle/user_projects/domains/hsoftdev/security/identity.jks
COPY jks/trust.jks /u01/oracle/user_projects/domains/hsoftdev/security/trust.jks


#Create directory where domain will be written to
USER root
RUN chmod +xw /u01/oracle/*.sh && \
    chmod +xw /u01/oracle/*.py && \
    mkdir -p ${PROPERTIES_FILE_DIR} && \
    chown -R oracle:oinstall ${PROPERTIES_FILE_DIR} && \
    mkdir -p $DOMAIN_HOME && \
    chown -R oracle:oinstall $DOMAIN_HOME/.. && \
    chmod -R a+xwr $DOMAIN_HOME/..


COPY --chown=oracle:oinstall properties/docker-build/domain*.properties ${PROPERTIES_FILE_DIR}/


# Configuration of WLS Domain
USER root
RUN /u01/oracle/createWLSDomain.sh && \
    echo ". $DOMAIN_HOME/bin/setDomainEnv.sh" >> /u01/oracle/.bashrc && \
    chmod -R a+x $DOMAIN_HOME/bin/*.sh  && \
    rm ${PROPERTIES_FILE_DIR}/*.properties




COPY container-scripts/* /u01/oracle/


RUN wlst -loadProperties /u01/oracle/datasource.properties /u01/oracle/ds-deploy.py
#    && \
#    wlst /u01/oracle/jms-deploy.py


COPY setDomainEnv.sh /u01/oracle/user_projects/domains/hsoftdev/bin/setDomainEnv.sh
COPY otData.war /u01/oracle/user_projects/domains/hsoftdev/autodeploy
# Expose ports for admin, managed server, and debug
EXPOSE $ADMIN_PORT $ADMIN_SERVER_SSL_PORT $MANAGED_SERVER_PORT $MANAGED_SERVER_SSL_PORT $DEBUG_PORT


RUN chown -R oracle:oinstall /u01/oracle/user_projects/domains
#RUN chown -R oracle:oinstall /u01/oracle


WORKDIR $DOMAIN_HOME


# Define default command to start bash.
CMD ["startAdminServer.sh"]
[oracle@dockerhost weblogic]$

</monica.riccelli@oracle.com>

3.4 Create the JKS Files

I have set up Java Key Stores(jks) for TLS communication between the WebLogic 14c Docker container and the Oracle 19c Database.

# The keys cert.pem and privkey.pem are public and private SSL certificates. 
[oracle@dockerhost jks]$ openssl pkcs12 -export -name weblogic -in cert.pem -inkey privkey.pem -out keystore.p12
[oracle@dockerhost jks]$ keytool -importkeystore -destkeystore identity.jks -srckeystore keystore.p12 -srcstoretype pkcs12 -alias weblogic
[oracle@dockerhost jks]$ keytool -importcert -file cert.pem -alias weblogic -keystore trust.jks
#  dockerdb.hqsft.com.crt is the export of Oracle 19c Wallet
[oracle@dockerhost jks]$ keytool -importcert -file dockerdb.hqsft.com.crt -alias oracle -keystore trust.jks

3.5 Add the JKS information in setDomainEnv.sh

[oracle@dockerhost weblogic]$ cat setDomainEnv.sh

....
....
JAVA_OPTIONS="$JAVA_OPTIONS -Djavax.net.ssl.keyStore=/u01/oracle/user_projects/domains/hsoftdev/security/identity.jks \
        -Djavax.net.ssl.keyStorePassword={your password } -Djavax.net.ssl.trustStore=/u01/oracle/user_projects/domains/hsoftdev/security/trust.jks \
        -Djavax.net.ssl.trustStorePassword={your password } -Duser.timezone=PST"

3.5 Set up the Data Source

You will need the following bits of information from your DBA

  1. Database Host - 172.19.5.10 in my case.
  2. TLS Port - 2484 in my case
  3. SERVICE_NAME - KINDPDB in my case
[oracle@dockerhost weblogic]$ cat container-scripts/datasource.properties
dsname=my_persistence_unit
dsdbname=default;create=true
dsjndiname=jdbc/KINDPDB
dsdriver=oracle.jdbc.OracleDriver
dsurl=jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=172.19.5.10)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=KINDPDB)))
dsusername=username
dspassword=password
dstestquery=SQL ISVALID
dsmaxcapacity=40000
dsmincapacity=60
dsinitialcapacity=60

3.6 Domain build properties

[oracle@dockerhost weblogic]$ cat properties/docker-build/domain.properties
DOMAIN_NAME=hsoftdev
SSL_ENABLED=false
ADMIN_PORT=7001
ADMIN_SERVER_SSL_PORT=7002
ADMIN_NAME=hsoftadmin
ADMIN_HOST=hsoftdev
MANAGED_SERVER_PORT=7010
MANAGED_SERVER_SSL_PORT=8002
MANAGED_SERVER_NAME_BASE=DEV
CONFIGURED_MANAGED_SERVER_COUNT=1
CLUSTER_NAME=hsoftdevcluster
DEBUG_PORT=8453
DB_PORT=1527
DEBUG_FLAG=true
PRODUCTION_MODE_ENABLED=false
CLUSTER_TYPE=DYNAMIC
JAVA_OPTIONS=-Dweblogic.StdoutDebugEnabled=false
T3_CHANNEL_PORT=30012
T3_PUBLIC_ADDRESS=kubernetes
IMAGE_TAG=weblogic/hsoftdev

3.7 Build the Container Image

[oracle@dockerhost weblogic]$ ./build.sh
Context for docker build is /opt/hsoftdev/weblogic
Export environment variables from the /opt/hsoftdev/weblogic/properties/docker-build/domain.properties properties file
 env_arg: CUSTOM_DOMAIN_NAME=hsoftdev
 env_arg: CUSTOM_SSL_ENABLED=false
 env_arg: CUSTOM_ADMIN_NAME=hsoftadmin
 env_arg: CUSTOM_ADMIN_HOST=hsoftdev
 env_arg: CUSTOM_ADMIN_SERVER_SSL_PORT=7002
 env_arg: CUSTOM_MANAGED_SERVER_SSL_PORT=8002
 env_arg: CUSTOM_DEBUG_PORT=8453
 env_arg: CUSTOM_IMAGE_TAG=weblogic/hsoftdev
 env_arg: CUSTOM_CLUSTER_NAME=hsoftdevcluster
 env_arg: CUSTOM_CLUSTER_TYPE=DYNAMIC
BUILD_ARG= --build-arg CUSTOM_DOMAIN_NAME=hsoftdev --build-arg CUSTOM_SSL_ENABLED=false --build-arg CUSTOM_ADMIN_NAME=hsoftadmin --build-arg CUSTOM_ADMIN_HOST=hsoftdev --build-arg CUSTOM_ADMIN_HOST=hsoftdev --build-arg CUSTOM_ADMIN_SERVER_SSL_PORT=7002 --build-arg CUSTOM_ADMIN_SERVER_SSL_PORT=7002 --build-arg CUSTOM_ADMIN_SERVER_SSL_PORT=7002 --build-arg CUSTOM_MANAGED_SERVER_SSL_PORT=8002 --build-arg CUSTOM_DEBUG_PORT=8453 --build-arg CUSTOM_CLUSTER_NAME=hsoftdevcluster --build-arg CUSTOM_CLUSTER_TYPE=DYNAMIC
CUSTOM_IMAGE_TAG  weblogic/hsoftdev
Sending build context to Docker daemon  47.08MB

Removing intermediate container cf993402ac05
 ---> 61b9c469ba3d
[Warning] One or more build-args [CUSTOM_CLUSTER_TYPE] were not consumed
Successfully built 61b9c469ba3d
Successfully tagged weblogic/hsoftdev:latest

3. 8 Start the Container

[oracle@dockerhost weblogic]$ cat dadminserver.sh
docker container rm -f hsoftdev
docker run -dt --network=oracledb --restart unless-stopped --name hsoftdev --hostname hsoftdev -p 192.168.1.45:7040:7001 --ip 172.19.5.11  --user oracle -e TZ=America/Los_Angeles \
          -v /opt/hsoftdev/weblogic/properties/docker-run:/u01/oracle/properties \
          weblogic/hsoftdev

4. Build and Start the Apache Proxy Docker Image

4.1 Directory Structure

Two things no note here:

  1. You will need the SSL certificates to place in the certs folder.
  2. The folder WebLogic contains the WebLogic plugin files for Apache.
[oracle@dockerhost apache]$ tree
.
├── build.sh
├── certs
│   ├── cert.pem
│   ├── chain.pem
│   ├── fullchain.pem
│   ├── privkey.pem
│   └── README
├── conf
│   ├── bashrc
│   ├── hosts
│   ├── httpd.conf
│   ├── ld.so.conf
│   ├── ssl.conf
│   └── ssl.conf.ave
├── Dockerfile
├── logs
│   ├── access_log
│   ├── error_log
│   ├── ssl_access_log
│   └── ssl_error_log
├── run-httpd.sh
├── startApache.sh
└── weblogic
    ├── libclntshcore.so
    ├── libclntshcore.so.12.1
    ├── libclntsh.so
    ├── libclntsh.so.12.1
    ├── libclntsh.so.save
    ├── libdms2.so
    ├── libipc1.so
    ├── libmql1.so
    ├── libnnz12.so
    ├── libons.so
    ├── libonsssl.so
    ├── libonssys.so
    ├── mod_wl_24.so
    └── mod_wl.so

4.2 The Docker File

[oracle@dockerhost apache]$ cat Dockerfile
FROM oraclelinux:8
MAINTAINER The CentOS Project <cloud-ops@centos.org>
LABEL Vendor="CentOS" \
      License=GPLv2 \
      Version=2.4.6-40


COPY conf/ld.so.conf /etc/ld.so.conf


RUN yum -y update && \
    yum -y install httpd mod_ssl && \
    yum -y install libaio libaio-devel && \
    yum clean all


EXPOSE 80
EXPOSE 443
COPY conf/bashrc /etc/bashrc
COPY weblogic/mod_wl_24.so /etc/httpd/modules/mod_wl_24.so
COPY weblogic/libclntshcore.so /usr/local/lib/libclntshcore.so
COPY weblogic/libclntshcore.so.12.1 /usr/local/lib/libclntshcore.so.12.1
COPY weblogic/libclntsh.so /usr/local/lib/libclntsh.so
COPY weblogic/libclntsh.so.12.1 /usr/local/lib/libclntsh.so.12.1
COPY weblogic/libdms2.so /usr/local/lib/libdms2.so
COPY weblogic/libipc1.so /usr/local/lib/libipc1.so
COPY weblogic/libmql1.so /usr/local/lib/libmql1.so
COPY weblogic/libnnz12.so /usr/local/lib/libnnz12.so
COPY weblogic/libons.so /usr/local/lib/libons.so
COPY weblogic/libonsssl.so /usr/local/lib/libonsssl.so
COPY weblogic/libonssys.so /usr/local/lib/libonssys.so
COPY weblogic/mod_wl_24.so /usr/local/lib/mod_wl_24.so
RUN ldconfig


COPY conf/ssl.conf /etc/httpd/conf.d/ssl.conf
COPY conf/httpd.conf /etc/httpd/conf/httpd.conf


COPY certs/cert.pem /etc/pki/tls/certs/cert.pem
COPY certs/privkey.pem /etc/pki/tls/private/privkey.pem
COPY certs/fullchain.pem /etc/pki/tls/certs/fullchain.pem




# Simple startup script to avoid some issues observed with container restart
ADD run-httpd.sh /run-httpd.sh
RUN chmod -v +x /run-httpd.sh


CMD ["/run-httpd.sh"]

4.3 The ssl.conf configuration file

[oracle@dockerhost apache]$ cat conf/ssl.conf
......
......
<Location /otData>
   FileCaching ON
   SetHandler weblogic-handler
   WLSRequest On
   SetHandler weblogic-handler
   PathTrim /
   WebLogicHost 172.19.5.11
   WebLogicPort 7001
</Location>

4.4 The Docker Image Build File

[oracle@dockerhost apache]$ cat build.sh
docker build -t apache/hsoftdev . --network=host

4.5 Build the Docker Image

[oracle@dockerhost apache]$ ./build.sh

5. All together

[oracle@dockerhost ~]$ docker ps
CONTAINER ID   IMAGE                       COMMAND                  CREATED        STATUS                    PORTS                                                                                   NAMES
218f3a6524f9   apache/hsoftdev             "/run-httpd.sh"          21 hours ago   Up 21 hours               192.168.1.45:80->80/tcp, 192.168.1.45:443->443/tcp                                      hsoftdevapache
edbf05ab1063   oracle/database:19.3.0-ee   "/bin/sh -c 'exec $O…"   27 hours ago   Up 27 hours               192.168.1.45:1521->1521/tcp, 192.168.1.45:2484->2484/tcp, 192.168.1.45:5500->5500/tcp   oracle19c
2a0171d39bd7   3ac5e3e865da                "startAdminServer.sh"    44 hours ago   Up 44 hours (unhealthy)   7002/tcp, 8001-8002/tcp, 8453/tcp, 192.168.1.45:7040->7001/tcp                          hsoftdev

 

 
728x90
반응형