Skip to content

Commit 01180c0

Browse files
authored
Updated Dockerfile to support python3
1 parent 59bc361 commit 01180c0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Dockerfile

Lines changed: 9 additions & 9 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 python:3.6-alpine as py-ea
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 libffi-dev gcc musl-dev wget && \
1313
# Download and unpack Elastalert.
1414
wget -O elastalert.zip "${ELASTALERT_URL}" && \
1515
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 && \
2525
pip install -r requirements.txt
2626

2727
FROM node:alpine
28-
LABEL maintainer="BitSensor <[email protected]>"
28+
LABEL maintainer="Securely <[email protected]>"
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=3.6.8-r2 make libmagic
3333

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
3535
COPY --from=py-ea /opt/elastalert /opt/elastalert
36-
COPY --from=py-ea /usr/bin/elastalert* /usr/bin/
3736

3837
WORKDIR /opt/elastalert-server
3938
COPY . /opt/elastalert-server
@@ -47,8 +46,9 @@ COPY elastalert_modules/ /opt/elastalert/elastalert_modules
4746

4847
# Add default rules directory
4948
# 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
5252

5353
USER node
5454

0 commit comments

Comments
 (0)