Installing Docker and running Integration Server as a container

This Document Consists of Detailed Steps to Install Docker in Linux and Running a Integration Server as a Container.

By Manoj Jannu, Senior Software Engineer, Software AG

Table of Contents

  1. Overview
  2. Prerequisites
  3. Install Docker CE
  4. Building Docker image for Integration Server
  5. Running an Integration Server as a container

Overview 

This article describes detail steps to Install Docker Community edition and create a Docker image for existing Integration Server installation. The script and instructions contained in this article are for webMethods Integration Server version 10.1 and above.

Prerequisites

  • Minimum Knowledge of Docker and Dockerfile.
  • Integration server installation of version 10.1
  • A new linux machine. Preferably CentOS 7

Install Docker CE

We can install Docker CE in different ways, depending on your needs but here we will install using the repository:

CENTOS:

Before you install Docker CE for the first time on a new centos machine, you need to set up the Docker repository and then continue with the installation.

1. Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver:

 $ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

2. Use the following command to set up the docker repository for installation. This will setup latest docker repository:

$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

3. Install the latest version of Docker CE:

$ sudo yum install docker-ce -y

4. Verify the installation by running following command. This will return Docker help guide:

$ docker

5. Let’s start the docker service:

$ sudo service docker start

6. Default user from which you have logged in is lacking permissions to access the Unix socket to communicate with the engine. So we can either use sudo for docker command or just add current user to docker group:

$ sudo usermod -a -G docker $USER

Note: Logout and login to CentOS machine to see the changes from step 6

RHEL:

1. Set up the Docker CE repository. Following steps to install Docker on RHEL is for experimental purpose and never do this in the production. Install Docker Enterprise Edition (Docker EE) if you would like to use Docker in production:
$ sudo tee /etc/yum.repos.d/docker.repo << EOF 

Copy paste following into console:

[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF

Download and Install Prerequisites

$ sudo wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo rpm -ivh epel-release-latest-7.noarch.rpm

2. Install Docker CE:

$ sudo yum install –y docker-engine

3. Let’s start the Docker service:

$ sudo service docker start

4. Default user from which you have logged in is lacking permissions to access the Unix socket to communicate with the engine. So we can either use sudo for docker command or just add current user to Docker group:

$ sudo usermod -a -G docker $USER

Note: Logout and login to RHEL machine to see the changes from step 4

Building Docker image for Integration Server

Having prerequisites in place i.e 10.1 webMethods Integration server installed in a Linux machine where docker is already installed we will proceed with the steps to create a IS Docker image.

Generate a Dockerfile 

Go to the directory <InstalledDirectory>/IntegrationServer/docker/  from command prompt here you will find Integration Server image creation script file is_container.sh. To know available options provided, execute is_container.sh in the console.

Let’s create a Dockerfile that will be used to create the Integration Server image by executing the is_container.sh script. We can pass createDockerFile/ createLeanDockerfile / createPackageDockerfile as a command line argument depending on your requirement.

Here we will use createDockerfile as command line argument to create a Dockerfile for a base Integration Server instance, including "Default" and "Wm" packages.

Leaving all default values, we will run the following command to create a Docker file:

 $./is_container.sh createDockerfile -Dfile.name=Dockerfile

A Dockerfile is created in <InstalledDirectory>/ with the name ‘Dockerfile’

Add IS startup command to Dockerfile 

We have created a Dockerfile to build IS image. Now Add following IS startup command to it which will automatically start IS when we run a IS container:

CMD <TargetInstallatationDirectory>/profiles/IS_default/bin/startup.sh

Since Docker container exits immediately when its main process finishes in this case it will exit when startup.sh script ends so we will append sleep infinity command which will keep Docker container in running state.

Add following command at the end of Dockerfile:

CMD <TargetInstallatationDirectory>/profiles/IS_default/bin/startup.sh;sleep infinity;

<TargetInstallatationDirectory>: Product installation directory inside a container.

Replace <TargetInstallatationDirectory> with the appropriate target installation directory from your Dockerfile. You can find <TargetInstallatationDirectory> as shown in the below screenshot.

Our Dockerfile will look like: 

Build a Docker Image from Dockerfile

Build an image from a Dockerfile by executing the following command from the location where you have a Docker file:

$docker build -t isimage:v10.1 ./
OR
$docker build -t isimage:v10.1 –f <dockerfilename>

To verify, execute following command to list images. Here you will see isimage with tag v10.1 created:

$docker images

Running an Integration Server as a container

We will be using run command to run our IS container. The Docker run command has a wide range of options that can be passed, which pretty much includes all capabilities of Docker.

Let's run Integration server container run as a daemon process which means docker container would run in the background completely detached from your current shell:

$docker run -d --name IS_Default -p 4444:5555 -p 9999 isimage:v10.1

Verify running IS container

Execute docker ps command to list running containers:

$docker ps

Output shows our IS container is running and now we can verify it in the UI.

Verify Integration Server UI from http://<HostMachine>/<mappedport> i.e http://localhost:4444

<img alt="" src="//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/techcommunity/original/2X/e/ea467c3b0d667a6ebcd610846e05d3622e85142a.png"

image.png

1 Like