0

I have my dockerized container for elasticsearch and kibana running, with it automatically installing some plugins once i start the docker container.

I need to edit the config/elasticsearch.yml file to enable the usage of that one plugin and i am trying to find the way to get it done similar to the way i have installed the plugins through a file as shown below

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
richylyq
  • 1
  • 4

2 Answers2

0

The correct way would be to create a new docker image:

  1. Create a new Dockerfile with elasticsearch as base image. Overwrite the elasticsearch.yml file in this image. And now, build this image
FROM elasticsearch
COPY elasticsearch.yml config/elasticsearch.yml
  1. Optionally, push this image to dockerhub
  2. Use this image for deployments
Palash Goel
  • 624
  • 6
  • 17
0

RESOLVED SO THANKS FOR ALL THE HELP RECEIVED
INSPIRED BY https://stackoverflow.com/a/49755244/12851178

Updated elasticsearch file; Keeping this here for others' future references

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
richylyq
  • 1
  • 4