This repository has been archived by the owner on Feb 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
75 lines (65 loc) · 3 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
FROM centos:7.3.1611
LABEL maintainer="USGS EROS LCMAP http://eros.usgs.gov http://github.com/usgs-eros/lcmap-spark" \
description="CentOS based Spark image for LCMAP" \
org.apache.mesos.version=1.4.0 \
org.apache.spark.version=2.2.0 \
net.java.openjdk.version=1.8.0 \
org.python.version=3.6 \
org.centos=7.3.1611
EXPOSE 8081 4040 8888
ENV HOME=/home/lcmap \
USER=lcmap \
SPARK_HOME=/opt/spark \
SPARK_NO_DAEMONIZE=true \
PYSPARK_PYTHON=python3 \
MESOS_NATIVE_JAVA_LIBRARY=/usr/lib/libmesos.so \
TINI_SUBREAPER=true \
LIBPROCESS_SSL_ENABLED=1 \
LIBPROCESS_SSL_SUPPORT_DOWNGRADE=1 \
LIBPROCESS_SSL_VERIFY_CERT=0 \
LIBPROCESS_SSL_ENABLE_SSL_V3=0 \
LIBPROCESS_SSL_ENABLE_TLS_V1_0=0 \
LIBPROCESS_SSL_ENABLE_TLS_V1_1=0 \
LIBPROCESS_SSL_ENABLE_TLS_V1_2=1 \
LIBPROCESS_SSL_CIPHERS=ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:AES256-SHA256:AES128-SHA256 \
LIBPROCESS_SSL_CERT_FILE=/certs/mesos.crt \
LIBPROCESS_SSL_KEY_FILE=/certs/mesos.key \
LIBPROCESS_SSL_CA_FILE=/certs/trustedroot.crt \
LIBPROCESS_SSL_CA_DIR=/certs \
LIBPROCESS_SSL_ECDH_CURVE=auto
ENV PATH=$SPARK_HOME/bin:${PATH} \
PYTHONPATH=$PYTHONPATH:$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.7-src.zip:$SPARK_HOME/python/lib/pyspark.zip
# Add a user to run as inside the container to prevent accidental foo while mounting volumes.
# Use "docker run -u `id -u`" at runtime to assign proper UIDs for file permissions.
# Mesos username must match this username (and be assigned permissions by Mesos admin.)
RUN yum install -y sudo && \
adduser -ms /bin/bash $USER && \
echo "$USER ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/$USER && \
echo "alias sudo='sudo env PATH=$PATH'" > /etc/profile.d/sudo.sh && \
chmod 0440 /etc/sudoers.d/$USER
COPY pom.xml /root
RUN mkdir -p $HOME/notebook
RUN yum update -y
RUN rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-3.noarch.rpm
RUN yum install -y java-1.8.0-openjdk-devel.x86_64 \
mesos\
bzip2 \
gcc \
maven
RUN yum -y downgrade mesos-1.4.0
RUN curl http://mirrors.ocf.berkeley.edu/apache/spark/spark-2.3.1/spark-2.3.1-bin-hadoop2.7.tgz -o /opt/spark.tgz
RUN cd /opt && tar -zxf spark.tgz && rm -f spark.tgz && ln -s spark-* spark && cd -
RUN curl https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /root/mc.sh
RUN bash /root/mc.sh -u -b -p /usr/local
RUN conda install python=3.6 pip jupyter numpy cython py4j=0.10.7 pandas>=0.19.2 --yes
RUN pip install lcmap-merlin==2.3.1
RUN pip install xgboost
RUN mvn -f /root/pom.xml dependency:copy-dependencies -DoutputDirectory=$SPARK_HOME/jars
RUN yum erase -y maven gcc bzip2
RUN rm -rf $SPARK_HOME/jars/netty-all-4.0.33.Final.jar $SPARK_HOME/jars/netty-3.9.9.Final.jar
RUN yum clean all
RUN rm -rf /var/cache/yum /root/.cache /root/.m2 /root/pom.xml /root/mc.sh
RUN conda clean --all -y
USER $USER
WORKDIR $HOME
RUN sudo chown -R $USER:$USER .