A 5-Part Series on Deploying Oracle WebLogic using Docker.
Docker has quickly become one of the most popular tools for DevOps teams these days for streamlining and simplifying the deployment of applications across a variety of environments, platforms, and services using containers. Docker, in essence, encapsulates an application and its environment into a Docker image that can then be deployed just about anywhere that supports Docker containers. Build once deploy anywhere is the mantra. Docker reduces or even eliminates the need for development and operation teams from managing dependencies and environment settings across heterogeneous systems.
Docker has been around for some time and has been widely used for standing up LAMP and other popular development stacks. For instance, Docker can be used to build an image or set of images containing all the full stack of software necessary to build a runtime environment – such as installing NGINX, Tomcat or Glassfish, and MySQL or CouchDB for example. In this article series I will show you how easily you can deploy Oracle WebLogic using Docker.
Why Containers over Virtual Machines
You may be asking yourself why bother with using Docker containers for WebLogic? What’s the benefit and fundamental difference over using virtual machines?
So let’s first briefly go over the fundamental differences between virtual machines and containers, then I’ll summarize some of their benefits.
Server virtualization is the ability to emulate hardware on a bare metal server. Through hardware emulation you can partition a physical server into multiple virtual servers, allowing you to run multiple operating systems. This virtualization is managed by the hypervisor such as Xen for example. Server virtualization allows you to take advantage of the physical server’s computing power and storage capacity since most applications these days don’t require the full power of a bare metal server.
In the context of the diagram above, a virtual machine is a virtually isolated server containing its own OS, memory, and storage. Applications running on one virtual machine have their own process stack and typically don’t compete for system resources with applications running in another virtual machine on the same bare metal server. Some hypervisors allow you to oversubscribe resources, but that’s another topic for another day.
The biggest benefit here for IT organizations is the cost savings realized by reducing capital expenditures associated with bare metal servers (you can deploy more with less hardware) and faster provisioning times (deploying a virtual machine is measures faster than racking a physical server).
The fundamental difference between a container and a virtual machine is that a container sits directly on top of a bare metal server and its host operating system. Multiple containers running on that bare metal server all share the host’s OS kernel, binaries, and libraries. Containers are far lighter in weight than a virtual machine and can be started in seconds rather than minutes. They are much more efficient in terms of system resources as they are not impacted by the overhead of the hypervisor (which some can argue is negligible…). Some sources say you can run up to four to six types the number of server applications as you can with running that same application using a hypervisor.
Another HUGE benefit to containers is that they are portal encapsulations of your application and its environment. In terms of Docker you can create an image of your application and its environment that can be stored in a repository, shared, and ported across multiple environments and multiple hosting providers, greatly reducing the cost of developing, maintaining and managing server applications associated with heterogeneous environments.
I recommend checking out this blog by SolidFire for a more in-depth article on the differences between Virtual Machines and Containers.
Deploying Oracle WebLogic Using Docker
When it comes to Oracle WebLogic, Fusion Middleware, and many of Oracle’s products, there are numerous environment and software dependencies that must be satisfied. Take WebLogic for example, when installing, you need a certain version of the OS and Oracle JDK. You also need to know or have access to the installation directory and ports open and available for running WebLogic servers. When it comes to installing Weblogic and creating and running a Weblogic domain, there’s quite a bit of configuration involved. While much of this can be scripted using shell scripts and WLST, those scripts are very specific to the environment in which they run. Docker allows you to encapsulate the file system, runtime execution, and the networking.
Recently Oracle introduced official support for a variety Oracle products, including Oracle WebLogic Server 12c. I am very excited about this support because I can now build and configure Weblogic environments as Docker images that are portable across any environment. This simplifies development because every developer can build the same exact environment. This simplifies operational deployments because now there’s no difference between my development environment and production. Lastly for me, this simplifies root cause analysis – troubleshooting issues in production.
Oracle does not have a whole lot right now in the way of documentation around Docker, however, they are maintaining a Github repository containing sample projects for build single and multi-host environments.
In this article, I am going to show you how to install WebLogic and deploy a domain using Docker images provided by Oracle. I have broken out this article into 5 Parts:
- Preparing your environment
- Build an Oracle JRE Image
- Build a WebLogic Install Image
- Build a WebLogic Domain Image
- Create a WebLogic Domain
The architecture for building a Weblogic docker image and deploying it to a host looks like this:
So now with all that wordy introductory stuff out of the way, let’s move on to Step 1: Preparing your environment.