Apama Packaging Kit for Docker®

Issue 2, 2015

Download pdf

Deploy apps faster and (almost) everywhere

Apama is the first of Software AG’s products to provide a kit to help you create Docker images for deploying applications faster and easier.

What is Docker?

Docker has been generating substantial buzz in the cloud technology industry over the past 12 months or more. Docker offers a much welcomed standardized approach for running applications in a containerized environment.

Docker provides an abstraction between the application and the environment in which the application is being run. An application running within a Docker environment is treated the same regardless of whether it is running on a laptop or in the cloud.

The Apama Packaging Kit for Docker provides configurations and guidance for making Apama easier to deploy in a standardized way with Docker. This eases the burden for customers and partners deploying products in mixed environments and building out their own public, private or hybrid cloud deployment using Platform as a Service (PaaS), Software as a Service (SaaS) or custom solutions.

What are Docker containers?

A typical local application is installed on top of the Operating System (OS) layer of the target server and has access to the server’s file system and to other applications installed on that machine. A Docker container differs by packaging together the application with any dependent files from the OS on which it runs. The container runs in a sandbox within the Docker environment on a particular machine.

Docker containers differ from Virtual Machines (VMs) in that they focus on virtualizing a process rather than the entire host. This lighter weight approach means that not only do containers launch more quickly than virtual machines but you also can have many times the number of application instances running on the same hardware as you can with virtual machines as shown in Figure 1.

Figure 1: Docker containers provide a lightweight approach to virtualization.

Quite simply, the differences are:

  • A typical application installation contains just the application files
  • A virtual machine contains the application files AND the entire OS AND the required hardware abstraction
  • A Docker container contains the application files AND any dependent files (e.g., necessary OS files)

Why is Docker exciting to the computing/DevOps world?

Docker’s standardized approach to the packaging and deployment of applications gives the DevOps community a practical solution to the problem of developing and deploying applications across a spectrum of local development hosts (even laptops), through on-premises servers and a huge array of commercial cloud environments.

Docker provides many of the advantages associated with containers:

  • Rapid deployment. Containers include the software base for them to run on a particular operating system, making them incredibly easy to deploy on a single or multiple servers.
  • Repeatable deployment. Containers mitigate the risk of moving from development/testing to production by packaging the entire application within its known tested working environment.
  • Runtime portability. Containers include both the application and its dependencies, ensuring that a container can execute on other machines running Docker on the same OS without compatibility issues (including portability across Linux® distributions).
  • Security. Containers provide a restricted file system and an explicit mechanism for their processes to communicate with other processes.
  • Application store. Containers can be published to local or remote repositories to facilitate distribution and deployment.
  • Fast launching (compared to virtual machines). Containers virtualize the process rather than the entire host; so compared to virtual machines, they launch significantly more quickly.

How are applications deployed in a Docker environment?

Docker was historically a Linux technology, with most vendors providing support in the popular distributions. For example, Red Hat® works with the Docker community to provide support in Fedora®, CentOS® and Red Hat® Enterprise Linux®. Recently Microsoft® also joined the Docker party when they announced in October 2014 that the next Windows® Server version will support Docker containers.

Docker containers are distributed as images. Docker makes it easy to manage different versions of these images. Applications running in a Docker environment are designed to be downloaded as a prepared Docker image and deployed as a container. This makes Docker containers more dynamic than traditional applications that are installed prior to running, or virtual machines that are typically too large to be downloaded every time they are executed.

By deploying images rather than installing files, Docker simplifies running your applications in different environments. You can deploy and run your Docker images on local servers or on servers running in a private or public cloud. Many of the public cloud hosting organizations support Docker, including Amazon Web Services, Google Compute Engine™ service and Microsoft AZURE™.

Docker images can be referenced locally or pulled dynamically at start up from a Docker repository. Docker repositories can either be private, giving organizations control over which images can be deployed, or public, delivering worldwide access to the images.

Docker provides support for more complex applications with the Compose tool that allows you to define a multi-container application and the way the individual containers interact. Using Compose you can easily start, stop and monitor multiple containers.

Docker Swarm® provides native clustering for a Docker environment, turning a collection of Docker hosts into a single, virtual host. It abstracts the location of where Docker containers are running and allows for the automatic distribution of containers.

Apama as a Docker image

The Apama Packaging Kit for Docker helps you create a deployable Apama image for Docker. The kit provides instructions and scripts that you can use on your existing installation of Apama.

Docker is currently only available on Linux, thus the kit requires that you have an existing Linux installation of Apama 5.3. The kit supports Docker 1.5.0 or later and Docker Compose 1.1.0.

The Apama Packaging Kit for Docker contains configurations that you can use to create Docker images for multi-container Apama applications with differing levels of complexity. You can see how to create Docker images for the Apama correlator, Apama dashboard server, Apama adapters and for your own Apama application.

Once you’ve created your Docker images, you can then deploy and run your application as Docker containers. For example, the following Docker command opens a port for external communication with the Apama correlator,  gives the instance a name and tells it which Docker image to use:

> docker run -d -p 15903:15903           
             --name apama_in_docker

The kit also illustrates how to run your Apama application in Docker, how to inspect and monitor Apama correlators and how to view the Apama log files.

The Apama Packaging Kit for Docker gives you advice on how to manage your Docker images by showing you how you can store and reference them from a Docker registry. For example:

> docker run -d -p 15903:15903           
             --name apama_in_docker

Summary and next steps

Docker is being embraced across the computing industry as a promising solution to many of the problems of managing the deployment and running of applications in cloud environments. It provides just about all of the benefits of using virtual machines but without requiring the rigid deployment model and heavyweight resource requirements that have plagued deploying VMs in the cloud.

The Apama Packaging Kit for Docker gives you simple and illustrated instructions on how to build Docker images for Apama and how to run Apama in a Docker environment.

Download the kit from the Tech Community, experiment with running Apama in Docker and let us know how you get on in the world of Docker containers!

Visit the Docker website for further Docker information.

References used in this article