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 http://archive.apache.org/dist/spark/spark-2.0.1/spark-2.0.1- bin-hadoop2.6.tgz | tar xz -C /usr/lib/spark/
                        
                        ## Install zeppelin
                        RUN mkdir /usr/lib/zeppelin; curl -s https://s3.amazonaws.com/bluedata-catalog/thirdparty/ zeppelin/zeppelin-0.7.0-SNAPSHOT.tar.gz | tar xz -C /usr/lib/zeppelin
                        
                        ADD configure_spark_services.sh /root/configure_spark_services.sh
                        RUN chmod -x /root/configure_spark_services.sh && /root/configure_spark_services.sh

Sample 2: Datameer

This is a sample Dockerfile for the Datameer analytics platform.

                        # Datameer docker image
                        FROM bluedata/centos7:latest
                        
                        RUN yum install -y http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
                        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 datameer-user.sh /root/
                        RUN /root/datameer-user.sh && rm /root/datameer-user.sh
                        
                        #COPY Datameer-6.1.14-cdh-5.9.0.zip /opt/datameer/
                        #RUN su - datameer && cd /opt/datameer && unzip -q  Datameer-6.1.14-cdh-5.9.0.zip && rm Datameer-6.1.14-cdh-5.9.0.zip
                        
                        ## Install Datameer
                        RUN wget -q https://s3.amazonaws.com/bluedata-catalog/thirdparty/datameer/Datameer-6.1.14-cdh-5.9.0.zip -P /opt/datameer/ && unzip -q /opt/datameer/Datameer-6.1.14-cdh-5.9.0.zip -d /opt/datameer/ && rm -rf /opt/datameer/Datameer-6.1.14-cdh-5.9.0.zip
                        
                        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/