Extending a PACC

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

These pre-built Docker container base images – called Persistent Application Client Containers (PACCs) – are available in the maprtech/pacc public repository:
Table 1. PACC Base Images
PACC Repository and Tag Container OS Image
6.2.0 CentOS 8.x maprtech/pacc:6.2.0_7.0.0_centos8
CentOS 7.x N/A
Ubuntu 18.04 maprtech/pacc:6.2.0_7.0.0_ubuntu18
Ubuntu 16.04 N/A
6.1.0 CentOS 8.x N/A
CentOS 7.x maprtech/pacc:​6.1.0_6.0.0_centos7
Ubuntu 18.04 N/A
Ubuntu 16.04 maprtech/pacc:​6.1.0_6.0.0_ubuntu16
6.0.1 CentOS 8.x N/A
CentOS 7.x maprtech/pacc:​6.0.1_5.0.0_centos7
Ubuntu 18.04 N/A
Ubuntu 16.04 maprtech/pacc:​6.0.1_5.0.0_ubuntu16
6.0.0 CentOS 8.x N/A
CentOS 7.x maprtech/pacc:​6.0.0_4.0.0_centos7
Ubuntu 18.04 N/A
Ubuntu 16.04 maprtech/pacc:​6.0.0_4.0.0_ubuntu16

While you cannot modify a data-fabric Docker image directly, you can build a custom image that is based on a 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 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