Dockerfile 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. FROM docker.shemic.com/os/alpine/glibc:latest
  2. MAINTAINER Rabin "https://github.com/shemic"
  3. # set environment variable
  4. ENV ES_HOME=/usr/local/elasticsearch
  5. ENV ELASTICSEARCH_VERSION=5.5.1
  6. ENV PATH=$PATH:$ES_HOME/bin
  7. ENV JAVA_HOME=/share/lib/jdk
  8. ENV PATH=${PATH}:${JAVA_HOME}/bin:${JAVA_HOME}/sbin
  9. # install elasticsearch
  10. RUN apk add --no-cache --update bash curl procps ncurses openjdk8 && \
  11. curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz && \
  12. tar -xzvf elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz && \
  13. mv elasticsearch-${ELASTICSEARCH_VERSION} $ES_HOME && \
  14. rm elasticsearch-${ELASTICSEARCH_VERSION}.tar.gz && \
  15. adduser es -D && \
  16. mkdir -p /elasticsearch/data && \
  17. mkdir -p /elasticsearch/logs && \
  18. chown -R es:es $ES_HOME /elasticsearch /tmp && \
  19. chmod -R 777 /tmp /elasticsearch && \
  20. cd $ES_HOME && \
  21. echo y | elasticsearch-plugin install x-pack && \
  22. apk del curl openjdk8
  23. USER es
  24. COPY elasticsearch.sh /entrypoint/elasticsearch.sh
  25. VOLUME ["/usr/local/elasticsearch/config"]