Sample Docker Files

This article presents the following sample Dockerfiles:

These samples are for demonstration purposes only; the contents of a Dockerfile will vary greatly depending on the specific application and associated configuration requirements.

Sample 1: Spark

This example shows a Spark Dockerfile:

                        # Spark-1. docker image for RHEL/CentOS 6.x
                        FROM bluedata/centos7:latest
                        # Download and extract spark
                        RUN mkdir /usr/lib/spark; curl -s bin-hadoop2.6.tgz | tar xz -C /usr/lib/spark/
                        ## Install zeppelin
                        RUN mkdir /usr/lib/zeppelin; curl -s zeppelin/zeppelin-0.7.0-SNAPSHOT.tar.gz | tar xz -C /usr/lib/zeppelin
                        ADD /root/
                        RUN chmod -x /root/ && /root/

Sample 2: Datameer

This is a sample Dockerfile for the Datameer analytics platform.

                        # Datameer docker image
                        FROM bluedata/centos7:latest
                        RUN yum install -y
                        RUN yum install -y expect mysql-server mysql-connector-java 
                        COPY cloudera-manager.repo /etc/yum.repos.d/
                        RUN yum -y install hadoop-client 
                        RUN groupadd --system datameer
                        RUN useradd --system --create-home --gid datameer datameer
                        ADD /root/
                        RUN /root/ && rm /root/
                        #COPY /opt/datameer/
                        #RUN su - datameer && cd /opt/datameer && unzip -q && rm
                        ## Install Datameer
                        RUN wget -q -P /opt/datameer/ && unzip -q /opt/datameer/ -d /opt/datameer/ && rm -rf /opt/datameer/
                        RUN su - datameer && \
                            cd /opt/datameer && \
                            ln -s Datameer-6.1.14-cdh-5.9.0 current && \
                            cd current && \
                            mv logs/.donotdelete /var/log/datameer && \
                            rm -rf logs && \
                            ln -s /var/log/datameer logs
                        RUN chown -R datameer:datameer /opt/datameer/