Mule ESB Enterprise in Docker on Openshift 3.x

Here is a useful Dockerfile for running Mule ESB EE in Docker. We are currently running this on Red Hat’s Openshift (kubernetes-based) container server and it runs quite well.

FROM openshift/base-centos7

ENV MULE_HOME /opt/mule
ENV MULE_VERSION 3.7.3

EXPOSE 8080

# Set labels used in OpenShift to describe the builder image
LABEL io.k8s.description="Platform for building Mule ESB EE Applications" \
      io.k8s.display-name="Mule ESB 3.7.3 Enterprise" \
      io.openshift.expose-services="8080:http" \
      io.openshift.tags="builder,mule,3.x,java"

# we need some tools from yum
# and install mule ee standalone
RUN yum update -y \
    && yum install -y java-1.8.0-openjdk-devel maven zip \
    && yum clean all -y \
    && cd /opt \
    && curl -o mule.tar.gz https://s3.amazonaws.com/MuleEE/fe49c9b102bcce22304d198936ea663f/mule-ee-distribution-standalone-3.7.3.tar.gz \
    && tar -xf mule.tar.gz \
    && mv mule-enterprise-standalone-$MULE_VERSION mule \
    && rm mule.tar.gz*

# Copy configuration files
COPY ./conf/* $MULE_HOME/conf/

# Installing license file
COPY ./license/license.lic $MULE_HOME/license.lic
RUN $MULE_HOME/bin/mule -installLicense $MULE_HOME/license.lic

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

# run as non-root user
RUN chown -R 1001:0 $MULE_HOME && \
    chmod -R g+wrx $MULE_HOME

# Openshift runtime user
USER 1001

# engage
CMD exec $MULE_HOME/bin/mule $MULE_OPTS_APPEND

2 Responses to “Mule ESB Enterprise in Docker on Openshift 3.x”

  1. John Lees

    Charlie:

    Using your Dockerfile, I was able to build an image that contains a Mule "Hello World" application (single flow that maps to /hello and displays "Hello World"). I was able to push this image to DockerHub (https://hub.docker.com/r/leesjohn/mule-esb-poc/) but am unable to deploy it (using "oc new-app leesjohn/mule-esb-poc") to a Starter account on OpenShift Online v3 (1 GiB CPU, 1 GiB Memory). The OpenShift Deployment log indicates that Mule attempted to start the application 5 times but each time it failed due to the errors listed below. The same Docker image starts correctly when I run the Docker image locally. Please let me know whether you experienced this error in running any of your Mule Docker images in OpenShift and if so how you resolved it. Do you think the errors occur due to memory restrictions with my Starter account or other factors? Thanks for your help,

    John

    Launching a JVM…
    OpenJDK 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0
    OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
    OpenJDK 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release
    JVM received a signal SIGKILL (9).
    JVM process is gone.

    Reply
  2. John Lees

    Charlie:

    OpenShift was failing to start a Docker image built from this Dockerfile, displaying the error "JVM exited in response to signal SIGKILL (9)" when I attempted to run it using an OpenShift Starter account. However, the image works OK in my local environment.

    The issue went away went I changed the Dockerfile to use version 3.6.1 of the Mule Standalone Runtime instead of version 3.7.3. The difference between the two versions is that several properties were added to the file <<Mule Standalone folder>>/conf/wrapper.conf beginning in version 3.7.0. Commenting out one of the properties (wrapper.java.additional.9=-XX:+HeapDumpOnOutOfMemoryError) resolved the issue, allowing me to run an image with a OpenShift Starter account using version 3.7.3 or 3.8.1.

    John

    Reply

Leave a Reply

  • (will not be published)

Markdown is enabled for comments.