Skip to content

Commit efb2183

Browse files
committed
Merge pull request #2 from brunoborges/master
Add Coherence Dockerfiles and scripts
2 parents f65fd60 + 6546070 commit efb2183

17 files changed

+327
-0
lines changed

OracleCoherence/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fmw_12.1.3.0.0_coherence_Disk1_1of1.zip
2+
jdk-8u25-linux-x64.rpm

OracleCoherence/Dockerfile

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# LICENSE CDDL 1.0 + GPL 2.0
2+
#
3+
# ORACLE DOCKERFILES PROJECT
4+
# --------------------------
5+
# This is the Dockerfile for Coherence 12.1.3 Standalone Distribution
6+
#
7+
# REQUIRED BASE IMAGE TO BUILD THIS IMAGE
8+
# ---------------------------------------
9+
# Visit for more info:
10+
# - https://registry.hub.docker.com/_/oraclelinux/
11+
#
12+
# REQUIRED FILES TO BUILD THIS IMAGE
13+
# ----------------------------------
14+
# (1) fmw_12.1.3.0.0_coherence_Disk1_1of1.zip
15+
# Download the Standalone installer from http://www.oracle.com/technetwork/middleware/coherence/downloads/index.html
16+
#
17+
# (2) jdk-8u25-linux-x64.rpm
18+
# Download from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
19+
#
20+
# HOW TO BUILD THIS IMAGE
21+
# -----------------------
22+
# Put all downloaded files in the same directory as this Dockerfile
23+
# Run:
24+
# $ sudo sh build.sh
25+
#
26+
27+
# Pull base image
28+
# ---------------
29+
FROM oraclelinux:7
30+
31+
# Maintainer
32+
# ----------
33+
MAINTAINER Bruno Borges <bruno.borges@oracle.com>
34+
35+
# Environment variables required for this build (do NOT change)
36+
ENV JAVA_RPM jdk-8u25-linux-x64.rpm
37+
ENV FMW_PKG fmw_12.1.3.0.0_coherence_Disk1_1of1.zip
38+
ENV FMW_JAR fmw_12.1.3.0.0_coherence.jar
39+
ENV FMW_DIR coherence12130
40+
ENV COHERENCE_HOME /u01/$FMW_DIR/coherence
41+
42+
# Install and configure Oracle JDK 8u25
43+
# -------------------------------------
44+
COPY config/$JAVA_RPM /root/
45+
RUN rpm -i /root/$JAVA_RPM && rm /root/$JAVA_RPM
46+
ENV JAVA_HOME /usr/java/default
47+
ENV CONFIG_JVM_ARGS -Djava.security.egd=file:/dev/./urandom
48+
49+
# Setup required packages (unzip), filesystem, and oracle user
50+
# ------------------------------------------------------------
51+
RUN yum install -y unzip && \
52+
mkdir /u01 && chmod a+xr /u01 && \
53+
useradd -b /u01 -m -s /bin/bash oracle && \
54+
echo oracle:oracle | chpasswd
55+
56+
# Copy files required to build this image
57+
COPY config/$FMW_PKG /u01/
58+
COPY config/oraInst.loc /u01/oraInst.loc
59+
COPY config/install.file /u01/install.file
60+
61+
WORKDIR /u01
62+
RUN chown oracle:oracle -R /u01
63+
USER oracle
64+
65+
# Installation of Coherence
66+
RUN unzip /u01/$FMW_PKG -d /u01/oracle/ > /dev/null && \
67+
rm $FMW_PKG && \
68+
mkdir /u01/oracle/.inventory
69+
70+
WORKDIR /u01/oracle
71+
72+
RUN java -jar $FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME && \
73+
rm $FMW_JAR && \
74+
ln -s /u01/oracle/$FMW_DIR /u01/oracle/coherence
75+
76+
WORKDIR /u01/oracle/$FMW_DIR
77+
78+
# Cleanup
79+
USER root
80+
RUN rm /u01/oraInst.loc /u01/install.file && \
81+
yum erase -y unzip && \
82+
yum clean all
83+
84+
VOLUME /u01/oracle/coherence_config
85+
86+
USER oracle
87+
88+
# Define default command to start bash.
89+
CMD ["bash"]

OracleCoherence/LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Unless otherwise noted, all files in this distribution are released
2+
under the Common Development and Distribution License (CDDL) 1.0
3+
and GNU Public License 2.0 licenses.

