Skip to content

Commit

Permalink
Update to python3 and elastalert to 1dc4f30f30d39a689f419ce19c7e2e4d6…
Browse files Browse the repository at this point in the history
…7a50be3 (latest on 2021-02-11)
  • Loading branch information
Karql committed Feb 11, 2021
1 parent 59bc361 commit 874df91
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM alpine:latest as py-ea
ARG ELASTALERT_VERSION=v0.2.0b2
FROM alpine:3.13 as py-ea
# Latest version on 2021-02-11
ARG ELASTALERT_VERSION=1dc4f30f30d39a689f419ce19c7e2e4d67a50be3
ENV ELASTALERT_VERSION=${ELASTALERT_VERSION}
# URL from which to download Elastalert.
ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip
Expand All @@ -9,8 +10,10 @@ ENV ELASTALERT_HOME /opt/elastalert

WORKDIR /opt

RUN apk add --update --no-cache ca-certificates openssl-dev openssl python2-dev python2 py2-pip py2-yaml libffi-dev gcc musl-dev wget && \
# Download and unpack Elastalert.
RUN apk add --update --no-cache cargo ca-certificates openssl-dev openssl python3-dev python3 py3-pip py3-yaml libffi-dev gcc musl-dev wget && \
pip3 install --upgrade pip && \
pip3 install cryptography && \
# Download and unpack Elastalert.
wget -O elastalert.zip "${ELASTALERT_URL}" && \
unzip elastalert.zip && \
rm elastalert.zip && \
Expand All @@ -19,19 +22,17 @@ RUN apk add --update --no-cache ca-certificates openssl-dev openssl python2-dev
WORKDIR "${ELASTALERT_HOME}"

# Install Elastalert.
# see: https://github.com/Yelp/elastalert/issues/1654
RUN sed -i 's/jira>=1.0.10/jira>=1.0.10,<1.0.15/g' setup.py && \
python setup.py install && \
pip install -r requirements.txt
RUN python3 setup.py install

FROM node:alpine
FROM node:14-alpine
LABEL maintainer="BitSensor <[email protected]>"
# Set timezone for this container
ENV TZ Etc/UTC

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

COPY --from=py-ea /usr/lib/python2.7/site-packages /usr/lib/python2.7/site-packages
COPY --from=py-ea /usr/lib/python3.8/site-packages /usr/lib/python3.8/site-packages
COPY --from=py-ea /opt/elastalert /opt/elastalert
COPY --from=py-ea /usr/bin/elastalert* /usr/bin/

Expand Down

0 comments on commit 874df91

Please sign in to comment.