Running the Oracle SOA Suite Environment in a Docker Container
The document discusses running the Oracle SOA Suite environment in a Docker container. It begins with an introduction to Docker and its benefits over virtual machines. It then demonstrates various Docker commands like run, logs, images, ps to launch and manage containers. It also covers building custom images using Dockerfiles. The document provides examples to showcase common Docker tasks like committing changes to an image, pulling images, stopping and removing containers.
Unlocking the Future of AI Agents with Large Language Models
Running the Oracle SOA Suite Environment in a Docker Container
1. BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENEVA
HAMBURG COPENHAGEN LAUSANNE MUNICH STUTTGART VIENNA ZURICH
Running the Oracle SOA Suite
Environment in a Docker Container
Oracle Open World 2015
Guido Schmutz
2. Guido Schmutz
Working for Trivadis for more than 19 years
Oracle ACE Director for Fusion Middleware and SOA
Co-Author of different books
Consultant, Trainer Software Architect for Java, Oracle, SOA and
Big Data / Fast Data
Technology Manager @ Trivadis
More than 25 years of software development experience
Contact: guido.schmutz@trivadis.com
Blog: http://guidoschmutz.wordpress.com
Slideshare: http://de.slideshare.net/gschmutz
Twitter: gschmutz
2
5. Why Docker ?
A stevedore, dockworker and/or
dockeris a waterfront manual laborer
who is involved in loading and
unloading ships.
Today, the vast majority of non-bulk cargo is
transported in intermodal containers
6. Docker – Modeled on the success of shipping containers
Multiplicity of goodsMultiplicity of methods
for transport/Storing
A standard container that
is loaded with virtually any
goods and stays sealed
until it reaches its final
delivery.
Can be loaded and
unloaded, stacked,
transported efficiently over
long distances, and
transferred from one mode
of transport to another.
7. Docker – Modeled on the success of shipping containers
Multiplicity of stacksMultiplicity of hardware
environments
An engine that enables
any payload to be
encapsulated as a
lightweight, portable, self-
sufficient container…
… that can be
manipulated using
standard operations and
run consistently on
virtually any hardware
platform.
Web Application Database Queue Mobile
Application
Developent
VM
Development
Notebook
Data Center Public Cloud
8. VM vs. Container
Virtual Machines includes not only the application
(which may be only 10s of MB) but also an entire
guest operating system (which may be 10s of GB)
Docker Containers are isolated, but share OS
kernel and, where appropriate, bins and libs.
• Result in significally faster deployment, much less
overhead, easier migration and faster boot times
9. Docker Architecture
Docker uses a client/server
architecture
Docker Client talks to the
Docker Daemon
Docker Client and Docker Daemon
• can run on the same machine or
• Client can connect to a remote Daemon
Docker Client and Daemon communicate via sockets or through RESTful API
Docker Registries hold images (private or public)
• Public Docker registry is provided with Docker Hub
• Holds a huge collection of existing images
10. Image Registries
Images can be published to private or
public registries
• Docker Hub hosts the main image registry
• Provides official images
• enables people to upload and share their
own images (both in public an private
repositories)
• Docker provides an image for setting up
one's dedicated registry
• The Docker engine itself has an internal
registry of downloaded images
https://hub.docker.com/
12. Installing Docker
Linux
• best to use the package repositories listed on Docker
website
• Installation process is easy as using apt-get or yum
• All required packages are automatically downloaded
and installed
Mac OS-X / Windows
• Because Docker daemon uses Linux-specific kernel
features, you can't run it natively in OS-X and Windows
• Use docker-machine to create VM's to run Docker
daemon within
• Easiest way to get an environment is through Docker
Toolbox
Linux
Docker Host
Docker Client
Docker Daemon
OS-X / Win
Linux VM
Docker Daemon
Docker Host
Docker Client
13. Running the Docker Client
The default usage of docker is throught the command line docker <command>
• $ docker help shows the available commands
• $ docker <command> --help shows the command-releated documentation
Some of the commands are
• build build an image from a Dockerfile
• exec run a command in a running container
• images list images
• inspect return low-level information on a container or image
• ps list containers
• pull pull an image or a repository from a registry
• run run a command in a new container
• search search Docker Hub for an image
(https://docs.docker.com/reference/commandline/cli/)
15. Docker RUN Command
Most straightforward way to create a
container is the docker run command
docker run --rm ubuntu echo
'hello world'
• Retrieves the latest from Docker
Hub (if it's not yet locally available)
• Executes the echo command available
in the ubuntu image
• Prints the out to the hosts terminal
• --rm to remove the container once the
related process (echo) is completed
• --name to give the container a user-
defined name
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
run
Docker
Registry
ubuntu
xsfdsfd
16. Demo 2: "Echo Hello World"
Runs the echo statement
$ docker run --rm ubuntu echo 'Hello World'
Unable to find image 'ubuntu:14.04' locally
14.04: Pulling from library/ubuntu
c63fb41c2213: Pull complete
99fcaefe76ef: Pull complete
5a4526e952f0: Pull complete
1d073211c498: Pull complete
Digest:
sha256:d4b37c2fd31b0693e9e446e56a175d142b098b5056be2083fb4afe5f97c78fe5
Status: Downloaded newer image for ubuntu:14.04
Hello World
17. Demo 2: "Hello World daemonized and show logs"
In addition to interactive containers, we can create longer-running containers
by running im them daemonized
$ docker run --name my-daemon -d ubuntu /bin/bash -c "while
true; do echo Hello World; sleep 1; done"
$ docker logs –f my-daemon
Hello world!
Hello world!
18. Docker LOGS Command
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
Registry
my-container
Docker redirects stdout and stderr of every
container both to the current terminal and to
Docker's internal logs
$ docker logs <my-container>
Outputs the stdout and stderr log for the given
container
Important parameters are
• -f to keep the log visible and updated in real-
time
• --tail=N where N is the number of most recent
lines to show
logs
19. Docker IMAGES and PS Command
To list the images available in the internal
registry:
$ docker images
To show all the containers running:
$ docker ps
Using a go template to format
$ docker ps –-format '<go-template>'
To also show stopped containers:
$ docker ps -a
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
Registry
ubuntu
ps
image
my-container
20. Demo 3: "Show running containers"
list the conainers which are currently started
Use the --format option to only show part of the information
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0bc0fb64631b ubuntu "/bin/bash -c 'whilen" 6 minutes ago Up 6 minutes my-daemon
$ docker ps --format '{{.ID}} => {{.Names}}'
1d1ca35746d6 => my-daemon
21. Demo 4: "Show local images"
list all images available in the local registry
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu latest a5a467fddcb8 3 days ago 187.9 MB
22. Docker INSPECT Command
To show very detailed information, in JSON
format, about a container and its processes
$ docker inspect my-container
Inspection is available for both active and
stopped containers
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
Registry
ubuntu
xsfdsfd
inspect
23. Docker STOP and START Command
A container stops automatically as soon as the
process stops
A container can also be stopped from the
command line
$ docker stop my-container
A container can be re-executed via
$ docker start my-container
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
Registry
ubuntu
my-container stop
start
24. Docker RM and RMI Command
Removing a stopped container
$ docker rm my-container
• Use –f to force deletion, even active
containers!
To remove all the containers on the host
$ docker rm –f $(docker ps –aq)
To remove an image on the host
$ docker rmi ubuntu
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
Registry
ubuntu
my-container
rm
rmi
25. Demo 5: "Stopping the container and removing it"
$ docker stop my-daemon
my-daemon
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker ps -a --format '{{.Status}} : {{.Names}}'
Exited (137) 4 minutes ago : my-daemon
$ docker rm my-daemon
my-daemon
$ docker ps -a --format '{{.Status}} : {{.Names}}'
26. Docker PULL Command
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
Registry
ubuntu
pull
Images are automatically downloaded
by Docker when needed
It's also possible to manually download
images via
$ docker pull ubuntu
If the tag is missing in <image-name>,
latest will be downloaded
27. How to create my own image ?
Docker images can be created in 2 different ways:
1. By editing a Dockerfile in the host filesystem and executing docker build
2. By working on a container, then saving it by executing docker commit
command (not recommended)
• Mainly for specific or debugging purposes
28. Docker COMMIT Command
Creating a new image from the containers
changes:
$ docker commit my-container my-image
Generally, it is better to use Dockerfiles to
manage your images in a documented and
maintainable way.
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containerscommit
run
(pull)
Docker
Registry
my-container
my-image
ubuntu
29. Demo 6: "Commiting Hello World Shellscript"
$ docker run -ti --name my-container ubuntu bash
root@e5487f4dd8c6:/# apt-get install nano
Reading package list …
root@e5487f4dd8c6:/# nano helloworld.sh
#!/bin/bash
while true; echo Hello World; sleep 1; do
root@e5487f4dd8c6:/# chmod +x helloworld.sh
$ docker commit my-container gschmutz/helloworld
$ docker run -ti gschmutz/helloworld /bin/bash helloworld.sh
Hello World
Hello World
30. Docker BUILD Command
The steps are simple and standard
1. Create a directory having a file
named Dockerfile
2. Edit the Dockerfile according to the
related syntax
3. Add any supporting file/directory as
demanded by the image, added to
the image vai the ADD and COPY
instructions
$ docker build –t <image-
name> <directory with
Dockerfile>
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
file
build
Docker
Registry
my-image
ubuntu
31. Dockerfile
Dockerfile instructs on how to buid the image automatically
Dockerfile Syntax (INSTRUCTION arguments)
• FROM – defines base image
• RUN – execute arbitrary command
• ENV – sets environment
• EXPOSE – exposes a port
• ADD – add local file to the new image
• CMD – default command to execute
• MAINTAINER – author information
(https://docs.docker.com/reference/builder/)
32. Demo 7: "Building with Dockerfile" (I)
$ nano helloworld.sh
#!/bin/bash
while true; do echo Hello World!; sleep 1; done
$ nano Dockerfile
FROM ubuntu
MAINTAINER Guido Schmutz guido@example.com
COPY helloworld.sh /
RUN chmod +x helloworld.sh
CMD ["sh", "/helloworld.sh"]
33. Demo 7: "Building with Dockerfile" (II)
$ docker build -t gschmutz/helloworld:1.0 .
$ docker run –ti --name helloworld-1 gschmutz/helloworld:1.0
Hello World
Hello World
Hello World
34. Demo 7: "Building with Dockerfile" (III)
$ nano helloworld.sh
#!/bin/bash
while true; do echo Hello Oracle Open World; sleep 1; done
$ docker build -t gschmutz/helloworld:2.0 .
$ docker run –ti --name helloworld-2 gschmutz/helloworld:2.0
Hello Oracle Open World
Hello Oracle Open World
...
$ docker stop helloworld-1 helloworld-2
$ docker rm helloworld-1 helloworld-2
35. Docker PUSH Command
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
RegistrypushTo publish an image to the public
Docker registry (Docker Hub):
$ docker push gschmutz/my-image
• You have do register to Docker Hub
• Image name has to include username =>
<username>/<image-base-name>
Images can also be published to
private registries
• Image name has to include the host =>
<registry-host>:<registry-
port>/<image-base-name>
my-image
36. Docker Networking
All the containers inside a host share the same network
They can communicate and can open connections to each other's port
Every container has a hostname, by default based on it's id and shown by
hostname
• It can be set using the –h argument of docker run
The know the exact address of a container
• enter it (by starting a bash shell using docker exec) and consult ifconfig
• Use docker inspect
The container's hostname is invisible to other containers
38. Demo 8: "Inspect Network Setting of container" (II)
root@2ec74fcaab29:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state
UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo valid_lft forever
preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
45: eth0@if46: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP group default
link/ether 02:42:ac:11:00:15 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.21/16 scope global eth0 valid_lft forever
preferred_lft forever
inet6 fe80::42:acff:fe11:15/64 scope link valid_lft
forever preferred_lft foreverroot@2ec74fcaab29:/#
39. My Computer (Mac / Windows)
Docker Networking – Expose Ports
By default Docker containers to not bind to
host ports
The –P option of docker run binds the
container's exposed prots (declared by the
EXPOSE command in the image's Dockerfile)
to random available ports of the host
You can bind any port of the container (even
non-exposed ones) by using the –p parameter
on docker run
-p <host port>:<container port>
Docker Engine (in VM)
Docker
Registry
Images
Containers
db1521
49161
41. Linking Containers
When creating a container, you can link it to one or
more existing and active containers (called source
containers):
--link <source-container-name>:<alias>
Create a link enables two important behaviours
• <alias> reference the IP address of the source
container in network communications
(automatically updates /etc/hosts)
• The env variables created by Docker of the
source container are pushed into the new
container
My Computer (Mac / Windows)
Docker Engine (in VM)
Images
Containers
Docker
Registry
db app
43. Managing Data in Containers
There are two primary ways to manage data in Docker
1. Data Volumes - specially-designated directory within one or more
containers that bypasses the Union File System
-v <host-directory>:<container-directory>[:ro] - to create a
volume or bind a volume to a specific directory of the host
2. Data Volume containers – allows for sharing data between containers
--volumes-from <container> - to create exactly the same volumes as
the given container
46. Oracle and Docker
Oracle Linux 6 and 7 Images
https://hub.docker.com/_/oraclelinux/
Oracle MySQL image
WebLogic certified on Docker
https://github.com/oracle/docker
Docker on Oracle Cloud soon
Docker for SOA Suite not (yet)
available from Oracle
47. Docker & SOA Suite
soa-suite-base
soasuite-bam-
domain
soasuite-
domain
serivcebus-
domain
oracle-xe-11g
db-server soa-server
oracle-linux
oracle-sx
sx-serversoa-server
servicebus-
server
Credits to: Bruno Borges (Web Logic Docker), Jorge Esteban (SOA Suite Docker image)
soa-suite-
bp1bam
soa-suite-bp4
50. Idea: "Use SOA Suite with docker-compose" (II)
db-server:
image: sath89/oracle-xe-11g
ports:
- "48080:8080"
- "49161:1521"
soa:
image: gschmutz/storm-nimbus
ports:
- "47001:7001"
links:
- db-repo:db-server
$ docker-compose up -d
51. To do …..
• Oracle SOA Suite 12.2.1 does no longer work with Oracle DB XE 11g
• Parameterize the creation of the domain so that different combination can
be created easily
• Use docker-compose for starting multiple containers
• How to deploy SOA projects into a container / where to keep state
• Using GUI tools out of Docker container
• Make it available on GitHub
• Testing
53. Docker Machine
Machine makes it easy to create Docker hosts on your computer,
on cloud providers and inside your own data center
It creates servers, installs Docker on them and then configures the Docker
client to talk to them
Driver exits for:
• SoftLayer
• AWS
• DigitalOcean
• Azure
• Google Compute Engine
• Rackspace
• OpenStack
• VirtualBox
• VMWare Fusion / vSphere
54. Docker Swarm
Docker Swarm is native clustering for Docker
It turns a pool of Docker hosts into a single, virtual host
Has support for etcd, consul, and zookeeper
host disovery systems
Integrated planned with Bluemix, Mesos,
Kubernetes, AWS, Azure
55. Docker Compose
Compose is a tool for defining and running complex applications
with Docker
define a multi-container application in a single
file, then spin your application up in a single
command which does everything that
needs to be done to get it runing
56. Docker Registry
a stateless, highly scalable server side application that stores and
lets you distribute Docker images
open-source, under the permissive Apache license
use it to:
• tightly control where your images are being stored
• fully own your images distribution pipeline
• integrate image storage and distribution tightly into your in-house development
workflow
57. Kitematic
Kitematic is the fastest and
easiest way to start using
Docker on your laptop.
A completely automated
process installs and
configures the Docker
environment on your machine
in just minutes.
Build and run containers
through a simple, yet powerful
graphical user interface (GUI).
58. Docker Toolbox
The Docker Toolbox is an installer to quickly and easily install
and setup a Docker environment on your computer
Available for both Windows and Mac
the Toolbox installs
• Docker Client
• Docker Machine
• Docker Compose (Mac only)
• Docker Kitematic
• VirtualBox
60. Summary
Docker makes running isolated environments very easy
Much more lightweight than using Virtual Machine
Lot's of prebuild Docker images available on Docker Hub
Running SOA Suite inside a container is possible, although only use it for
demo/PoC/development environments
Getting more and more traction by Oracle
http://bit.ly/1MtShoR