1
- FROM alpine:latest as py-ea
2
- ARG ELASTALERT_VERSION=v0.2.0b2
1
+ FROM python:3.6-alpine as py-ea
2
+ ARG ELASTALERT_VERSION=v0.2.1
3
3
ENV ELASTALERT_VERSION=${ELASTALERT_VERSION}
4
4
# URL from which to download Elastalert.
5
5
ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip
@@ -9,7 +9,7 @@ ENV ELASTALERT_HOME /opt/elastalert
9
9
10
10
WORKDIR /opt
11
11
12
- RUN apk add --update --no-cache ca-certificates openssl-dev openssl python2-dev python2 py2-pip py2-yaml libffi-dev gcc musl-dev wget && \
12
+ RUN apk add --update --no-cache ca-certificates openssl-dev openssl libffi-dev gcc musl-dev wget && \
13
13
# Download and unpack Elastalert.
14
14
wget -O elastalert.zip "${ELASTALERT_URL}" && \
15
15
unzip elastalert.zip && \
@@ -25,15 +25,14 @@ RUN sed -i 's/jira>=1.0.10/jira>=1.0.10,<1.0.15/g' setup.py && \
25
25
pip install -r requirements.txt
26
26
27
27
FROM node:alpine
28
- LABEL maintainer=
"BitSensor <[email protected] >"
28
+ LABEL maintainer=
"Securely <[email protected] >"
29
29
# Set timezone for this container
30
30
ENV TZ Etc/UTC
31
31
32
- RUN apk add --update --no-cache curl tzdata python2 make libmagic
32
+ RUN apk add --update --no-cache curl tzdata python3=3.6.8-r2 make libmagic
33
33
34
- COPY --from=py-ea /usr/lib/python2.7 /site-packages /usr/lib/python2.7 /site-packages
34
+ COPY --from=py-ea /usr/local/ lib/python3.6 /site-packages /usr/lib/python3.6 /site-packages
35
35
COPY --from=py-ea /opt/elastalert /opt/elastalert
36
- COPY --from=py-ea /usr/bin/elastalert* /usr/bin/
37
36
38
37
WORKDIR /opt/elastalert-server
39
38
COPY . /opt/elastalert-server
@@ -47,8 +46,9 @@ COPY elastalert_modules/ /opt/elastalert/elastalert_modules
47
46
48
47
# Add default rules directory
49
48
# Set permission as unpriviledged user (1000:1000), compatible with Kubernetes
50
- RUN mkdir -p /opt/elastalert/rules/ /opt/elastalert/server_data/tests/ \
51
- && chown -R node:node /opt
49
+ RUN ln -s /usr/bin/python3 /usr/bin/python && \
50
+ mkdir -p /opt/elastalert/rules/ /opt/elastalert/server_data/tests/ && \
51
+ chown -R node:node /opt
52
52
53
53
USER node
54
54
0 commit comments