OracleCoherence/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Oracle Coherence 12c Docker Image
2+
3+
This is a Dockerfile for [Oracle Coherence 12c](http://www.oracle.com/technetwork/middleware/coherence/overview/index.html). The purpose of this Docker container is to facilitate the setup of development and integration testing environments for developers.
4+
5+
This image uses the Standalone Distribution of Coherence 12c.
6+
7+
**IMPORTANT**: Oracle **does not support Coherence on Docker**, including but not limited to Development, Integration, and Production environments.
8+
9+
## Oracle Linux Base Image
10+
For more information and documentation, read the [Docker Images from Oracle Linux](https://registry.hub.docker.com/_/oraclelinux/) page.
11+
12+
### Standalone Distribution
13+
Fore more information on the Coherence 12c Standalone Distribution, visit [Coherence 12.1.3 Documentation](http://docs.oracle.com/middleware/1213/coherence/index.html).
14+
15+
## How to Build
16+
17+
Follow this procedure:
18+
19+
1. Checkout the GitHub weblogic-docker repository
20+
21+
$ git checkout git@github.com:oracle/docker-images.git
22+
23+
2. Go to the **OracleCoherence** folder
24+
25+
$ cd OracleCoherence
26+
27+
3. [Download](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) and drop the Oracle JDK 8u25 RPM 64bit file **jdk-8u25-linux-x64.rpm** in this folder
28+
29+
Linux x64 135.6 MB jdk-8u25-linux-x64.rpm
30+
31+
4. [Download](http://www.oracle.com/technetwork/middleware/coherence/downloads/index.html) and drop the Coherence 12c Standalone Distribution file **fmw_12.1.3.0.0_coherence_Disk1_1of1.zip** in this folder
32+
33+
Coherence Stand-Alone Install (87 MB) - fmw_12.1.3.0.0_coherence_Disk1_1of1.zip
34+
35+
5. Execute the build script as **root**
36+
37+
$ sudo sh buildDockerImage.sh
38+
39+
## Booting up Oracle Coherence 12c on Docker
40+
41+
Along with the Dockerfile, two scripts are also provided to help you run Cache Servers, and the Coherence Console (without local storage).
42+
43+
Start a CacheServer:
44+
$ sudo sh dockCacheServer.sh [fullpath dir w/ tangosol-coherence-override.xml and cache configs]
45+
46+
Start Coherence Console:
47+
$ sudo sh dockCoherenceConsole.sh [fullpath dir w/ tangosol-coherence-override.xml and cache configs]
48+
49+
## Issues
50+
If you find any issues with this Docker project, please report through the [GitHub Issues page](https://github.com/oracle/docker-images/issues).
51+
52+
## License
53+
To download and run Coherence 12c Distribution regardless of inside or outside a Docker container, and regardless of which distribution, you must agree and accept the [OTN Standard License Terms](http://www.oracle.com/technetwork/licenses/standard-license-152015.html).
54+
55+
To download and run Oracle JDK regardless of inside or outside a Docker container, you must agree and accept the [Oracle Binary Code License Agreement for Java SE](http://www.oracle.com/technetwork/java/javase/terms/license/index.html).
56+
57+
All scripts and files hosted in this project on GitHub [docker-images/OracleCoherence](https://github.com/oracle/docker-images/OracleCoherence) repository required to build the Docker images are, unless otherwise noted, released under the Common Development and Distribution License (CDDL) 1.0 and GNU Public License 2.0 licenses, except for the files listed above with their specific licenses.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/bin/bash
2+
DOCKING="false"
3+
SCRIPTS_DIR="$( cd "$( dirname "$0" )" && pwd )"
4+
. $SCRIPTS_DIR/setDockerEnv.sh
5+
6+
cd $SCRIPTS_DIR/..
7+
8+
JAVA_VERSION="8u25"
9+
JAVA_PKG="config/jdk-${JAVA_VERSION}-linux-x64.rpm"
10+
JAVA_PKG_MD5="6a8897b5d92e5850ef3458aa89a5e9d7"
11+
FMW_PKG="config/fmw_12.1.3.0.0_coherence_Disk1_1of1.zip"
12+
FMW_PKG_MD5="a4affba654a0664284e6a454341f3e93"
13+
14+
# Validate Java Package
15+
echo "====================="
16+
17+
if [ ! -e $JAVA_PKG ]
18+
then
19+
echo "Download the Oracle JDK ${JAVA_VERSION} RPM for 64 bit and"
20+
echo "drop the file $JAVA_PKG in this folder before"
21+
echo "building this image!"
22+
exit
23+
fi
24+
25+
MD5="$JAVA_PKG_MD5 $JAVA_PKG"
26+
MD5_CHECK="`md5sum $JAVA_PKG`"
27+
28+
if [ "$MD5" != "$MD5_CHECK" ]
29+
then
30+
echo "MD5 for $JAVA_PKG does not match! Download again!"
31+
exit
32+
fi
33+
34+
#
35+
# Validate FMW Package
36+
echo "====================="
37+
38+
if [ ! -e $FMW_PKG ]
39+
then
40+
echo "Download the Coherence 12c Standalone installer and"
41+
echo "drop the file $FMW_PKG in this folder before"
42+
echo "building this Coherence Docker image!"
43+
exit
44+
fi
45+
46+
MD5="$FMW_PKG_MD5 $FMW_PKG"
47+
MD5_CHECK="`md5sum $FMW_PKG`"
48+
49+
if [ "$MD5" != "$MD5_CHECK" ]
50+
then
51+
echo "MD5 for $FMW_PKG does not match! Download again!"
52+
exit
53+
fi
54+
55+
echo "====================="
56+
57+
docker build -t $DOCKER_IMAGE_NAME .
58+
59+
echo ""
60+
echo "Coherence Docker Container is ready to be used. To start, run 'dockCacheServer.sh -h'"
61+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
SCRIPTS_DIR="$( cd "$( dirname "$0" )" && pwd )"
4+
. $SCRIPTS_DIR/setDockerEnv.sh $*
5+
6+
# RUN THE DOCKER COMMAND
7+
docker run -d \
8+
--net=host \
9+
-v $1:/u01/oracle/coherence_config \
10+
$DOCKER_IMAGE_NAME java -cp /u01/oracle/coherence_config:/u01/oracle/coherence/coherence/lib/coherence.jar \
11+
com.tangosol.net.DefaultCacheServer
12+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
SCRIPTS_DIR="$( cd "$( dirname "$0" )" && pwd )"
4+
. $SCRIPTS_DIR/setDockerEnv.sh $*
5+
6+
# RUN THE DOCKER COMMAND
7+
docker run -ti \
8+
--net=host \
9+
-v $1:/u01/oracle/coherence_config \
10+
$DOCKER_IMAGE_NAME java -cp /u01/oracle/coherence_config:/u01/oracle/coherence/coherence/lib/coherence.jar \
11+
-Dtangosol.coherence.distributed.localstorage=false com.tangosol.net.CacheFactory
12+

OracleCoherence/bin/setDockerEnv.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
DOCKER_IMAGE_NAME="oracle/coherence:12.1.3"
3+
4+
SCRIPTS_DIR="$( cd "$( dirname "$0" )" && pwd )"
5+
6+
if [ "$1" = "" ] || [ "$1" = "-h" ]; then
7+
MAY_SHOW_USAGE="true"
8+
fi
9+
10+
if [ "$DOCKING" != "false" ] && [ "$MAY_SHOW_USAGE" = "true" ]; then
11+
echo ""
12+
echo "Oracle Coherence 12c on Docker"
13+
echo "------------------------------"
14+
echo "Usage: $0 <full-path-cache-config-folder>"
15+
echo ""
16+
echo "You must point a folder containing 'tangosol-coherence-override.xml' and your Cache configuration files."
17+
echo "Example: # $0 $SCRIPTS_DIR/../example-grid"
18+
echo ""
19+
exit 0
20+
fi

OracleCoherence/config/fmw_12.1.3.0.0_coherence_Disk1_1of1.zip.download

Whitespace-only changes.

OracleCoherence/config/install.file

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[ENGINE]
2+
3+
#DO NOT CHANGE THIS.
4+
Response File Version=1.0.0.0.0
5+
6+
[GENERIC]
7+
8+
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
9+
ORACLE_HOME=/u01/oracle/coherence12130
10+
11+
#Set this variable value to the Installation Type selected. e.g. Typical, Typical With Examples.
12+
INSTALL_TYPE=Typical With Examples
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Download this package from Oracle.

OracleCoherence/config/oraInst.loc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
inventory_loc=/u01/oracle/.inventory
2+
inst_group=oracle
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Coherence Example Grid for Docker
2+
==============
3+
These files were extracted from the Coherence 12.1.3 documentation.
4+
5+
[4 Building Your First Coherence Application](https://docs.oracle.com/middleware/1213/coherence/develop-applications/gs_example.htm#COHDG5039)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
3+
<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
5+
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">
6+
<caching-scheme-mapping>
7+
<cache-mapping>
8+
<cache-name>hello-example</cache-name>
9+
<scheme-name>distributed</scheme-name>
10+
</cache-mapping>
11+
</caching-scheme-mapping>
12+
13+
<caching-schemes>
14+
<distributed-scheme>
15+
<scheme-name>distributed</scheme-name>
16+
<service-name>DistributedCache</service-name>
17+
<backing-map-scheme>
18+
<local-scheme/>
19+
</backing-map-scheme>
20+
<autostart>true</autostart>
21+
</distributed-scheme>
22+
</caching-schemes>
23+
</cache-config>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version='1.0'?>
2+
3+
<coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
5+
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config coherence-operational-config.xsd">
6+
<cluster-config>
7+
<member-identity>
8+
<cluster-name>example-cluster</cluster-name>
9+
</member-identity>
10+
11+
<multicast-listener>
12+
<address>224.3.6.0</address>
13+
<port>9999</port>
14+
<time-to-live>0</time-to-live>
15+
</multicast-listener>
16+
</cluster-config>
17+
18+
<configurable-cache-factory-config>
19+
<init-params>
20+
<init-param>
21+
<param-type>java.lang.String</param-type>
22+
<param-value system-property="tangosol.coherence.cacheconfig">example-config.xml</param-value>
23+
</init-param>
24+
</init-params>
25+
</configurable-cache-factory-config>
26+
</coherence>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Download Oracle Coherence Standalone from http://www.oracle.com/technetwork/middleware/coherence/downloads/index.html and drop the file fmw_12.1.3.0.0_coherence_Disk1_1of1.zip in this folder
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Download this package from Oracle.

0 commit comments

Comments
 (0)