SlideShare a Scribd company logo
Dockerizing mule soft esb
 Today in IT industry, everyone expects that the
environment in which we test the application
should be similar to the final deployment
environment as possible, if not identical.
 This can be achieved by automating the
deployment using Docker.
 In this blog, we would discuss about docker and
how it can be used to create a container and
deploy Mule instances. We would also notice that
it can be easy to repeat the same with no
additional effort.
 Docker allows us to package an application with
all of its dependencies into a standardised unit
for software development. Docker containers are
based on open standards allowing containers to
run on all major Linux distributions and
Microsoft operating systems with support for
every infrastructure. Docker containers wraps up
a piece of software in a complete file system that
contains everything it needs to run: code,
runtime, system tools, system libraries –
anything that can install on a server. This
guarantees that it would always run the same,
regardless of the environment.
 Each virtual machines includes the
application, the necessary binaries and
libraries and an entire guest operating system
– all of which may be tens of GB’s in size. If
we need 10 instances of MuleSoft ESB, then
we would have to replicate the complete set
up including the operating system for each
instance.
Dockerizing mule soft esb
 On the other hand, Docker containers only
includes the application and all of its
dependencies, but share the kernel with other
containers. They run as an isolated process in
user space on the host operating system.
They are also not tied to any specific
infrastructure so the Docker containers run
on any computer, on any infrastructure and in
any cloud.
 There are various good articles on the internet for
getting familiarized with Docker. So we continue
under the assumption that the reader already has
some knowledge about Docker.
 In this blog, we will show on how to create a MuleSoft
ESB instance with docker. We will be using a
community edition of the runtime which can be
replaced with an enterprise version by using
appropriate file and updating the Dockerfile in use.
 Firstly, we need to create a Dockerfile which is a
script and is used to build a Docker base image. It
takes the package containing Mule standalone,
extracts the files, removes unnecessary content and
configures the ports of the Docker base image. This
Docker file can be seen as below:
 FROM ubuntu:14.04MAINTAINER
govind.mulinti@whishworks.comRUN apt-get updateRUN apt-get
upgrade -yRUN apt-get install -y software-properties-common#
install javaRUN add-apt-repository ppa:webupd8team/java -
yRUN apt-get updateRUN echo oracle-java7-installer
shared/accepted-oracle-license-v1-1 select true |
/usr/bin/debconf-set-selectionsRUN apt-get install -y oracle-
java7-installer# MuleSoft EE installation:# This line can reference
either a web url (ADD), network share or local file (COPY)ADD
https://repository-
master.mulesoft.org/nexus/content/repositories/releases/org/
mule/distributions/mule-standalone/3.7.0/mule-standalone-
3.7.0.tar.gz /opt/WORKDIR /optRUN echo
"6814d3dffb5d8f308101ebb3f4e3224a mule-standalone-
3.7.0.tar.gz"| md5sum -cRUN tar -xzvf /opt/mule-standalone-
3.7.0.tar.gzRUN ln -s mule-standalone-3.7.0/mule-standalone-
3.7.0 muleRUN rm -f mule-standalone-3.7.0.tar.gz# Configure
external access:# Mule remote debuggerEXPOSE 5000# Mule JMX
port (must match Mule config file)EXPOSE 1098# Mule MMC
agent portEXPOSE 7777# Environment and execution:ENV
MULE_BASE /opt/muleWORKDIR /opt/mule-standalone-
3.7.0CMD /opt/mule/bin/mule
 A Docker image is essentially a multi-layer file
system. Once the container is running, these layers
are flattened to create one cohesive file system.
Almost each line of our Docker file creates a layer
that is stacked on top of the layer created by previous
line.
 But that is not the final stage, there are more
improvements that can to be made. For example, we
may like to consider creating intermediate images to
improve their re usability which can be referenced
internally with the Docker files. The images given
below shows the possible hierarchy of Docker images
which can be reused for any client, the OS can vary:
Dockerizing mule soft esb
 Here we are using a standalone community version due to restrictions of
enterprise version. If we plan to use the enterprise version then we need
to enhance the above docker script to use the required packages and
apply appropriate license.
 We can go a step further and integrate Docker builds into your
continuous integration build system, using Maven or Gradle. This way
Docker images are created as part of the build lifecycle, freeing
developers to concentrate on creating decent Mule applications.
 On a regular basis, we encounter promoting containers between various
