Image to create a mule runtime container for docker
Docker/Microservice Mule application images can extend this image
This image has the jolokia jvm agent enabled by default and jmx metrics are available at 0.0.0.0:8778/jolokia/read
Alternatively, a jmxtrans-agent can be enabled by passing the below env vars. The agent will query for JMX metrics as specified in mule/conf/jmxtrans-agent.xml.erb
and export them to a statsd server (with the below host/port). Furthermore, the jmx-trans-agent.xml.erb
can also be mounted as a volume to override the image default configuration.
MULE_MANAGEMENT_ENABLE_JMXTRANS_AGENT=true
MULE_MANAGEMENT_JMXTRANS_STATSD_HOST=<STATSD HOST>
MULE_MANAGEMENT_JMXTRANS_STATSD_PORT=<STATSD PORT>
docker build --build-arg GIT_COMMIT=$(git rev-parse HEAD) --tag npiper/mule39-ee-base .
docker run -Pit \
-v /var/log/mule:/opt/mule/logs \
-e "MULE_TUNING_GC=G1" \
-e "MULE_MANAGEMENT_ENABLE_JMX=true" \
-e "MULE_MEMORY_MIN_HEAP=10" \
-e "MULE_MEMORY_MAX_HEAP=300" \
-e "MULE_LOGGING_VERBOSE_GB=true" \
-e "MULE_LOGGING_DEFAULT_LEVEL='INFO'" \
-e "MULE_LOGGING_MULE_LEVEL='INFO'" \
-e "MULE_LOGGING_ESB_JAVA_LEVEL='INFO'" \
-e "MULE_LOGGING_XML_FILTERS='INFO'" \
-e "MULE_LOGGING_ESB_UTILS='INFO'" \
npiper/mule39-ee-base:latest
docker run -Pit \
-e MULE_MANAGEMENT_ENABLE_JMXTRANS_AGENT=true \
-e MULE_MANAGEMENT_JMXTRANS_STATSD_HOST=10.11.12.85
-e MULE_MANAGEMENT_JMXTRANS_STATSD_PORT=8125
mule38ee-base :latest
docker run -Pit \
-e MULE_MANAGEMENT_ENABLE_JMXTRANS_AGENT=true \
-e MULE_MANAGEMENT_JMXTRANS_STATSD_HOST=10.11.12.85
-e MULE_MANAGEMENT_JMXTRANS_STATSD_PORT=8125
-v /tmp/mule/conf:/mnt/mule/conf
mule38ee-base :latest
With the above configuration, the startup script will look the container's /mnt/mule/conf
directory for a jmxtrans-agent.xml.erb
template file and will override the image's default template located at /opt/mule/conf/jmxtrans-agent.xml.erb
.
The below will install a Mule EE digested license file namely muleLicenseKey.lic
which will get mounted as volume on /mnt/mule/conf/
.
In Openshift and Kubernetes the license can be stored as a Secret
and mounted as a volume in the container. This allows for the license to be updated without building a new image and be shared across multiple containers.
docker run -Pit
-v /tmp/mule/conf:/mnt/mule/conf
npiper/mule39-ee-base:latest
docker push npiper/mule39-ee-base:latest
Variable | Description |
---|---|
MULE_TUNING_GC | |
MULE_MEMORY_MIN_HEAP | |
MULE_MEMORY_MAX_HEAP | |
MULE_LOGGING_VERBOSE_GC | |
MULE_LOGGING_VERBOSE_EXCEPTIONS | |
MULE_LOGGING_DEFAULT_LEVEL | Currently ignored |
MULE_LOGGING_MULE_LEVEL | Currently ignored |
MULE_LOGGING_ESB_JAVA_LEVEL | Currently ignored |
MULE_LOGGING_XML_FILTERS | Currently ignored |
MULE_LOGGING_ESB_UTILS | Currently ignored |
MULE_WRAPPER_CUSTOM_ARG_1 | There are MULE_WRAPPER_CUSTOM_ARG_1 to MULE_WRAPPER_CUSTOM_ARG_10 available for defining extra custom jvm arguments, if more needed, add MULE_WRAPPER_CUSTOM_ARG_ to conf/wrapper.conf.erb |
MULE_MANAGEMENT_ENABLE_JMXTRANS_AGENT | Setting this to true will enable jmxtrans-agent (and disable Jolokia) |
MULE_MANAGEMENT_JMXTRANS_STATSD_HOST | The Statsd host jmxtrans-agent will write to. |
MULE_MANAGEMENT_JMXTRANS_STATSD_PORT | The Statsd port jmxtrans-agent will write to. |
To enable integration with API Manager, the file /opt/mule/conf/apigw/api-gateway.properties
needs to be present inside the running container (probably mounted as a Docker/Kubernetes volume).
The file must contain Anypoint Organisation credentials defined in the following properties:
gw_client_id=???
gw_client_secret=???
Yelp dumb-init is installed and use as an init system for PID1
Editing tools - vim, less
Ruby - erb templating system for shell outputs
Network tools - curl, wget, unzip, netstat-nat net-tools iputils-ping telnet
Add Maven support
Download / Upgrade to Jolokia 1.7.2 - https://jolokia.org/download.html to /lib/user
Download / Upgrade to JMX Trans 1.2.11 - https://github.com/jmxtrans/jmxtrans-agent to /lib/user
Add a DockerCompose with services like JMX Clients, StatsD Collator
Add Prometheus performance monitoring
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.jmxtrans.agent</groupId>
<artifactId>jmxtrans-agent</artifactId>
<version>1.2.11</version>
</dependency>