Creating a Dockerfile for MuleESB
Let’s create our Dockerfile
1
|
|
We will build our Mule ESB Standalone Server image based on java version 8 from Docker Hub Java repository. More info about FROM
1
|
|
We will use two environment variables MULE_HOME
and MULE_VERSION
, which will be used in our Dockerfile
. More info about ENV
1 2 3 |
|
Now, we need to download the latest version of Mule Standalone Server from Mulesoft’s repository in /opt
folder, unzip it and rename the folder to mule
. Additionally, zip file will be deleted. Since, we are running over Linux (Ubuntu) we can use some useful commands. More info about RUN
1 2 3 4 5 6 |
|
Then, we will locate at $MULE_HOME
folder. More info about WORKDIR
1
|
|
Now, we will expose some folder inside of mule in order to have access from outside of docker container. More info about VOLUME
1 2 3 4 |
|
Finally, we need to start the server. More info about ENTRYPOINT
1
|
|
Our final Dockerfile
looks like this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Building the MuleESB Docker image
In order to have the image available in your local machine we just need to execute the command below:
1
|
|
Running the MuleESB Docker image
1
|
|
You can find the final example on my github repository docker-mule