1 Getting Started

This section discusses how Oracle WebLogic Server 12.2.1 can be configured to run inside a Docker container. Docker is a Linux-based container technology that enables you to quickly create lightweight clustered and non-clustered WebLogic Server domain configurations on a single host OS or virtual machines, for either development or production environments.

Topics include:

About Docker

Docker is a platform that enables users to build, package, ship and run distributed applications. Docker users package up their applications, and any dependent libraries or files, into a Docker image.

Docker images are portable artifacts that can be distributed across Linux environments. Images that have been distributed can be used to instantiate containers where applications can run in isolation from other applications running in other containers on the same host operating system.

About WebLogic Server Images on Docker

Oracle, as part of the certification, has released Dockerfiles and supporting scripts on GitHub that are used to build images for WebLogic Server. The posted files are examples to help you get started. The WebLogic Server images are built as an extension of the Oracle Linux image 7.0, with JDK 7 or 8, and the Oracle WebLogic Server 12c (12.2.1) installations. For more information, see About the Dockerfiles and Scripts on GitHub.

To support building your Docker images, Oracle has certified using WebLogic Server 12.2.1 with various combinations of JDK versions, Oracle Linux and Red Hat Linux OS versions, Kernel versions, and Docker versions. For detailed certification information about supported WebLogic Server Docker images, see http://www.oracle.com/technetwork/middleware/ias/oracleas-supported-virtualization-089265.html.

Custom WebLogic Server Docker Images

You can also create your own WebLogic Server Docker images. To facilitate this process, Oracle has posted Dockerfiles and scripts on GitHub as examples that can help you to get started.

These are the prerequisites to build custom WebLogic Server Docker images:

  • Supported Oracle Linux or Red Hat Linux base image

  • Dockerfiles and scripts from GitHub

  • Oracle WebLogic Server 12c (12.2.1) generic installer or Developer installer

  • Corresponding supported JDK

About the Dockerfiles and Scripts on GitHub

To facilitate the building and running of WebLogic Server Docker images, Oracle has posted Dockerfiles and supporting scripts on GitHub. Download the entire directory structure to build your Oracle WebLogic Server images and start your containers. To access these files, go to https://github.com/oracle/docker/tree/master/OracleWebLogic/. Refer to the /wokshops directory for guided labs that provide step-by-step insructions.

The Dockerfiles and scripts enable you to extend your image and create clustered and non-clustered Oracle WebLogic Server domain configurations, including both development and production, running on multiple host operating system or on VMs. Please note that the Dockerfiles and scripts on Github are only intended to be samples for you to write your own Dockerfiles and build your WebLogic Server images.

Each server running in the resulting domain configurations runs in its Docker container and can communicate as required with other servers. Other configurations and approaches are possible, as described in Building WebLogic Server Images on Docker.

What Are the Dockerfiles on GitHub?

There are two types of Dockerfiles available on GitHub for WebLogic Server 12c (12.2.1), located under the /OracleWebLogic/dockerfiles/12.2.1 subdirectory:

  • Dockerfile.developer – builds a WebLogic Server "developer" install image.

  • Dockerfile.generic – builds a WebLogic Server "generic" domain image.

WebLogic Server Install Image Dockerfile

The Dockerfile to create an WebLogic Server install image performs the following functions:

  • Extends the Oracle JDK image

  • Installs WLS using the (WLS generic/Developer installers) in silent mode

Figure 1-1 illustrates the WebLogic Server Docker image.

Figure 1-1 Oracle WebLogic Server Docker Image

Description of Figure 1-1 follows
Description of "Figure 1-1 Oracle WebLogic Server Docker Image"

After creating your WebLogic Server install images, you can extend them to have a base WebLogic Server domain configured.

WebLogic Server Domain Image Dockerfile

The Dockerfile to create an WebLogic Server domain image performs the following functions:

  • Extends the WebLogic Server install image

  • Configures a WebLogic Server domain by calling WLST scripts. The domain has one Admin server, a JMS server, a Data Source, and enables JAX-RS 2.0

