From 9349ca6d04159ba9ebf105f5e229d66fc17e5d5c Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 15 Nov 2014 04:39:34 +0000 Subject: [PATCH] Initial setup of direct-from-elasticsearch.org install --- elasticsearch/Dockerfile | 27 +++++++++++++++++++++++++++ elasticsearch/start | 25 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 elasticsearch/Dockerfile create mode 100755 elasticsearch/start diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile new file mode 100644 index 00000000..1d6adcd9 --- /dev/null +++ b/elasticsearch/Dockerfile @@ -0,0 +1,27 @@ +FROM itzg/ubuntu-openjdk-7 + +MAINTAINER itzg +ENV ES_VERSION 1.3.5 + +RUN apt-get install -y wget && apt-get clean + +RUN wget -qO /tmp/es.tgz https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-$ES_VERSION.tar.gz && \ + cd /usr/share && \ + tar xf /tmp/es.tgz && \ + rm /tmp/es.tgz + +ENV ES_HOME /usr/share/elasticsearch-$ES_VERSION +RUN useradd -d $ES_HOME -M -r elasticsearch && \ + chown -R elasticsearch: $ES_HOME + +RUN mkdir /data /conf && touch /data/.ENABLED /conf/.ENABLED && chown -R elasticsearch: /data /conf +VOLUME ["/data","/conf"] + +ADD start /start + +WORKDIR $ES_HOME +USER elasticsearch + +EXPOSE 9200 9300 + +CMD ["/start"] diff --git a/elasticsearch/start b/elasticsearch/start new file mode 100755 index 00000000..21f057aa --- /dev/null +++ b/elasticsearch/start @@ -0,0 +1,25 @@ +#!/bin/sh + +set -x + +if [ ! -e /conf/elasticsearch.* ]; then + cp $ES_HOME/config/elasticsearch.yml /conf +fi + +if [ ! -e /conf/logging.* ]; then + cp $ES_HOME/config/logging.yml /conf +fi + +OPTS="-Des.path.conf=/conf -Des.path.data=/data" + +if [ -n "$CLUSTER" ]; then + OPTS="$OPTS -Des.cluster.name=$CLUSTER" +fi +if [ -n "$NODE_NAME" ]; then + OPTS="$OPTS -Des.node.name=$NODE_NAME" +fi +if [ -n "$UNICAST_HOSTS" ]; then + OPTS="$OPTS -Des.discovery.zen.ping.unicast.hosts=$UNICAST_HOSTS" +fi + +$ES_HOME/bin/elasticsearch $OPTS