environments, from development to test or from UAT to Production.
Each environment has specific configurations that need to be applied to
the application inside the container. Re-building the complete image,
each time we want to promote the application, defeats the purpose of
using containers. The solution is to build parametrised Docker images.
On the other hand, if the containers are changed often, for example
every code commit spins up a new Mule container, then the latter
approach would be preferable since clean-up file system is required
once the container is decommissioned.
 These images can be provided for testing teams to test is and those
would be the as is applications which would be available for production.
 Thinking of some scenarios, we can plan accordingly to have docker
images on production as well. By this approach we can provision the
services as micro services and that can be made available and updates
can be delivered with ignorable outages. Other benefits are;
 It should be easy to start a new instance when a need arises and discard
it if it is no longer required, should be able to adapt to changes rather
quickly and thus reduce errors caused by, for instance, peaks loads and
configuration changes.
 Scale out and increase the number of instances to which applications can
be deployed.
 Instead of running one instance of some kind of application server,
MuleSoft ESB in our case, on a computer, we may require multiple
instances to be partitioned, example: performance. High-priority
applications run on a separate instance whereas applications which are
less critical run on another instance.
 Enable quick replacement of instances in the deployment environment.
 Better control over the contents of the different environments.

More Related Content

PPT
Introduction Docker 1.12
PPTX
Docker In Brief
DOCX
Containerization Report
PDF
Docker how to
PPTX
Docker presentation
PPTX
Docker + Jelastic - planeetta.fi
PDF
Containers, Docker, and Microservices: the Terrific Trio
DOCX
Overview of Docker
Introduction Docker 1.12
Docker In Brief
Containerization Report
Docker how to
Docker presentation
Docker + Jelastic - planeetta.fi
Containers, Docker, and Microservices: the Terrific Trio
Overview of Docker

What's hot (20)

PDF
Introduction to Docker Containers - Docker Captain
PPTX
Containerization (docker)
PDF
Docker Container-Introduction and Features
PDF
Docker Basics
PDF
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
PPTX
Docker Global Hack Day #3
PPTX
PDF
Docker dev ops for cd meetup 12-14
PPTX
Docker introduction for the beginners
PPTX
Intro to docker
PDF
PDF
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
PPTX
Docker : Container Virtualization
PDF
Docker navjot kaur
PPTX
Discussing the difference between docker dontainers and virtual machines
PDF
Containerization using docker
PDF
Using Docker and Elastic Beanstalk in Production
PDF
Docker intro
PDF
Infinit: Modern Storage Platform for Container Environments
PDF
Docker 101: Introduction to Docker
Introduction to Docker Containers - Docker Captain
Containerization (docker)
Docker Container-Introduction and Features
Docker Basics
Dockerfile Tutorial with Example | Creating your First Dockerfile | Docker Tr...
Docker Global Hack Day #3
Docker dev ops for cd meetup 12-14
Docker introduction for the beginners
Intro to docker
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Docker : Container Virtualization
Docker navjot kaur
Discussing the difference between docker dontainers and virtual machines
Containerization using docker
Using Docker and Elastic Beanstalk in Production
Docker intro
Infinit: Modern Storage Platform for Container Environments
Docker 101: Introduction to Docker
Ad

Viewers also liked (20)

PPTX
PPTX
Integrate mule esb with microsoft office 365 share point
PPTX
How to use processor chain
PPTX
How to use parse template
PPTX
How to use attachment transformer
PPTX
Mule esb with amazon s3 Integration
PPTX
PPTX
PPTX
Apache spark
PPTX
Integration of mule esb with microsoft azure
PPTX
Cloud hub deployment
PPTX
How to use IMAP endpoint
PPTX
PPTX
How to use poll scope
PPTX
Bean as Datasource
PPTX
How to use jms outbound endpoint
PPTX
Securing api with_o_auth2
PPTX
How to read json message payload
PPTX
Specifying a default exception strategy
PPTX
How to use message enricher
Integrate mule esb with microsoft office 365 share point
How to use processor chain
How to use parse template
How to use attachment transformer
Mule esb with amazon s3 Integration
Apache spark
Integration of mule esb with microsoft azure
Cloud hub deployment
How to use IMAP endpoint
How to use poll scope
Bean as Datasource
How to use jms outbound endpoint
Securing api with_o_auth2
How to read json message payload
Specifying a default exception strategy
How to use message enricher
Ad

Similar to Dockerizing mule soft esb (20)

