This post sets out to create a fully equipped Docker image containing a standalone installation of Oracle SOA Suite 12c, running with a compact domain configured to live in it’s own Oracle XE database.
There are multiple resources available on the web, where a Docker image containing an Quick Start installation of SOA Suite 12c is demonstrated, but there does not seem to be an example with a compact domain.
We took this as a challenge, and are now proud to present to you a guide to creating your own!

The finished product will therefore have the following:

  • SOA Suite 12c installation
  • Compact domain
  • Oracle XE Database
  • Oracle Enterprise Linux 7.1 (OEL7.1)

Prerequisites

  • Basic knowledge of Linux
  • Host OS needs to run a kernel with version higher than 2.6.24
  • Root level access to Host OS
  • 8GB of RAM or more
  • 40GB of disk space available or more
  • Installation resources available (see below)
  • Installation of Docker including modifications (see here)
  • This zip file

Getting started

We will not create our Docker image in one go, but we’ll use Docker’s abilties to tag intermediate images as building blocks to our advantage. With Docker, you are able to create your own repository of purpose-built images which you can then use to extend further for your specific needs.
Here, we will create two images in total. The first one is an image with the database, and the second one is our final product which will build upon the database image: the Oracle SOA Suite 12c image.

Installation resources

Before we can get started on creating the Docker image, we’ll need the installation resources, specifically the installers for our database, the Oracle JDK and SOA Suite 12c.

Oracle Express Edition Database

The Oracle Database Express Edition 11g Release 2 for Linux x64 is freely available from their own site. The direct link to the zipped Linux RPM is here.

Oracle Java SE SDK 1.7

At Oracles site, you’ll be able to find the latest version of JDK7. SOA Suite 12c will not work with Java 8 yet, so version 7 will suit us fine. At the moment of writing Oracle offers JDK7u79, which can be found somewhere on this page.

We actually need this RPM-file.

Oracle SOA Suite 12c Quick Start Installer

The Oracle SOA Suite 12c is conveniently packaged into a Quick Start Installer, which can be found on this page.

We need the “All Platforms – Generic 64 bit JVM”-version, the direct link is here.

How to read this document

In this document, we’ll display prompts as follows:

host#      - a command you type on the host system (as root)
container# - a command you type inside the container (as root)
container$ - a command you type inside the container (as oracle)

If you haven’t done so already, please follow this blog post to make the neccessary modifications to your system to accommodate the creation of the SOA Suite Docker image, specifically the SELinux configuration and the larger Docker image size.

Creating the Oracle XE image

Organizing things is always a good idea, and when creating Docker images it isn’t any different. Therefore, we’ll create a dedicated folder for our files at the root level on our host machine.

host# mkdir –p /dockerscripts/oel7-xe/

The zip-file containing the installer for the database will need to go in this directory.
Copy and unzip the zip-file listed in the prerequisites section above (oel7-xe.zip) into the same directory.

Now we are ready to go!
But what does it do?

There are quite a few files in our directory now, the most important of which is the one called Dockerfile.
This is the file which holds all commands for Docker to execute, and we’ll elaborate on that a little while we are here anyway. Please not that the full documentation on Dockerfiles can be found here, and that we’ll not discuss this, but instead focus on the steps needed for the creation of our database image.
If you are really interested in this stuff, you can read the blog post I wrote as a follow up here.

Start automated creation of image

Punch in the following commands, and wait a little while for Docker to complete all the steps.

host# cd /dockerscripts/oel7-xe/
host# sh build.sh

Once completed, you’ll be able to see the following:

host# docker images
REPOSITORY        TAG      IMAGE ID       CREATED       VIRTUAL SIZE
mtijhof/oel7-xe   latest   08cdef33fc5e   1 hour ago    2.176 GB
oraclelinux       latest   8a2b759d9dd8   1 hour ago    189.5 MB

Congratulations, you now have a working Docker image with the Oracle XE database installed!

Testing the database image

As we now have this freshly created image, it is absolutely useless until you actually start it. We use the docker run command for that, but we need to add some extra instructions for it to work right.
We need to forward the ports, in order for them to be accessible on the host. Here, we are forwarding ports 22 (SSH), 1521 (database) and 8080 (http) so we can access the container with PuTTY or SSH, with a database adapter and with our browser. Please note the forwarded ports are 10000 higher than the original. This means port 8080 becomes (8080 + 10000) = 18080.

host# docker run -dt -p 10022:22 -p 11521:1521 -p 18080:8080 mtijhof/oel7-xe

One could also use the provided shell script:

host# sh start.sh

This will start a new container and dump you back into the shell:

host# sh start.sh
f604ca4d72f90e72ed5d61c9fee34375fcc02c8ec244f86a7ab87bd303e07aeb
host#

You can check the running containers with docker ps:

