-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
63 lines (55 loc) · 1.92 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
FROM openjdk:8-jre
RUN apt-get update && apt-get install -y libpostgresql-jdbc-java procps libsasl2-modules libsasl2-dev && rm -rf /var/lib/apt/lists/*
# Install Apache Hadoop
ENV HADOOP_VERSION=2.7.4
ENV HADOOP_HOME /opt/hadoop-$HADOOP_VERSION
ENV HADOOP_CONF_DIR=$HADOOP_HOME/conf
ENV PATH $PATH:$HADOOP_HOME/bin
RUN curl -L \
"https://archive.apache.org/dist/hadoop/common/hadoop-$HADOOP_VERSION/hadoop-$HADOOP_VERSION.tar.gz" \
| tar xvfz - -C /opt/ \
&& rm -rf $HADOOP_HOME/share/doc \
&& chown -R root:root $HADOOP_HOME \
&& mkdir -p $HADOOP_HOME/logs \
&& mkdir -p $HADOOP_CONF_DIR \
&& chmod 777 $HADOOP_CONF_DIR \
&& chmod 777 $HADOOP_HOME/logs
# Install Apache Hive
ENV HIVE_VERSION=2.3.7
ENV HIVE_HOME=/opt/apache-hive-$HIVE_VERSION-bin
ENV HIVE_CONF_DIR=$HIVE_HOME/conf
ENV PATH $PATH:$HIVE_HOME/bin
RUN curl -L \
"https://archive.apache.org/dist/hive/hive-$HIVE_VERSION/apache-hive-$HIVE_VERSION-bin.tar.gz" \
| tar xvfz - -C /opt/ \
&& chown -R root:root $HIVE_HOME \
&& mkdir -p $HIVE_HOME/hcatalog/var/log \
&& mkdir -p $HIVE_HOME/var/log \
&& mkdir -p /data/hive/ \
&& mkdir -p $HIVE_CONF_DIR \
&& chmod 777 $HIVE_HOME/hcatalog/var/log \
&& chmod 777 $HIVE_HOME/var/log
# Install Apache Spark
ENV SPARK_VERSION=2.4.4
ENV SPARK_HOME=/opt/spark-$SPARK_VERSION-bin-hadoop2.7
ENV SPARK_CONF_DIR=$SPARK_HOME/conf
ENV PATH $PATH:$SPARK_HOME/bin
RUN curl -sL \
"https://archive.apache.org/dist/spark/spark-$SPARK_VERSION/spark-$SPARK_VERSION-bin-hadoop2.7.tgz" \
| gunzip \
| tar -x -C /opt/ \
&& chown -R root:root $SPARK_HOME \
&& mkdir -p /data/spark/ \
&& mkdir -p $SPARK_HOME/logs \
&& mkdir -p $SPARK_CONF_DIR \
&& chmod 777 $SPARK_HOME/logs
# Configure
ADD files/hive-site.xml $HIVE_CONF_DIR/
ADD files/hive-site.xml $SPARK_HOME/conf
ADD files/init-hive.sh /
RUN chmod +x /init-hive.sh
ADD files/init-spark.sh /
RUN chmod +x /init-spark.sh
EXPOSE 9083
EXPOSE 10000
EXPOSE 10001