From 0bee1eacf284c9c7b9ec734bb9bf6603279ca51e Mon Sep 17 00:00:00 2001 From: Thorsten Klein Date: Fri, 27 Sep 2019 15:14:11 +0200 Subject: [PATCH] update Dockerfile to latest version of elastalert --- Dockerfile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 056ff5af..433fa1ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,37 +1,41 @@ -FROM alpine:latest as py-ea -ARG ELASTALERT_VERSION=v0.2.0b2 +FROM alpine:3.9 as py-ea +ARG ELASTALERT_VERSION=v0.2.1 ENV ELASTALERT_VERSION=${ELASTALERT_VERSION} # URL from which to download Elastalert. ARG ELASTALERT_URL=https://github.com/Yelp/elastalert/archive/$ELASTALERT_VERSION.zip ENV ELASTALERT_URL=${ELASTALERT_URL} # Elastalert home directory full path. -ENV ELASTALERT_HOME /opt/elastalert +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 && \ +RUN apk add --update --no-cache ca-certificates openssl-dev openssl python3-dev=3.6.8-r2 python3=3.6.8-r2 libffi-dev gcc musl-dev wget && \ # Download and unpack Elastalert. wget -O elastalert.zip "${ELASTALERT_URL}" && \ unzip elastalert.zip && \ rm elastalert.zip && \ - mv e* "${ELASTALERT_HOME}" + mv e* "${ELASTALERT_HOME}" && \ + python3 -m ensurepip && \ + pip3 install --upgrade pip && \ + pip3 install pyyaml 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 + python3 setup.py install && \ + pip3 install -r requirements.txt FROM node:alpine LABEL maintainer="BitSensor " # 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 python2 python3=3.6.8-r2 make libmagic && \ + ln -sf 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.6/site-packages /usr/lib/python3.6/site-packages COPY --from=py-ea /opt/elastalert /opt/elastalert COPY --from=py-ea /usr/bin/elastalert* /usr/bin/