Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile for an Alpine Linux based image. #408

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Dockerfile-gnm-test
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions Dockerfile-test-alpine
Original file line number Diff line number Diff line change
@@ -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