-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (45 loc) · 1.47 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
FROM python:2
MAINTAINER OiSiS (https://github.com/oisis)
ENV ELASTALERT_VERSION v0.0.95
# Never prompts the user for choices on installation/configuration of packages
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
# Work around initramfs-tools running on kernel 'upgrade': <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=594189>
ENV INITRD No
# Switch to bash
RUN rm /bin/sh \
&& ln -s /bin/bash /bin/sh
RUN apt-get update \
&& apt-get -yqq install \
wget \
unzip \
python-pip \
virtualenv \
python-dev \
&& pip install envtpl
RUN wget "https://github.com/Yelp/elastalert/archive/v0.0.95.zip" -O /root/elastalert-v0.0.95.zip \
&& unzip /root/elastalert-v0.0.95.zip -d /root \
&& rm -f /root/elastalert-v0.0.95.zip \
&& mv /root/elastalert-0.0.95 /root/elastalert \
&& rm -rf /root/elastalert/docs \
/root/elastalert/example_rules \
/root/elastalert/config.yaml.example \
&& mkdir /root/elastalert/rules \
&& cd /root/elastalert/ \
&& virtualenv virtualenvelastalert \
&& source virtualenvelastalert/bin/activate \
&& python setup.py install
COPY configs/config.yaml.tpl /root/elastalert/
COPY scripts/run_elastalert.sh /run_elastalert.sh
COPY rules/ /root/elastalert/rules
RUN chmod +x /run_elastalert.sh
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
# Volumes to mount:
VOLUME ['/root/elastalert/rules/']
ENTRYPOINT ["/run_elastalert.sh"]