Building Your own Container

The MapR Container Storage Interface (CSI) Storage Plugin includes a template in the build directory to build your own container. The following template shows the MapR Container Storage Interface (CSI) Storage Plugin build with CentOS 7 image:

# Copyright (c) 2009 & onwards. MapR Tech, Inc., All rights reserved

# CentOS Package Build
FROM centos:centos7
LABEL mapr.os=centos7
ENV container docker
# Setup repos and dl prereqs + Mapr Core
COPY mapr.repo /etc/yum.repos.d/
RUN rpm --import; \
    rpm --import; \
    rpm --import; \
    rpm --import; \
    yum -y update && yum -y clean all; \
    yum -y install epel-release; \
    sed -i 's/^mirror/#mirror/g' /etc/yum.repos.d/epel.repo; \
    sed -i 's/^#base/base/g' /etc/yum.repos.d/epel.repo; \
    yum install -y java-1.8.0-openjdk-devel mapr-posix-client-basic mapr-posix-client-platinum && \
    yum clean all && rm -rf /var/cache/yum; \
    cp /usr/lib/jvm/jre/lib/amd64/server/ /opt/mapr/lib/

# Add Tini
ADD${TINI_VERSION}/tini /tini
RUN chmod +x /tini

# Copy utils, driver and set entrypoint
COPY --from=docker.artifactory/maprtech/csi-kdfdriver:1.0.0_003 \
     /go/src/plugin/bin/* /opt/mapr/bin/
RUN chmod +x /opt/mapr/bin/csi-kdfplugin; \
    chmod +x /opt/mapr/bin/start-fuse;
WORKDIR /opt/mapr
ENTRYPOINT ["/tini", "--", "bin/csi-kdfplugin"]

The template contains the information on the image for setting up the repository, deploying the (Basic and Platinum) POSIX client, information on the entrypoint, and tini for POSIX process management. You can customize the template and build it by running the utility in the build directory or by running the docker build command with the custom image tag.