如何让elasticsearch在ubuntu docker container

时间:2017-05-16 12:13:40

标签: ubuntu elasticsearch docker

我有一个包含以下内容的dockerfile:

FROM ubuntu:14.04

# Install Java 8
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
    apt-get install -y software-properties-common && \
    apt-add-repository ppa:webupd8team/java && \
    apt-get update -y && \
    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
    echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
    apt-get install -y oracle-java8-installer && \
    apt-get install -y oracle-java8-unlimited-jce-policy && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* && \
    rm -rf /var/cache/oracle-jdk8-installer

ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
RUN java -version

# Now install Elasticsearch
RUN wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.4.0.tar.gz
RUN tar -xvzf elasticsearch-5.4.0.tar.gz
RUN elasticsearch-5.4.0/bin/elasticsearch

EXPOSE 80

在使用elasticsearch.tar.gz之前我尝试使用elasticsearch.deb但是无法使其工作,是否有关于如何使弹性搜索工作的指令?

这是我的错误:

uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

0 个答案:

没有答案