Mulesoft is an ESB which encourages a SOA, but is flexable and can fit almost any integration need. To learn more, go to Mulesoft's website.
This copy of the runtime is known as "Community Edition", which means it is an opensource, free to use copy of mulesoft under the CPAL license. You can also contribute to the opensource project here.
This image contains an entrypoint, so you do not need to use this as a base image if you can add your compiled mule api to the volume.
Running this image is as easy as:
docker run -d --name mule4ce dtsimpson1/mule4ce
There are 4 volumes defined to make it easier to deploy apps and domains, view logs, install patches, and modify the config.
/opt/mule/apps
/opt/mule/domains
/opt/mule/logs
/opt/mule/lib/patches
/opt/mule/conf
If you bind mount the conf
folder, you must recreate the contents of the folder due to a limitation in docker.
If you bind mount the domains
folder, you should create an empty folder in the volume with the name default
. This is how mule creates the default domain and ensures APIs can run without declaring a domain project.
This image only exposes ports 80 and 443. Thus, if you are deploying multiple artifacts to the same container, you have two options:
- Use this image as a base image and add your additional ports in your own image.
- Take advantage of Mule domains and share an HTTP listener on the single port.
To deploy an exported API, simply drop the .jar into the /opt/mule/apps
directory in the container. One of the easiest ways to do this during development is to mount the volume to your host machine with the volume flag -v ~/mule/apps:/opt/mule/apps
. The mule runtime will automatically detect the artifact, unzip it, and start it up. You will see a message print in the logs stating Started app ...
.
Combining everything above into a single command (which can be modified as you wish):
docker run -d --name mule4ce -v ~/mule/logs:/opt/mule/logs -v ~/mule/apps:/opt/mule/apps -v ~/mule/domains:/opt/mule/domains -v ~/mule/patches:/opt/mule/lib/patches -v ~/mule/conf:/opt/mule/conf -p 8080:80 dtsimpson1/mule4ce
- Added the mule
./conf
dir to the volumes that can be mounted.
Mulesoft provides lots of great documentation on this, but a link I would recommend if you are a quick learner is here.
I welcome contributions if you believe this image is missing anything. You may fork the repository and create a Pull Request which I will review.