Skip to content

Instantly share code, notes, and snippets.

@jmtd

jmtd/Dockerfile

Created Mar 16, 2017
Embed
What would you like to do?
# Copyright 2017 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ------------------------------------------------------------------------
#
# This is a Dockerfile for the openshift-spark:0.1 image.
FROM centos:latest
MAINTAINER Matthew Farrellee <matt@cs.wisc.edu>
# Environment variables
ENV JBOSS_IMAGE_NAME="openshift-spark" \
JBOSS_IMAGE_VERSION="0.1" \
JBOSS_IMAGE_RELEASE="1" \
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/spark/bin" \
SPARK_HOME="/opt/spark"
# Labels
LABEL name="$JBOSS_IMAGE_NAME" \
version="$JBOSS_IMAGE_VERSION" \
release="$JBOSS_IMAGE_RELEASE" \
architecture="x86_64" \
com.redhat.component="openshift-spark"
USER root
# Install required RPMs
RUN yum install -y epel-release tar java nss_wrapper numpy \
&& yum clean all
# Add all artifacts to the /tmp/artifacts
# directory
COPY \
spark-2.1.0-bin-hadoop2.7.tgz \
/tmp/artifacts/
# Add scripts used to configure the image
COPY scripts /tmp/scripts
# Custom scripts
USER root
RUN [ "bash", "-x", "/tmp/scripts/spark/install" ]
USER root
RUN rm -rf /tmp/scripts
USER root
RUN rm -rf /tmp/artifacts
# Specify the working directory
WORKDIR /tmp
USER 185
ENTRYPOINT ["/entrypoint"]
CMD ["/opt/spark/bin/launch.sh"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment