Extending a MapR PACC

You can use a MapR PACC to create a new Docker image.

These pre-built Docker container base images -- called MapR Persistent Application Client Containers (PACCs) -- are available:
Container OS PACC Repository and Tag (5.2.0) PACC Repository and Tag (5.2.1) PACC Repository and Tag (5.2.2)
CentOS 6.8 maprtech/pacc:5.2.0_2.0_centos6 maprtech/pacc:5.2.1_3.0_centos6 maprtech/pacc:5.2.2_3.0.1_centos6
CentOS 7.3 maprtech/pacc:5.2.0_2.0_centos7 maprtech/pacc:5.2.1_3.0_centos7 maprtech/pacc:5.2.2_3.0.1_centos7 or maprtech/pacc:latest or maprtech/pacc
Ubuntu 14.04 maprtech/pacc:5.2.0_2.0_ubuntu14 maprtech/pacc:5.2.1_3.0_ubuntu14 maprtech/pacc:5.2.2_3.0.1_ubuntu14
Ubuntu 16.04 N/A N/A maprtech/pacc:5.2.2_3.0.1_ubuntu16

While you cannot modify a MapR-provided Docker image directly, you can build a custom image that is based on a MapR Persistent Application Client Container (PACC). The following example shows a custom Dockerfile that is used to create a new Docker image. In this example, an application has a JAR file that takes a producer as a parameter and runs a custom function.

The example has two parts. In Part 1, the custom Dockerfile uses the Docker FROM command to download a MapR PACC to a container on the user platform. A directory is created, and a JAR file is copied into the container so that it can be run in Java. The CMD command starts the application inside the container. In Part 2, the custom Dockerfile is built using the docker build command.

Part 1. Creating a Custom Dockerfile

FROM maprtech/pacc:5.2.0_2.0_centos6
# Copy jar to container
RUN mkdir -p /usr/share/mapr-apps/
COPY mapr-streams-examples-1.0-SNAPSHOT-jar-with-dependencies.jar /usr/share/mapr-apps/mapr-app-001.jar
# Run producer application in container
CMD [ "java", "-cp", "$MAPR_CLASSPATH:/usr/share/mapr-apps/mapr-app-001.jar", "com.mapr.examples.Run", "producer" ]

Part 2. Building a Custom Docker Image From the Dockerfile

# docker build -t <new docker image> .
Note: Above needs to be run in the same directory as Dockerfile
Make sure the image is created and no issue building Docker image.
# docker images –a