-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
81 lines (65 loc) · 2.68 KB
/
Dockerfile
File metadata and controls
81 lines (65 loc) · 2.68 KB
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
FROM centos:6
MAINTAINER Hurence
USER root
# install dev tools
RUN yum clean all; \
rpm --rebuilddb; \
yum install -y curl which tar sudo openssh-server openssh-clients rsync wget git svn telnet nano vim;
RUN yum groupinstall -y 'Development Tools';
# Java 8
RUN wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jre-8u131-linux-x64.rpm" && yum -y localinstall jre-8u131-linux-x64.rpm && rm jre-8u131-linux-x64.rpm
ENV JAVA_HOME /usr
# Install Nginx.
RUN rm -rf /var/cache/yum/x86_64/6/extras/packages && rm -rf /tmp && yum -y install epel-release && yum -y install nginx
COPY default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 443
# Build and install kafkacat util
RUN cd /usr/local; \
git clone https://github.com/edenhill/librdkafka.git; \
cd librdkafka/; \
./configure; \
make; \
make install;
RUN cd /usr/local; \
git clone https://github.com/edenhill/kafkacat.git; \
cd kafkacat/; \
./configure; \
make; \
make install;
ENV LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/local/lib
# Install python
RUN sudo yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel python-devel libpcap-devel
RUN cd /opt; \
wget --no-check-certificate https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz; \
tar xf Python-2.7.6.tar.xz; \
cd Python-2.7.6; \
./configure --prefix=/usr/local; \
make && make altinstall;
RUN curl https://bootstrap.pypa.io/get-pip.py | python2.7 -
ENV PATH /usr/local/bin:$PATH
# Install pycapa (python for pcap)
RUN mkdir /tmp; \
cd /tmp; \
git clone https://github.com/apache/incubator-metron.git
RUN cd /tmp/incubator-metron/metron-sensors/pycapa; \
pip install six; \
/usr/local/bin/pip install -r requirements.txt; \
python2.7 setup.py install; \
rm -rf /tmp/incubator-metron
# Kafka
RUN curl -s http://apache.crihan.fr/dist/kafka/0.10.0.0/kafka_2.11-0.10.0.0.tgz | tar --owner=root --group=root -xz -C /usr/local/
RUN cd /usr/local && ln -s kafka_2.11-0.10.0.0 kafka
ENV KAFKA_HOME /usr/local/kafka
EXPOSE 2181 9092
COPY server.properties $KAFKA_HOME/config/server.properties
# Spark
RUN curl -s http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz | tar --owner=root --group=root -xz -C /usr/local/
RUN cd /usr/local && ln -s spark-2.1.0-bin-hadoop2.7 spark
ENV SPARK_HOME /usr/local/spark
ENV PATH $PATH:$SPARK_HOME/bin
EXPOSE 4040
# update boot script
COPY bootstrap.sh /etc/bootstrap.sh
RUN chown root.root /etc/bootstrap.sh
RUN chmod 700 /etc/bootstrap.sh
ENTRYPOINT ["/etc/bootstrap.sh"]