DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Have You Heard About Cloud Native Buildpacks?
  • Setting Up Local Kafka Container for Spring Boot Application
  • Docker Image Building Best Practices
  • An Introduction to BentoML: A Unified AI Application Framework

Trending

  • Beyond Linguistics: Real-Time Domain Event Mapping with WebSocket and Spring Boot
  • Streamlining Event Data in Event-Driven Ansible
  • Is the Model Context Protocol a Replacement for HTTP?
  • Segmentation Violation and How Rust Helps Overcome It
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Dockerizing Mule Application

Dockerizing Mule Application

This article contains the step by step information on how to Dockerize MuleSoft Application. Read on for the tutorial!

By 
Ankit Lawaniya user avatar
Ankit Lawaniya
·
Oct. 13, 20 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
10.2K Views

Join the DZone community and get the full member experience.

Join For Free

Dockerizing Mule Application

This article contains the step by step information on how to Dockerize MuleSoft Application. Here we will create a Docker image containing Mule Standalone server 3.9.4. As soon as our image is built, we will run the container to start the application.

As we can see in the Dockerfile, we have picked centos as our base image and installing the JDK 1.8, Maven, and Mule Standalone runtime on it. Once the environment setup is done then it's copying the application zip file into the apps folder of Mule_HOME.

Note: We have exposed port 8080 as our application port.

Step 1: Include the Dockerfile inside your application root directory.

Dockerfile
 




x


 
1
FROM centos
2

          
3
ENV MULE_HOME /opt/mule
4
ENV MULE_VERSION 3.9.4
5

          
6
# yum install JDK,Maven and MuleStandalone runtime
7
RUN yum update -y \
8
   && yum install -y java-1.8.0-openjdk-devel maven zip \
9
   && yum clean all -y \
10
   && cd /opt \
11
   && curl -k -o mule-3.9.4.zip http://s3.amazonaws.com/new-mule-artifacts/mule-ee-distribution-standalone-3.9.4-hf1.zip  \
12
   && unzip mule-3.9.4.zip \
13
   && mv mule-enterprise-standalone-$MULE_VERSION-hf1 mule
14

          
15
# Copy application files
16
COPY ./target/*.zip $MULE_HOME/apps/
17

          
18
# EXPOSED Application Port
19
EXPOSE 8080
20

          
21
ENTRYPOINT /opt/mule/bin/mule
22

          
23

          



Step 2: Build the Dockerfile to create an image, We are using "docker build" command for the same. Commands and Instructions given in the Dockerfile will be executed in order and for each instruction separate layer will be created since Docker follows the layered architecture.

Note: Run this command in your root application folder.

Shell
 




xxxxxxxxxx
1


 
1
docker build -t alawaniy/mule-dockerization .



Step 3 (Optional) : Once docker image is created we can push the image to Docker Hub Private Repository which can be shared across teams.

Note: You must have to login before pushing an image to Docker Hub.

Shell
 




xxxxxxxxxx
1


 
1
docker push alawaniy/mule-dockerization



Step 4: Run the image using the below command which will basically start the container but internally this will start the Mule Standalone server and your copied application will be deployed to the Server.

Shell
 




xxxxxxxxxx
1


 
1
docker run -it -p 8080:8080 alawaniy/mule-dockerization



Step 5: Test the Application by hitting the URL on the browser.

Note: My application is running on port 8080.

mule containers

Hope this helps!

Thanks.

Keep learning.

application Docker (software)

Opinions expressed by DZone contributors are their own.

Related

  • Have You Heard About Cloud Native Buildpacks?
  • Setting Up Local Kafka Container for Spring Boot Application
  • Docker Image Building Best Practices
  • An Introduction to BentoML: A Unified AI Application Framework

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!