-
Notifications
You must be signed in to change notification settings - Fork 37
/
Dockerfile
executable file
·86 lines (70 loc) · 3.29 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
#Kibana
FROM ubuntu
RUN echo 'deb http://archive.ubuntu.com/ubuntu precise main universe' > /etc/apt/sources.list && \
echo 'deb http://archive.ubuntu.com/ubuntu precise-updates universe' >> /etc/apt/sources.list && \
apt-get update
#Prevent daemon start during install
RUN echo '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d && \
chmod +x /usr/sbin/policy-rc.d
RUN DEBIAN_FRONTEND=noninteractive apt-get clean
RUN DEBIAN_FRONTEND=noninteractive apt-get autoclean
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade
#Supervisord
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor && \
mkdir -p /var/log/supervisor
CMD ["/usr/bin/supervisord", "-n"]
#SSHD
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y openssh-server && \
mkdir /var/run/sshd && chmod 700 /var/run/sshd && \
echo 'root:root' |chpasswd
#Utilities
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y vim less nano maven ntp net-tools inetutils-ping curl git telnet
#Install Oracle Java 7
RUN echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main' > /etc/apt/sources.list.d/java.list && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 && \
apt-get update && \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
DEBIAN_FRONTEND=noninteractive apt-get install -y oracle-java7-installer
#ElasticSearch
RUN wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.tar.gz && \
tar xf elasticsearch-*.tar.gz && \
rm elasticsearch-*.tar.gz && \
mv elasticsearch-* elasticsearch && \
elasticsearch/bin/plugin -install mobz/elasticsearch-head
#Kibana
RUN wget https://download.elasticsearch.org/kibana/kibana/kibana-3.0.0.tar.gz && \
tar xf kibana-*.tar.gz && \
rm kibana-*.tar.gz && \
mv kibana-* kibana
#NGINX
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-software-properties && \
add-apt-repository ppa:nginx/stable && \
echo 'deb http://packages.dotdeb.org squeeze all' >> /etc/apt/sources.list && \
curl http://www.dotdeb.org/dotdeb.gpg | apt-key add - && \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y nginx
#Logstash
RUN wget https://download.elasticsearch.org/logstash/logstash/logstash-1.4.0.tar.gz && \
tar xf logstash-*.tar.gz && \
rm logstash-*.tar.gz && \
mv logstash-* logstash
#LogGenerator
RUN git clone https://github.com/vspiewak/log-generator.git && \
cd log-generator && \
/usr/share/maven/bin/mvn clean package
#Geo
RUN wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && \
gunzip GeoLiteCity.dat.gz && \
mv GeoLiteCity.dat /log-generator/GeoLiteCity.dat
#Configuration
ADD ./ /docker-elk
RUN cd /docker-elk && \
mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.saved && \
cp nginx.conf /etc/nginx/nginx.conf && \
cp supervisord-kibana.conf /etc/supervisor/conf.d && \
cp logback /logstash/patterns/logback && \
cp logstash-forwarder.crt /logstash/logstash-forwarder.crt && \
cp logstash-forwarder.key /logstash/logstash-forwarder.key
#80=ngnx, 9200=elasticsearch, 49021=logstash, 49022=lumberjack, 9999=udp
EXPOSE 22 80 9200 49021 49022 9999/udp