X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fcaas-logging.git;a=blobdiff_plain;f=docker-build%2Felasticsearch%2FDockerfile;fp=docker-build%2Felasticsearch%2FDockerfile;h=ed0043a917d03db3eca4f782e4206baad5b62a26;hp=0000000000000000000000000000000000000000;hb=229e54ec0c45ee7389247cf6cda79d31b303de85;hpb=9afa6af59d04c80d65eede7fc36b09d370b57abb diff --git a/docker-build/elasticsearch/Dockerfile b/docker-build/elasticsearch/Dockerfile new file mode 100644 index 0000000..ed0043a --- /dev/null +++ b/docker-build/elasticsearch/Dockerfile @@ -0,0 +1,62 @@ +# Copyright 2019 Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM centos:7.6.1810 +MAINTAINER Levente Kale + +ARG VERSION +ENV ES_VERSION=$VERSION + +ENV PATH /usr/share/elasticsearch/bin:$PATH +ENV JAVA_HOME /usr/lib/jvm/jre-1.8.0-openjdk +ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch" +ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz" +ENV ES_TARBALL_ASC "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz.asc" +ENV EXPECTED_SHA_URL "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz.sha512" + +WORKDIR /usr/share/elasticsearch + +RUN groupadd -g 202 elasticsearch \ +&& adduser -u 202 -g 202 -d /usr/share/elasticsearch elasticsearch \ +&& yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ +&& yum install -y --setopt=skip_missing_names_on_install=False \ + java-1.8.0-openjdk-headless \ + unzip \ + which \ + coreutils \ + cronie \ + supervisor \ +&& yum clean all \ +&& curl -fsSL ${ES_TARBAL} | tar zx --strip-components=1 \ +&& echo "===> Creating Elasticsearch Paths..." \ + && for path in \ + /usr/share/elasticsearch/data \ + /usr/share/elasticsearch/logs \ + /usr/share/elasticsearch/config \ + /usr/share/elasticsearch/config/scripts \ + /usr/share/elasticsearch/plugins \ + ; do \ + mkdir -p "$path"; \ + chown -R elasticsearch:elasticsearch "$path"; \ + done + +COPY config/elastic /usr/share/elasticsearch/config +COPY config/logrotate /etc/logrotate.d/elasticsearch +COPY healthcheck /usr/local/bin/ +COPY elasticsearch-setindex /usr/share/elasticsearch + +RUN chown -R elasticsearch:elasticsearch /usr/share/elasticsearch /etc/logrotate.d/elasticsearch /usr/local/bin/healthcheck \ +&& chmod +x /usr/share/elasticsearch/elasticsearch-setindex + +CMD ["elasticsearch"]