Skip to content

Commit 01b17f3

Browse files
committed
Update build process for python 3 and Elastalert 0.2.1
1 parent 59bc361 commit 01b17f3

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

Dockerfile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM alpine:latest as py-ea
2-
ARG ELASTALERT_VERSION=v0.2.0b2
2+
ARG ELASTALERT_VERSION=v0.2.1
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 && \
@@ -19,19 +19,19 @@ RUN apk add --update --no-cache ca-certificates openssl-dev openssl python2-dev
1919
WORKDIR "${ELASTALERT_HOME}"
2020

2121
# 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
22+
# see: https://github.com/Yelp/elastalert/issues/2437
23+
RUN sed -i 's/jira>=1.0.10,<1.0.15/jira>=2.0.0/g' setup.py && \
24+
python3 setup.py install
2625

2726
FROM node:alpine
2827
LABEL maintainer="BitSensor <dev@bitsensor.io>"
2928
# Set timezone for this container
3029
ENV TZ Etc/UTC
3130

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

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

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
v ?= v0.2.0b2
1+
v ?= v0.2.1
22

33
all: build
44

0 commit comments

Comments
 (0)