Skip to content

Commit ea34df2

Browse files
committed
Update to python3 and elastalert v0.2.4
1 parent 59bc361 commit ea34df2

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
FROM alpine:latest as py-ea
2-
ARG ELASTALERT_VERSION=v0.2.0b2
1+
FROM alpine:3.11 as py-ea
2+
ARG ELASTALERT_VERSION=v0.2.4
33
ENV ELASTALERT_VERSION=${ELASTALERT_VERSION}
44
# URL from which to download Elastalert.
55
ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip
@@ -9,7 +9,7 @@ ENV ELASTALERT_HOME /opt/elastalert
99

1010
WORKDIR /opt
1111

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 python3-dev python3 py3-pip py3-yaml libffi-dev gcc musl-dev wget && \
1313
# Download and unpack Elastalert.
1414
wget -O elastalert.zip "${ELASTALERT_URL}" && \
1515
unzip elastalert.zip && \
@@ -18,20 +18,21 @@ RUN apk add --update --no-cache ca-certificates openssl-dev openssl python2-dev
1818

1919
WORKDIR "${ELASTALERT_HOME}"
2020

21+
# stick to the last 2.* version (problem with Rust dependency: https://github.com/pyca/cryptography/issues/5771)
22+
RUN sed -i "s/install_requires=\[/install_requires=\[\n 'cryptography<3.0'/" setup.py
23+
2124
# Install Elastalert.
22-
# see: https://github.com/Yelp/elastalert/issues/1654
23-
RUN sed -i 's/jira>=1.0.10/jira>=1.0.10,<1.0.15/g' setup.py && \
24-
python setup.py install && \
25-
pip install -r requirements.txt
25+
RUN python3 setup.py install
2626

27-
FROM node:alpine
27+
FROM node:14-alpine
2828
LABEL maintainer="BitSensor <dev@bitsensor.io>"
2929
# Set timezone for this container
3030
ENV TZ Etc/UTC
3131

32-
RUN apk add --update --no-cache curl tzdata python2 make libmagic
32+
RUN apk add --update --no-cache curl tzdata python3 make libmagic && \
33+
ln -s /usr/bin/python3 /usr/bin/python
3334

34-
COPY --from=py-ea /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
35+
COPY --from=py-ea /usr/lib/python3.8/site-packages /usr/lib/python3.8/site-packages
3536
COPY --from=py-ea /opt/elastalert /opt/elastalert
3637
COPY --from=py-ea /usr/bin/elastalert* /usr/bin/
3738

0 commit comments

Comments
 (0)