2020-07-06 23:30:11 +00:00
|
|
|
FROM alpine:3.12
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2020-01-31 14:21:55 +00:00
|
|
|
# VARS
|
2020-10-27 19:43:32 +00:00
|
|
|
ENV ES_VER=7.9.3 \
|
2020-01-31 14:21:55 +00:00
|
|
|
JAVA_HOME=/usr/lib/jvm/java-11-openjdk
|
2017-10-13 18:58:14 +00:00
|
|
|
# Include dist
|
|
|
|
ADD dist/ /root/dist/
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Setup env and apt
|
2019-03-15 22:23:30 +00:00
|
|
|
RUN sed -i 's/dl-cdn/dl-2/g' /etc/apk/repositories && \
|
|
|
|
apk -U --no-cache add \
|
|
|
|
aria2 \
|
2018-05-16 14:57:52 +00:00
|
|
|
bash \
|
|
|
|
curl \
|
2019-03-15 22:23:30 +00:00
|
|
|
nss \
|
2020-01-31 14:21:55 +00:00
|
|
|
openjdk11-jre && \
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Get and install packages
|
|
|
|
cd /root/dist/ && \
|
|
|
|
mkdir -p /usr/share/elasticsearch/ && \
|
2020-01-31 14:21:55 +00:00
|
|
|
aria2c -s 16 -x 16 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VER-linux-x86_64.tar.gz && \
|
|
|
|
tar xvfz elasticsearch-$ES_VER-linux-x86_64.tar.gz --strip-components=1 -C /usr/share/elasticsearch/ && \
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Add and move files
|
|
|
|
cd /root/dist/ && \
|
|
|
|
mkdir -p /usr/share/elasticsearch/config && \
|
|
|
|
cp elasticsearch.yml /usr/share/elasticsearch/config/ && \
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Setup user, groups and configs
|
|
|
|
addgroup -g 2000 elasticsearch && \
|
2018-05-16 14:57:52 +00:00
|
|
|
adduser -S -H -s /bin/ash -u 2000 -D -g 2000 elasticsearch && \
|
2017-10-13 18:58:14 +00:00
|
|
|
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/ && \
|
2018-08-24 17:07:00 +00:00
|
|
|
rm -rf /usr/share/elasticsearch/modules/x-pack-ml && \
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Clean up
|
2019-03-15 22:23:30 +00:00
|
|
|
apk del --purge aria2 && \
|
2018-11-22 23:18:59 +00:00
|
|
|
rm -rf /root/* && \
|
|
|
|
rm -rf /tmp/* && \
|
|
|
|
rm -rf /var/cache/apk/*
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Healthcheck
|
|
|
|
HEALTHCHECK --retries=10 CMD curl -s -XGET 'http://127.0.0.1:9200/_cat/health'
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Start ELK
|
2018-03-31 15:18:28 +00:00
|
|
|
USER elasticsearch:elasticsearch
|
2018-05-16 14:57:52 +00:00
|
|
|
CMD ["/usr/share/elasticsearch/bin/elasticsearch"]
|