Initial setup of direct-from-elasticsearch.org install

This commit is contained in:
Geoff Bourne 2014-11-15 04:39:34 +00:00
parent 9e845521a9
commit 9349ca6d04
2 changed files with 52 additions and 0 deletions

27
elasticsearch/Dockerfile Normal file
View file

@ -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"]

25
elasticsearch/start Executable file
View file

@ -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