PPTX
Warsaw MuleSoft Meetup - Runtime Fabric
PDF
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
PDF
Best Practices for Developing & Deploying Java Applications with Docker
PPTX
Docker Basics
PDF
Dockers and kubernetes
PDF
Docker in practice
PPTX
Virtualization, Containers, Docker and scalable container management services
PDF
Docker basic
PPTX
How to deploy and run mule in docker
PPTX
8 good reasons to learn docker
PDF
Containerizing MuleSoft applications for hybrid deployment
PDF
Introduction to Docker - VIT Campus
PDF
Deploy microservices in containers with Docker and friends - KCDC2015
PDF
Introduction to Docker - Vellore Institute of Technology
PDF
Powering Microservices with Docker
ODP
Ruby and Docker on Rails
PPTX
Java developer intro to environment management with vagrant puppet and docker
PPTX
Containerization using docker and its applications
PPTX
Containerization using docker and its applications
PDF
Demystifying Docker
Warsaw MuleSoft Meetup - Runtime Fabric
MuleSoft Surat Virtual Meetup#35 - Setting up MuleSoft Runtime and Anypoint C...
Best Practices for Developing & Deploying Java Applications with Docker
Docker Basics
Dockers and kubernetes
Docker in practice
Virtualization, Containers, Docker and scalable container management services
Docker basic
How to deploy and run mule in docker
8 good reasons to learn docker
Containerizing MuleSoft applications for hybrid deployment
Introduction to Docker - VIT Campus
Deploy microservices in containers with Docker and friends - KCDC2015
Introduction to Docker - Vellore Institute of Technology
Powering Microservices with Docker
Ruby and Docker on Rails
Java developer intro to environment management with vagrant puppet and docker
Containerization using docker and its applications
Containerization using docker and its applications
Demystifying Docker

More from sivachandra mandalapu (20)

PPTX
Mock component in munit
PPTX
Jms selector
PPTX
PPTX
Object store
PPTX
How to use SFTP
PPTX
How to use secure property placeholder
PPTX
Defining global exception strategies
PPTX
Reference exception strategy
PPTX
Validate json schema
PPTX
PPTX
Property place holder
PPTX
Collection aggregator
PPTX
Deployment options for mule applications
PPTX
Setting up organization with api access
PPTX
API gateway setup
PPTX
PPTX
Synchronous communication using jms back channel
PPTX
PPTX
Mock component in munit
Jms selector
Object store
How to use SFTP
How to use secure property placeholder
Defining global exception strategies
Reference exception strategy
Validate json schema
Property place holder
Collection aggregator
Deployment options for mule applications
Setting up organization with api access
API gateway setup
Synchronous communication using jms back channel

Recently uploaded (20)

PDF
Complications of Minimal Access Surgery at WLH
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Cell Types and Its function , kingdom of life
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharma ospi slides which help in ospi learning
Complications of Minimal Access Surgery at WLH
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPH.pptx obstetrics and gynecology in nursing
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Basic Mud Logging Guide for educational purpose
2.FourierTransform-ShortQuestionswithAnswers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Insiders guide to clinical Medicine.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
human mycosis Human fungal infections are called human mycosis..pptx
TR - Agricultural Crops Production NC III.pdf
VCE English Exam - Section C Student Revision Booklet
GDM (1) (1).pptx small presentation for students
Cell Types and Its function , kingdom of life
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Final Presentation General Medicine 03-08-2024.pptx
Pharmacology of Heart Failure /Pharmacotherapy of CHF
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharma ospi slides which help in ospi learning