There are additional Dockerfiles to create an Application image. The Dockerfile performs the following functions:

  • Extends the domain image

  • Deploys an application to an Oracle WebLogic Server domain

Figure 1-2 illustrates a WebLogic Server domain and application image.

Figure 1-2 WebLogic Server Domain and Application Image

Description of Figure 1-2 follows
Description of "Figure 1-2 WebLogic Server Domain and Application Image"

You can create two types of containers using the Oracle WebLogic Server domain image:

What Are the Scripts on GitHub?

The supported scripts aid in the creation of a WebLogic Server 12c (12.2.1) Docker image and serve as examples to extend the image with the configuration of a WebLogic Server domain. The scripts are located under the subdirectories /OracleWebLogic/dockerfiles, /OracleWebLogic/samples, and /OracleWebLogic/samples/1221-domain/container-scripts.

The scripts in Table 1-1 help in the creation of a WebLogic Server install image and the starting of WebLogic servers inside of a Docker container.

Table 1-1 Supported WebLogic Server Scripts for Docker on GitHub

Script What it does

buildDockerImage.sh

Builds the image using the WebLogic Server installation Dockerfile instructions.

add-machine.py

WLST scripts to create a machine using the Managed Server container name.

add-server.py

WLST scripts to create a Managed Server.

create-wls-domain.py

WLST script configures a base domain with one Administration Server, JMS server, JSP, and data source.

createMachine.sh

Starts a Node Manager in the container and calls addMachine.sh to start Node Manager and add the Node Manager machine.

createServer.sh

Starts a Node Manager in the container and calls add-server.py to configure a Managed Server in the machine create by add-machine.py.

rm_containers.sh

Removes all running containers.

clean-up-docker.sh

Removes all ghost containers and all ghost images.

Clustering WebLogic Server on Docker Containers

WebLogic Server uses a machine concept, which is an operational system with an agent– the Node Manager. This machine resource allows an Administration Server to create and assign Managed Servers to a domain and/or cluster, expand a domain and/or cluster, and to deploy applications and resources to the Managed Servers.

By using machines in containers, you can configure a Dynamic Cluster and easily scale up your cluster by starting new Managed Server containers. Using the WebLogic Server Scripting Tool (WLST), your cluster can quickly be scaled in and out. For more information about the Node Manager, see Administering Node Manager for Oracle WebLogic Server, and for more information about using WLST, refer to Understanding the WebLogic Scripting Tool.

The Docker containers enable you to create clustered and non-clustered WebLogic Server domain configurations. Each server in the domain runs in its own Docker container and is capable of communicating as required with other servers.

Figure 1-5 illustrates clustering WebLogic Server on Docker Containers.

Figure 1-5 Clustering Oracle WebLogic Server on Docker Containers

Description of Figure 1-5 follows
Description of "Figure 1-5 Clustering Oracle WebLogic Server on Docker Containers"

The advantages of this topology are:

  • Good for traditional-like deployments

  • Easy to deploy containers from Oracle WebLogic Server domain images

  • Easy to scale a cluster up or down

  • Great for developers looking for a lightweight, repeatable, and shareable WebLogic environment

  • Good for continuous deployments

  • Easy to mange because there is no need to install or configure anything on a host except for Docker binaries

Non-Clustered WebLogic Server Domain in a Docker Container

A recommended topology that is in line with the "Docker way" for configuring containerized applications and services, consists of a container designed to run only an WebLogic Administration Server that contains all resources, shared libraries, and deployments. The Docker image includes all predefined domain resources, applications, and shared libraries deployed up-front and no Managed Servers or clusters are configured as shown in Figure 1-6.

Figure 1-6 Containerized WebLogic Server Applications on a Multiple Hosts

Description of Figure 1-6 follows
Description of "Figure 1-6 Containerized WebLogic Server Applications on a Multiple Hosts"

The advantages of this topology are:

  • Uses the Docker "recommended" way for configuring containerized applications and services.

  • Containers are easily repeatable.

  • Each container is an instance of the same WebLogic domain.