| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You 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. |
| |
| # Ubuntu Xenial 16.04 [LTS] |
| FROM ubuntu:16.04 |
| |
| # install system wide deps |
| RUN apt-get -yqq update |
| RUN apt-get -yqq install openjdk-8-jre |
| |
| RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 46095ACC8548582C1A2699A9D27D666CD88E42B4 |
| |
| ENV ELASTICSEARCH_VERSION 2.3.5 |
| ENV ELASTICSEARCH_REPO_BASE http://packages.elasticsearch.org/elasticsearch/2.x/debian |
| |
| RUN echo "deb $ELASTICSEARCH_REPO_BASE stable main" > /etc/apt/sources.list.d/elasticsearch.list |
| |
| # install elasticsearch |
| RUN set -x \ |
| && apt-get -yqq update \ |
| && apt-get -yqq install --no-install-recommends elasticsearch=$ELASTICSEARCH_VERSION \ |
| && rm -rf /var/lib/apt/lists/* |
| |
| ENV PATH /usr/share/elasticsearch/bin:$PATH |
| |
| WORKDIR /usr/share/elasticsearch |
| |
| RUN set -ex \ |
| && for path in \ |
| ./data \ |
| ./logs \ |
| ./config \ |
| ./config/scripts \ |
| ; do \ |
| mkdir -p "$path"; \ |
| chown -R elasticsearch:elasticsearch "$path"; \ |
| done |
| |
| COPY elasticsearch.yml /usr/share/elasticsearch/config |
| COPY logging.yml /usr/share/elasticsearch/config |
| |
| USER elasticsearch |
| |
| # Install Elastic-HQ |
| RUN plugin install royrusso/elasticsearch-HQ/2.0.3 |
| |
| CMD ["elasticsearch"] |
| |
| # Run on ports 9200 & 9300 |
| EXPOSE 9200 9300 |