Dockerizing mule soft esb

  • 2.  Today in IT industry, everyone expects that the environment in which we test the application should be similar to the final deployment environment as possible, if not identical.  This can be achieved by automating the deployment using Docker.  In this blog, we would discuss about docker and how it can be used to create a container and deploy Mule instances. We would also notice that it can be easy to repeat the same with no additional effort.
  • 3.  Docker allows us to package an application with all of its dependencies into a standardised unit for software development. Docker containers are based on open standards allowing containers to run on all major Linux distributions and Microsoft operating systems with support for every infrastructure. Docker containers wraps up a piece of software in a complete file system that contains everything it needs to run: code, runtime, system tools, system libraries – anything that can install on a server. This guarantees that it would always run the same, regardless of the environment.
  • 4.  Each virtual machines includes the application, the necessary binaries and libraries and an entire guest operating system – all of which may be tens of GB’s in size. If we need 10 instances of MuleSoft ESB, then we would have to replicate the complete set up including the operating system for each instance.
  • 6.  On the other hand, Docker containers only includes the application and all of its dependencies, but share the kernel with other containers. They run as an isolated process in user space on the host operating system. They are also not tied to any specific infrastructure so the Docker containers run on any computer, on any infrastructure and in any cloud.
  • 7.  There are various good articles on the internet for getting familiarized with Docker. So we continue under the assumption that the reader already has some knowledge about Docker.  In this blog, we will show on how to create a MuleSoft ESB instance with docker. We will be using a community edition of the runtime which can be replaced with an enterprise version by using appropriate file and updating the Dockerfile in use.  Firstly, we need to create a Dockerfile which is a script and is used to build a Docker base image. It takes the package containing Mule standalone, extracts the files, removes unnecessary content and configures the ports of the Docker base image. This Docker file can be seen as below:
  • 8.  FROM ubuntu:14.04MAINTAINER govind.mulinti@whishworks.comRUN apt-get updateRUN apt-get upgrade -yRUN apt-get install -y software-properties-common# install javaRUN add-apt-repository ppa:webupd8team/java - yRUN apt-get updateRUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selectionsRUN apt-get install -y oracle- java7-installer# MuleSoft EE installation:# This line can reference either a web url (ADD), network share or local file (COPY)ADD https://repository- master.mulesoft.org/nexus/content/repositories/releases/org/ mule/distributions/mule-standalone/3.7.0/mule-standalone- 3.7.0.tar.gz /opt/WORKDIR /optRUN echo "6814d3dffb5d8f308101ebb3f4e3224a mule-standalone- 3.7.0.tar.gz"| md5sum -cRUN tar -xzvf /opt/mule-standalone- 3.7.0.tar.gzRUN ln -s mule-standalone-3.7.0/mule-standalone- 3.7.0 muleRUN rm -f mule-standalone-3.7.0.tar.gz# Configure external access:# Mule remote debuggerEXPOSE 5000# Mule JMX port (must match Mule config file)EXPOSE 1098# Mule MMC agent portEXPOSE 7777# Environment and execution:ENV MULE_BASE /opt/muleWORKDIR /opt/mule-standalone- 3.7.0CMD /opt/mule/bin/mule
  • 9.  A Docker image is essentially a multi-layer file system. Once the container is running, these layers are flattened to create one cohesive file system. Almost each line of our Docker file creates a layer that is stacked on top of the layer created by previous line.  But that is not the final stage, there are more improvements that can to be made. For example, we may like to consider creating intermediate images to improve their re usability which can be referenced internally with the Docker files. The images given below shows the possible hierarchy of Docker images which can be reused for any client, the OS can vary:
  • 11.  Here we are using a standalone community version due to restrictions of enterprise version. If we plan to use the enterprise version then we need to enhance the above docker script to use the required packages and apply appropriate license.  We can go a step further and integrate Docker builds into your continuous integration build system, using Maven or Gradle. This way Docker images are created as part of the build lifecycle, freeing developers to concentrate on creating decent Mule applications.  On a regular basis, we encounter promoting containers between various environments, from development to test or from UAT to Production. Each environment has specific configurations that need to be applied to the application inside the container. Re-building the complete image, each time we want to promote the application, defeats the purpose of using containers. The solution is to build parametrised Docker images. On the other hand, if the containers are changed often, for example every code commit spins up a new Mule container, then the latter approach would be preferable since clean-up file system is required once the container is decommissioned.
  • 12.  These images can be provided for testing teams to test is and those would be the as is applications which would be available for production.  Thinking of some scenarios, we can plan accordingly to have docker images on production as well. By this approach we can provision the services as micro services and that can be made available and updates can be delivered with ignorable outages. Other benefits are;  It should be easy to start a new instance when a need arises and discard it if it is no longer required, should be able to adapt to changes rather quickly and thus reduce errors caused by, for instance, peaks loads and configuration changes.  Scale out and increase the number of instances to which applications can be deployed.  Instead of running one instance of some kind of application server, MuleSoft ESB in our case, on a computer, we may require multiple instances to be partitioned, example: performance. High-priority applications run on a separate instance whereas applications which are less critical run on another instance.  Enable quick replacement of instances in the deployment environment.  Better control over the contents of the different environments.