From 757fc33f67cde1404e6a46f0c7e129a47356ecc1 Mon Sep 17 00:00:00 2001 From: Gerardo Nevarez Date: Thu, 25 Feb 2016 12:48:35 -0800 Subject: [PATCH 1/3] Add Dockerfile for Alpine Linux based image (builds from source). --- Dockerfile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..490cd5c44 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +FROM alpine:latest + +RUN apk update && apk upgrade && \ + apk add tzdata python py-yaml curl wget bash python-dev git && \ + apk add build-base && \ + # Install setuptools + curl https://bootstrap.pypa.io/ez_setup.py -o - | python && \ + # install supervisord + easy_install supervisor && \ + # Checkout Yelp/elastalert + mkdir -p /usr/src && \ + cd /usr/src/ && \ + git clone https://github.com/Yelp/elastalert.git && \ + # Build elastalert + cd /usr/src/elastalert/ && \ + python setup.py install && \ + # Setup config directory + sed -i 's/example_rules/rules/g' config.yaml.example && \ + mkdir -p /opt/elastalert/rules && \ + mv config.yaml.example /opt/elastalert/config.yaml && \ + mv supervisord.conf.example /opt/elastalert/supervisord.conf && \ + sed -i -e 's/nodaemon=false/nodaemon=true/' /opt/elastalert/supervisord.conf && \ + ln -s $(find /usr/lib/python* -name elastalert.py) /opt/elastalert/elastalert.py && \ + # Include example_rules folder + mkdir -p /opt/elastalert/example_rules && \ + cp example_rules/* /opt/elastalert/example_rules/ && \ + # Remove files to save space + cd / && \ + rm -rf /usr/src/elastalert && \ + apk del python-dev git && \ + rm -rf /var/cache/apk/* && \ + cp /usr/share/zoneinfo/America/New_York /etc/localtime && \ + echo "America/New_York" > /etc/timezone && \ + echo "EST5EDT" > /etc/TZ && \ + apk del build-base + +WORKDIR /opt/elastalert + +ONBUILD COPY config.yaml /opt/elastalert/config.yaml +ONBUILD COPY rules/* /opt/elastalert/rules/ +VOLUME ["/opt/elastalert"] +VOLUME ["/var/log"] + +CMD ["supervisord","-c","/opt/elastalert/supervisord.conf"] + +COPY Dockerfile /Dockerfile From 6bb1ac8d3801db69c8bc5148bd74d6c31b65084e Mon Sep 17 00:00:00 2001 From: Gerardo Nevarez Moorillon Date: Fri, 14 Jul 2017 18:04:02 -0400 Subject: [PATCH 2/3] rename previous Dockerizing test --- Dockerfile => Dockerfile-gnm-test | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Dockerfile => Dockerfile-gnm-test (100%) diff --git a/Dockerfile b/Dockerfile-gnm-test similarity index 100% rename from Dockerfile rename to Dockerfile-gnm-test From 42106aa946494d89d45bc34bb7688322449ea5f4 Mon Sep 17 00:00:00 2001 From: Gerardo Nevarez Moorillon Date: Fri, 14 Jul 2017 18:43:28 -0400 Subject: [PATCH 3/3] Add Dockerfile-test-alpine --- Dockerfile-test-alpine | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile-test-alpine diff --git a/Dockerfile-test-alpine b/Dockerfile-test-alpine new file mode 100644 index 000000000..72c98f5c1 --- /dev/null +++ b/Dockerfile-test-alpine @@ -0,0 +1,13 @@ +FROM alpine:latest + +RUN apk update && apk upgrade -f && \ + apk add -f build-base python python-dev py-setuptools openssl-dev git py-tox py-pip libffi-dev && \ + mkdir -p /home/elastalert + +WORKDIR /home/elastalert + +ADD . ./ +RUN pip install -r requirements-dev.txt && \ + python setup.py install + +