From 44f811d6720d815e40f70df5ae4afc01316529bd Mon Sep 17 00:00:00 2001 From: sipp11 Date: Thu, 14 Jun 2018 11:55:33 +0900 Subject: [PATCH] Docker Elasticsearch 2.4.6 --- Dockerfile | 21 +++++++++++++++++++++ docker-entrypoint.sh | 4 ++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile create mode 100755 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..53cb5c1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM java:8 +ENV ELASTICSEARCH=2.4.6 + +# elasticsearch doesn't allow to run as root +RUN useradd user +RUN mkdir -p /data/esdata +RUN mkdir -p /data/log +RUN chown -R user:user /data + +WORKDIR /usr/src + +COPY elasticsearch-${ELASTICSEARCH} /usr/src/ +COPY docker-entrypoint.sh /docker-entrypoint.sh + +EXPOSE 9200 +EXPOSE 9300 + +USER user:user + +# RUN /usr/src/elasticsearch-2.4.6/bin/elasticsearch +CMD ["/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..78724b5 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + + +exec /usr/src/bin/elasticsearch