2022-06-14 10:47:11 +00:00
|
|
|
FROM ubuntu:22.04
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2020-01-31 14:21:55 +00:00
|
|
|
# VARS
|
2024-07-08 13:46:22 +00:00
|
|
|
ENV ES_VER=8.14.2
|
2022-01-23 21:12:34 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Include dist
|
2022-03-08 23:36:03 +00:00
|
|
|
COPY dist/ /root/dist/
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2022-01-23 21:12:34 +00:00
|
|
|
RUN apt-get update -y && \
|
|
|
|
apt-get install -y \
|
|
|
|
aria2 \
|
|
|
|
curl && \
|
|
|
|
#
|
|
|
|
# Determine arch, get and install packages
|
|
|
|
ARCH=$(arch) && \
|
|
|
|
if [ "$ARCH" = "x86_64" ]; then ES_ARCH="amd64"; fi && \
|
|
|
|
if [ "$ARCH" = "aarch64" ]; then ES_ARCH="arm64"; fi && \
|
|
|
|
echo "$ARCH" && \
|
2017-10-13 18:58:14 +00:00
|
|
|
cd /root/dist/ && \
|
2022-01-23 21:12:34 +00:00
|
|
|
aria2c -s 16 -x 16 https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VER-$ES_ARCH.deb && \
|
|
|
|
dpkg -i elasticsearch-$ES_VER-$ES_ARCH.deb && \
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Add and move files
|
2022-02-16 02:55:20 +00:00
|
|
|
# rm -rf /usr/share/elasticsearch/modules/x-pack-ml && \
|
2017-10-13 18:58:14 +00:00
|
|
|
mkdir -p /usr/share/elasticsearch/config && \
|
2022-01-23 21:12:34 +00:00
|
|
|
cp elasticsearch.yml /etc/elasticsearch/ && \
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Setup user, groups and configs
|
2022-01-23 21:12:34 +00:00
|
|
|
groupmod -g 2000 elasticsearch && \
|
|
|
|
usermod -u 2000 elasticsearch && \
|
|
|
|
chown -R root:elasticsearch /etc/default/elasticsearch \
|
|
|
|
/etc/elasticsearch && \
|
|
|
|
chown -R elasticsearch:elasticsearch /var/lib/elasticsearch \
|
|
|
|
/var/log/elasticsearch && \
|
2019-08-15 15:38:12 +00:00
|
|
|
#
|
2017-10-13 18:58:14 +00:00
|
|
|
# Clean up
|
2022-01-23 21:12:34 +00:00
|
|
|
apt-get purge aria2 -y && \
|
|
|
|
apt-get autoremove -y --purge && \
|
2022-03-08 23:36:03 +00:00
|
|
|
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /root/.cache /root/*
|
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
|
2021-12-13 15:59:48 +00:00
|
|
|
CMD ["/usr/share/elasticsearch/bin/elasticsearch"]
|