forked from bbonnin/docker-hadoop-3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
86 lines (66 loc) · 2.74 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
75
76
77
78
79
80
81
82
83
84
85
86
FROM ubuntu:17.10
ENV HADOOP_HOME /opt/hadoop
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
RUN apt-get update
RUN apt-get install -y --reinstall build-essential
RUN apt-get install -y ssh
RUN apt-get install -y rsync
RUN apt-get install -y vim
RUN apt-get install -y net-tools
RUN apt-get install -y openjdk-8-jdk
RUN apt-get install -y python2.7-dev
RUN apt-get install -y libxml2-dev
RUN apt-get install -y libkrb5-dev
RUN apt-get install -y libffi-dev
RUN apt-get install -y libssl-dev
RUN apt-get install -y libldap2-dev
RUN apt-get install -y python-lxml
RUN apt-get install -y libxslt1-dev
RUN apt-get install -y libgmp3-dev
RUN apt-get install -y libsasl2-dev
RUN apt-get install -y libsqlite3-dev
RUN apt-get install -y libmysqlclient-dev
RUN \
if [ ! -e /usr/bin/python ]; then ln -s /usr/bin/python2.7 /usr/bin/python; fi
# If you have already downloaded the tgz, add this line OR comment it AND ...
ADD hadoop-3.1.0.tar.gz /
# ... uncomment the 2 first lines
RUN \
# wget http://apache.crihan.fr/dist/hadoop/common/hadoop-3.1.0/hadoop-3.1.0.tar.gz && \
# tar -xzf hadoop-3.1.0.tar.gz && \
mv hadoop-3.1.0 $HADOOP_HOME && \
for user in hadoop hdfs yarn mapred hue; do \
useradd -U -M -d /opt/hadoop/ --shell /bin/bash ${user}; \
done && \
for user in root hdfs yarn mapred hue; do \
usermod -G hadoop ${user}; \
done && \
echo "export JAVA_HOME=$JAVA_HOME" >> $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
echo "export HDFS_DATANODE_USER=root" >> $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
# echo "export HDFS_DATANODE_SECURE_USER=hdfs" >> $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
echo "export HDFS_NAMENODE_USER=root" >> $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
echo "export HDFS_SECONDARYNAMENODE_USER=root" >> $HADOOP_HOME/etc/hadoop/hadoop-env.sh && \
echo "export YARN_RESOURCEMANAGER_USER=root" >> $HADOOP_HOME/etc/hadoop/yarn-env.sh && \
echo "export YARN_NODEMANAGER_USER=root" >> $HADOOP_HOME/etc/hadoop/yarn-env.sh && \
echo "PATH=$PATH:$HADOOP_HOME/bin" >> ~/.bashrc
####################################################################################
# HUE
# https://www.dropbox.com/s/auwpqygqgdvu1wj/hue-4.1.0.tgz
ADD hue-4.1.0.tgz /
##
RUN mv -f /hue-4.1.0 /opt/hue
WORKDIR /opt/hue
RUN make apps
RUN chown -R hue:hue /opt/hue
WORKDIR /
####################################################################################
RUN \
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa && \
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys && \
chmod 0600 ~/.ssh/authorized_keys
ADD *xml $HADOOP_HOME/etc/hadoop/
ADD ssh_config /root/.ssh/config
ADD hue.ini /opt/hue/desktop/conf
ADD start-all.sh start-all.sh
EXPOSE 8088 9870 9864 19888 8042 8888
CMD bash start-all.sh