host# docker ps
CONTAINER ID        IMAGE                    COMMAND                CREATED              STATUS              PORTS                                                                     NAMES
f604ca4d72f9        mtijhof/oel7-xe:latest   ""/bin/sh -c 'sed -   About a minute ago   Up About a minute   0.0.0.0:10022->22/tcp, 0.0.0.0:11521->1521/tcp, 0.0.0.0:18080->8080/tcp   suspicious_mayer

We can now log on to our Docker container with ssh.

host# ssh oracle@localhost -p 10022
The authenticity of host '[localhost]:10022 ([::1]:10022)' can't be established.
RSA key fingerprint is c1:e6:4a:c1:20:aa:b5:d2:16:31:52:89:cd:35:83:f6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:10022' (RSA) to the list of known hosts.
oracle@localhost's password:
Last login: Thu Jul  2 11:25:39 2015
[oracle@f604ca4d72f9 ~]$

In the last line you see [oracle@ ~]$. This means we are now user oracle and logged on to our container!
If we run the following command, we’ll see the status of our database, and it should say it is READY.

container$ lsnrctl status
<! -- snip -- !>
Service "XE" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
<! -- snip -- !>

Logout of the container and get ready to proceed with the next section: creating the SOA Suite image.

Creating the Oracle SOA Suite 12c image

The Dockerfile used to build the SOA Suite 12c image uses the Oracle XE image as its base, and therefore this step cannot be executed without the previous one. Continue only if you have created the image named mtijhof/oel7-xe.
Create the folder for our software first, as we need to put a few files in there.

host# mkdir –p /dockerscripts/oel7-soa/

To create the image, we need the previously downloaded files, namely the Oracle JDK and the SOA Suite 12c installer files.
Copy or move the Oracle JDK installer into the folder we just created (oel7-soa).
The Oracle SOA Suite 12c Quick Start Installer files also need to be placed in the same folder where we put the Oracle JDK RPM.
Copy and unzip the zip-file referenced in the prerequisites called oel7-soa.zip into the now familiar oel7-soa directory.

If you are really interested in this stuff, you can read the blog post I wrote as a follow up here.

Start automated creation of image

Now we are ready to go!
Punch in some more commands, and wait a not so little while for Docker to complete all the steps. Warning: this will take quite some time, up to 2 hours!

host# cd /dockerscripts/oel7-soa/
host# sh build.sh

Once completed successfully, you’ll be able to see the following:

host# docker images
REPOSITORY         TAG       IMAGE ID        CREATED         VIRTUAL SIZE
mtijhof/oel7-xe    latest    08cdef33fc5e    4 hours ago     2.176 GB
mtijhof/oel7-soa   latest    0d7dc60f09dc    10 minutes ago  7.572 GB
oraclelinux        latest    8a2b759d9dd8    4 hours ago     189.5 MB

Testing the SOA Suite 12c image

We are using the docker run command to start our container again, and we still need to add some extra instructions for it to work right.
Here, we are forwarding ports 22 (SSH), 1521 (database), 7001 (http for EM) and 8080 (http for APEX) so we can access the container with PuTTY or SSH, with a database adapter and with our browser. Please note the forwarded ports are 10000 higher than the original. This means port 8080 becomes (8080 + 10000) = 18080.
Running the below command will yield the following:

host# docker run -dt -p 7001:7001 -p 18080:8080 -p 10022:22 -p 1521:1521 mtijhof/oel7-soa
41da5fbcb0ee3b78357bcb31bf74e9ee3f8653cae99450882d62f7c2afdab4d7

Your Docker image containing Oracle SOA Suite 12c with a compact domain on it’s own Oracle XE database is now starting up!
If you want to track the progress of the applications starting up you can run to following command:

host# docker logs -f 41da5fbcb0ee3b78357bcb31bf74e9ee3f8653cae99450882d62f7c2afdab4d7

Here, 41da5fbcb0ee3b78357bcb31bf74e9ee3f8653cae99450882d62f7c2afdab4d7 is the ID of the container we just started.
Wait until the following is shown:

SOA Platform is running and accepting requests

All done!
You can access your EM from your own browser at http://localhost:17001/em/.

This post is part of a series on virtualization with Docker.

  1. What is Docker?
  2. Setting up Docker
  3. Creating an Oracle SOA Suite 12c Docker image
  4. Resizing the disk on a VirtualBox OEL7 image
  5. Jenkins: Setting up a Shared Library for your pipelines
  6. Jenkins: Using Gradle to build your Shared Library
  7. Jenkins: Creating a custom pipeline step in your library
  8. Jenkins: Running a declarative pipeline from your Shared Library

Houd jij je kennis graag up to date?

Mis niets meer van onze kennisdocumenten, events, blogs en cases: ontvang als eerste het laatste nieuws in je inbox!

Fijn dat we je op de hoogte mogen houden!