elasticsearch,kibana,opennlp,ingest,Docker,elasticsearch,Kibana,Opennlp,Ingest" /> elasticsearch,kibana,opennlp,ingest,Docker,elasticsearch,Kibana,Opennlp,Ingest" />

Docker 自动编辑停靠容器中的文件

Docker 自动编辑停靠容器中的文件,docker,elasticsearch,kibana,opennlp,ingest,Docker,elasticsearch,Kibana,Opennlp,Ingest,我有我的用于elasticsearch和kibana的Docked容器,一旦我启动docker容器,它就会自动安装一些插件 我需要编辑config/elasticsearch.yml文件以启用该插件的使用,我正在尝试找到类似于我通过如下所示的文件安装插件的方法 ARG ELASTIC_VERSION="$ELASTIC_VERSION" FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION} RUN bin/

我有我的用于elasticsearch和kibana的Docked容器,一旦我启动docker容器,它就会自动安装一些插件

我需要编辑config/elasticsearch.yml文件以启用该插件的使用,我正在尝试找到类似于我通过如下所示的文件安装插件的方法

ARG ELASTIC_VERSION="$ELASTIC_VERSION"

FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}

RUN bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/7.6.0.1/ingest-opennlp-7.6.0.1.zip
RUN bin/elasticsearch-plugin install mapper-annotated-text
RUN bin/elasticsearch-plugin install analysis-phonetic
RUN bin/elasticsearch-plugin install ingest-attachment --batch
RUN bin/ingest-opennlp/download-models

正确的方法是创建新的docker映像:

  • 使用elasticsearch作为基础图像创建新的Dockerfile。覆盖此图像中的elasticsearch.yml文件。现在,建立这个形象
  • (可选)将此图像推送到dockerhub
  • 将此映像用于部署
  • 已解决,非常感谢您提供的所有帮助
    灵感来自

    更新的elasticsearch文件;将此保存在此处,以备将来参考

    ARG ELASTIC_VERSION="$ELASTIC_VERSION"
    
    FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}
    
    RUN bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/7.6.0.1/ingest-opennlp-7.6.0.1.zip
    RUN bin/elasticsearch-plugin install mapper-annotated-text
    RUN bin/elasticsearch-plugin install analysis-phonetic
    RUN bin/elasticsearch-plugin install ingest-attachment --batch
    RUN bin/ingest-opennlp/download-models
    
    
    RUN echo "ingest.opennlp.model.file.persons: en-ner-persons.bin" >> /usr/share/elasticsearch/config/elasticsearch.yml
    RUN echo "ingest.opennlp.model.file.dates: en-ner-dates.bin" >> /usr/share/elasticsearch/config/elasticsearch.yml
    RUN echo "ingest.opennlp.model.file.locations: en-ner-locations.bin" >> /usr/share/elasticsearch/config/elasticsearch.yml
    

    感谢您的帮助@Palash Goel,我已经更新了我得到的工作解决方案。
    ARG ELASTIC_VERSION="$ELASTIC_VERSION"
    
    FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}
    
    RUN bin/elasticsearch-plugin install https://github.com/spinscale/elasticsearch-ingest-opennlp/releases/download/7.6.0.1/ingest-opennlp-7.6.0.1.zip
    RUN bin/elasticsearch-plugin install mapper-annotated-text
    RUN bin/elasticsearch-plugin install analysis-phonetic
    RUN bin/elasticsearch-plugin install ingest-attachment --batch
    RUN bin/ingest-opennlp/download-models
    
    
    RUN echo "ingest.opennlp.model.file.persons: en-ner-persons.bin" >> /usr/share/elasticsearch/config/elasticsearch.yml
    RUN echo "ingest.opennlp.model.file.dates: en-ner-dates.bin" >> /usr/share/elasticsearch/config/elasticsearch.yml
    RUN echo "ingest.opennlp.model.file.locations: en-ner-locations.bin" >> /usr/share/elasticsearch/config/elasticsearch.yml