Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding OHS 12.2.1.4 dockerfiles and removing 12.2.1.3 which is no lon… #2796

Merged
merged 20 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion OracleHTTPServer/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2001, 2019, Oracle Corporation. All rights reserved.
Copyright (c) 2020, 2024, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
59 changes: 26 additions & 33 deletions OracleHTTPServer/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Oracle HTTP Server on Docker
===============
# Oracle HTTP Server in containers
===================================
This project includes quick start dockerfiles and samples for standalone Oracle HTTP Server based on Oracle Linux and Oracle JDK 8 (Server).
The certification of OHS on Docker does not require the use of any file presented in this repository.
The certification of OHS in containers does not require the use of any file presented in this repository.
Customers and users are welcome to use them as starters, and customize/tweak, or create from scratch new scripts and Dockerfiles.

## How to Build and Run
Expand All @@ -12,67 +12,60 @@ The **buildDockerImage.sh** script is just a utility shell script that performs
### Building Oracle JDK (Server JRE) base image
You must first download the Oracle Server JRE binary and drop in folder `../OracleJava/java-8` and build that image. For more information, visit the [OracleJava](../OracleJava) folder's [README](../OracleJava/README.md) file.

$ cd ../OracleJava/java-8
$ sh build.sh
You can also pull the Oracle Server JRE 8 image from [Oracle Container Registry](https://container-registry.oracle.com) or the [Docker Store](https://store.docker.com/images/oracle-serverjre-8).
"$ cd ../OracleJava/java-8"
"$ sh build.sh"

### Building OHS Docker Image
You can also pull the Oracle Server JRE 8 image from [Oracle Container Registry](https://container-registry.oracle.com).

### Building OHS Container Image
IMPORTANT: You have to download the OHS binary and put it in place (see .download files inside dockerfiles/).

Download the required package (see .download file) and drop them in the version folder (12.2.1.3.0). Then go into the **dockerfiles** folder and run the **buildDockerImage.sh** script as root providing the version name with -v option.
Download the required package (see .download file) and drop them in the version folder (12.2.1.4.0). Then go into the **dockerfiles** folder and run the **buildDockerImage.sh** script as root providing the version name with -v option.

$ sh buildDockerImage.sh -v 12.2.1.3.0
"$ sh buildDockerImage.sh -v 12.2.1.4.0"

IMPORTANT: The resulting image will have a pre-configured domain.
IMPORTANT: The resulting image will have a pre-configured domain.

### Providing the Node Manager password
The user name and password must be supplied in a domain.properties file located in a HOST directory that you will map at Docker runtime with the -v option to the image directory /u01/oracle/bootdir. The properties file enables the scripts to configure the correct authentication for the Node Manager.
The user name and password must be supplied in a domain.properties file located in a HOST directory that you will map at runtime with the -v option to the image directory /u01/oracle/bootdir. The properties file enables the scripts to configure the correct authentication for the Node Manager.

The format of the domain.properties file is key=value pair:
username=mynodemanagerusername
password=mynodemanagerpassword

### How to run container



If you want to start the OHS container without specifying any configuration for mod_weblogic:
1. To start the OHS container with oracle/ohs:12.2.1.3.0 image, run the following command:


docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -it --name ohs -p 7777:7777 oracle/ohs:12.2.1.3.0
1. To start the OHS container with oracle/ohs:12.2.1.4.0 image, run the following command:

"$ docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -it --name ohs -p 7777:7777 oracle/ohs:12.2.1.4.0"

If you want to start the OHS container with some pre-specified mod_weblogic configuration:
1. Depending on your weblogic environment , create a **custom_mod_wl_ohs.conf** file by referring to container-scripts/mod_wl_ohs.conf.sample and section 2.4 @ [OHS 12c Documentation](http://docs.oracle.com/middleware/12213/webtier/develop-plugin/oracle.htm#PLGWL553)
1. Depending on your weblogic environment , create a **custom_mod_wl_ohs.conf** file by referring to container-scripts/mod_wl_ohs.conf.sample and section 2.4 @ [OHS 12c Documentation](http://docs.oracle.com/middleware/12214/webtier/develop-plugin/oracle.htm#PLGWL553)

2. Place the custom_mod_wl_ohs.conf file in a directory in the host say,"/scratch/DockerVolume/OHSVolume" and then mount this directory into the container at the location "/config".
By doing so, the contents of host directory /scratch/DockerVolume/OHSVolume(and hence custom_mod_wl_ohs.conf) will become available in the container at the mount point.
This mounting can be done by using the -v option with the 'docker run' command as shown below. The following command will start the OHS container with oracle/ohs:12.2.1.3.0 image and the host directory "/scratch/DockerVolume/OHSVolume" will get mounted at the location "/config" in the container:
By doing so, the contents of host directory /scratch/DockerVolume/OHSVolume(and hence custom_mod_wl_ohs.conf) will become available in the container at the mount point.
This mounting can be done by using the -v option with the 'docker run' command as shown below. The following command will start the OHS container with oracle/ohs:12.2.1.4.0 image and the host directory "/scratch/DockerVolume/OHSVolume" will get mounted at the location "/config" in the container:

$ docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -v /scratch/DockerVolume/OHSVolume:/config -w /config -d --name ohs -p 7777:7777 oracle/ohs:12.2.1.3.0
"$ docker run -v `HOST PATH where the domain.properties file is`:/u01/oracle/bootdir -v /scratch/DockerVolume/OHSVolume:/config -w /config -d --name ohs -p 7777:7777 oracle/ohs:12.2.1.4.0"

### Stopping the OHS instance
To stop the OHS instance, execute the following command:

docker stop ohs (Assuming the name of conatiner is 'ohs')

"$ docker stop <Container name>"

To look at the Docker Container logs run:

$ docker logs --details <Container-id>
To look at the Container logs run:

"$ docker logs --details <Container-id>"

## Support
Oracle HTTP Server on Docker is supported by Oracle.

Oracle HTTP Server in containers is supported by Oracle.

## License
To download and run Oracle HTTP Server 12c Distribution regardless of inside or outside a Docker container, and regardless of the distribution, you must download the binaries from Oracle website and accept the license indicated at that page.
To download and run Oracle HTTP Server 12c Distribution regardless of inside or outside a container, and regardless of the distribution, you must download the binaries from Oracle website and accept the license indicated at that page.

To download and run Oracle JDK regardless of inside or outside a Docker container, you must download the binary from Oracle website and accept the license indicated at that pge.
To download and run Oracle JDK regardless of inside or outside a container, you must download the binary from Oracle website and accept the license indicated at that page.

All scripts and files hosted in this project and GitHub [docker/OracleHTTPServer](./) repository required to build the Docker images are, unless otherwise noted, released under the Universal Permissive License v1.0.
All scripts and files hosted in this project and GitHub [docker/OracleHTTPServer](./) repository required to build the images are, unless otherwise noted, released under the Universal Permissive License v1.0.

## Copyright
Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,70 +1,64 @@
#
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.


#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
# ORACLE HTTP Server DOCKERFILES PROJECT
# -----------------------------------------
# This is the DockerFile for Oracle HTTP Server 12.2.1.3.0
# This is the DockerFile for Oracle HTTP Server 12.2.1.4.0
#
# IMPORTANT
# -------------------------------------------
# The resulting image of this Dockerfile would have Oracle Linux 7 and Oracle HTTP Server 12.2.1.3.0 installed in standalone mode.
# The resulting image of this Dockerfile would have Oracle Linux 7 and Oracle HTTP Server 12.2.1.4.0 installed in standalone mode.

# A standalone domain will be configured in this image
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) fmw_12.2.1.3.0_ohs_linux64_Disk1_1of1.zip
# (1) fmw_12.2.1.4.0_ohs_linux64_Disk1_1of1.zip
# Download from http://www.oracle.com/technetwork/middleware/webtier/downloads/index-jsp-156711.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put all downloaded files in the same directory as this Dockerfile
# As root user run following command manually:
#
# $ sh buildDockerImage.sh -v 12.2.1.3.0
# $ sh buildDockerImage.sh -v 12.2.1.4.0
#
# Alternatively you can also run
#
# $ docker build --force-rm=true --no-cache=true --rm=true -t oracle/$IMAGE_NAME:$VERSION-$INSTALL_TYPE .
#
# For example
#
# $ docker build --force-rm=true --no-cache=true --rm=true -t oracle/ohs:12.2.1.3.0 .
# $ docker build --force-rm=true --no-cache=true --rm=true -t oracle/ohs:12.2.1.4.0 .
#
# Pull serverjre:8 base image
# -----------------------------------
FROM oracle/serverjre:8

# Maintainer
# ------------------------------------
MAINTAINER Prabhat Kishore <[email protected]>

# Environment variables required for this build (do NOT change)
# ----------------------------------------------
ENV OHS_PKG=fmw_12.2.1.3.0_ohs_linux64_Disk1_1of1.zip \
OHS_BIN=fmw_12.2.1.3.0_ohs_linux64.bin \
ORACLE_HOME=/u01/oracle/ohssa \
PATH=$PATH:/usr/java/default/bin:/u01/oracle/ohssa/oracle_common/common/bin \
NM_PORT=5556 \
OHS_LISTEN_PORT=7777 \
OHS_SSL_PORT=4443 \
JAVA_HOME=/usr/java/default \
MW_HOME=/u01/oracle/ohssa \
DOMAIN_NAME=ohsDomain \
OHS_COMPONENT_NAME=ohs1 \
PATH=$PATH:$ORACLE_HOME/oracle_common/common/bin:$ORACLE_HOME/user_projects/domains/ohsDomain/bin:/u01/oracle/container-scripts \
WLST_HOME=/u01/oracle/ohssa/oracle_common/common/bin
ENV OHS_PKG=fmw_12.2.1.4.0_ohs_linux64_Disk1_1of1.zip
ENV OHS_BIN=fmw_12.2.1.4.0_ohs_linux64.bin
ENV ORACLE_HOME=/u01/oracle
ENV NM_PORT=5556
ENV OHS_LISTEN_PORT=7777
ENV OHS_SSL_PORT=4443
ENV JAVA_HOME=/usr/java/default
ENV DOMAIN_NAME=ohsDomain
ENV OHS_COMPONENT_NAME=ohs1
ENV PATH=${PATH}:${ORACLE_HOME}:/usr/java/default/bin:${ORACLE_HOME}/oracle_common/common/bin:${ORACLE_HOME}/user_projects/domains/ohsDomain/bin
ENV WLST_HOME=/u01/oracle/oracle_common/common/bin


# Copy packages to the new drive
# -------------------------------------------------------
COPY $OHS_PKG install.file oraInst.loc /u01/
COPY ${OHS_PKG} install.file oraInst.loc /u01/

# Install OL7 required packages. Refer FMW 12.2.1.3 System requirements guide for complete list of packages
# Install OL7 required packages. Refer FMW 12.2.1.4 System requirements guide for complete list of packages
# Setup filesystem and oracle user
#---------------------------------------------------------------------------------------------------------
RUN yum install -y unzip libaio sysstat make psmisc gcc && \
Expand All @@ -77,20 +71,24 @@ RUN yum install -y unzip libaio sysstat make psmisc gcc && \
# Go to /u01 as user 'oracle' to proceed with OHS installation
#--------------------------------------------------------
USER oracle
RUN cd /u01 && unzip -q /u01/$OHS_PKG && cd - && \
/u01/$OHS_BIN -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc ORACLE_HOME=$ORACLE_HOME && \
rm /u01/$OHS_BIN /u01/oraInst.loc /u01/install.file && \
mkdir /u01/oracle/container-scripts/ /u01/oracle/logs
WORKDIR /u01
#RUN unzip -q /u01/${OHS_PKG} && cd - && \
RUN unzip -q /u01/${OHS_PKG} && \
/u01/${OHS_BIN} -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc ORACLE_HOME=${ORACLE_HOME} && \
rm /u01/${OHS_BIN} /u01/oraInst.loc /u01/install.file && \
mkdir -p /u01/oracle/logs && \
chown oracle:oracle -R /u01/oracle/logs

# Copy required files to build this image
# ------------------------------------------------------
COPY container-scripts/* /u01/oracle/container-scripts/
COPY container-scripts/* /u01/oracle/

#Expose all Ports
EXPOSE $OHS_SSL_PORT $OHS_LISTEN_PORT $NM_PORT
EXPOSE ${OHS_SSL_PORT} ${OHS_LISTEN_PORT} ${NM_PORT}

# Final setup
WORKDIR /u01/oracle/container-scripts
USER oracle
WORKDIR ${ORACLE_HOME}

# Provision OHS instance
CMD ["/u01/oracle/container-scripts/provisionOHS.sh"]
CMD ["/u01/oracle/provisionOHS.sh"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# Author: [email protected]
#
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
Expand All @@ -25,11 +25,11 @@
#DOMAIN_NAME - Env Value set by Dockerfile , default is "ohsDOmain"
#OHS_COMPONENT_NAME - Env Value set by Dockerfile , default is "ohs1"
#*************************************************************************
echo "MW_HOME=${MW_HOME:?"Please set MW_HOME"}"
echo "ORACLE_HOME=${ORACLE_HOME:?"Please set MW_HOME"}"
echo "DOMAIN_NAME=${DOMAIN_NAME:?"Please set DOMAIN_NAME"}"
echo "OHS_COMPONENT_NAME=${OHS_COMPONENT_NAME:?"Please set OHS_COMPONENT_NAME"}"

DOMAIN_HOME=${MW_HOME}/user_projects/domains/${DOMAIN_NAME}
DOMAIN_HOME=${ORACLE_HOME}/user_projects/domains/${DOMAIN_NAME}
INSTANCE_CONFIG_HOME=$DOMAIN_HOME/config/fmwconfig/components/OHS/${OHS_COMPONENT_NAME}
export INSTANCE_CONFIG_HOME
echo "INSTANCE_CONFIG_DIR=${INSTANCE_CONFIG_HOME}"
Expand All @@ -41,7 +41,7 @@ echo "MODWLSCONFIGFILE IS ${modwlsconfigfile}"

# Check and copy custom_mod_wl_ohs.conf to OHS Instance Home
if [[ -n "${modwlsconfigfile/[ ]*\n/}" ]]; then
cd ${INSTANCE_CONFIG_HOME}
cd ${INSTANCE_CONFIG_HOME} || exit
mv mod_wl_ohs.conf mod_wl_ohs.conf.ORIGINAL
echo "Copying ${modwlsconfigfile} to ${INSTANCE_CONFIG_HOME} "
cp ${modwlsconfigfile} ${INSTANCE_CONFIG_HOME}/mod_wl_ohs.conf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
#
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
Expand All @@ -17,7 +17,12 @@
ohs_ssl_port = (os.environ.get("OHS_SSL_PORT", "3333"))
ohs_comp_name = os.environ.get("OHS_COMPONENT_NAME", "ohs1")
domain_name = os.environ.get("DOMAIN_NAME", "ohsDomain")
domain_path = '/u01/oracle/ohssa/user_projects/domains/' + domain_name
domain_path = os.environ.get("DOMAIN_HOME", "/u01/oracle/user_projects/domains/ohsDomain")

print('domain_name : [%s]' % domain_name);
print('domain_path : [%s]' % domain_path);
print('ohs_comp_name : [%s]' % ohs_comp_name);

# Select OHS standalone template
# ==============================================
setTopologyProfile('Compact')
Expand Down Expand Up @@ -47,7 +52,7 @@
setOption('OverwriteDomain', 'true')
#Write Domain, close template and exit
# ======================================================================
#writeDomain(r'/u01/oracle/ohssa/user_projects/domains/ohsDomain')
#writeDomain(r'/u01/oracle/user_projects/domains/ohsDomain')
writeDomain(domain_path)
dumpStack()
closeTemplate()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016-2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
#
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
Expand All @@ -8,9 +8,9 @@
#
#
#Refer to OHS documentation for more details and examples
#Section 2.4 @ http://docs.oracle.com/middleware/12213/webtier/develop-plugin/oracle.htm#PLGWL553
#Section 2.4 @ https://docs.oracle.com/en/middleware/fusion-middleware/web-tier/12.2.1.4/develop-plugin/oracle.html#GUID-A463B189-DF47-4932-8B96-FD4F5FEC8D56
#*************************************************************************
LoadModule weblogic_module "/u01/oracle/ohssa/ohs/modules/mod_wl_ohs.so"
LoadModule weblogic_module "/u01/oracle/ohs/modules/mod_wl_ohs.so"

<IfModule mod_weblogic.c>
WebLogicHost WEBLOGIC_HOST
Expand Down
Loading