Dockerfile

因es安装了些自定义插件,且重建index比较麻烦,自制了个image
Dockerfile如下

FROM adoptopenjdk/openjdk8
MAINTAINER alphar
COPY ./elasticsearch-6.1.1 /usr/local/elasticsearch-6.1.1
#vm.max_map_count 数目
RUN sysctl -w vm.max_map_count=262144 && sysctl -a|grep vm.max_map_count
#创建用户并授权
RUN useradd --create-home --no-log-init --shell /bin/bash es && chown -R es /usr/local/elasticsearch-6.1.1
#切换用户
ENTRYPOINT ["su", "es"]
CMD [ "/usr/local/elasticsearch-6.1.1/bin/elasticsearch"]