2

I can start elasticsearch with Kibana using the following 2 docker commands...

docker run -d -p 9200:9200 -p 9300:9300 --name elasticsearch-pb elasticsearch
docker run -d -p 5601:5601 --name kibana-pb --link elasticsearch-pb:elasticsearch -e ELASTICSEARCH_URL=http://elasticsearch:9200 kibana

But how do I start es with script support using docker?

Usually this is done by adding 2 lines to elasticsearch.yml file.

script.inline: on
script.indexed: on

how do I change the config file within docker image?

2 Answers 2

3

Build a custom image that includes those options.

Create a directory for your docker image

mkdir my_elasticsearch
cd my_elasticsearch

Create an elasticsearch.yml with all the options including

script.inline: on
script.indexed: on

Create a Dockerfile that copies the config file.

from elasticsearch
copy elastcsearch.yml /container/path/to/elasticsearch.yml

Build and tag the image

docker build -t my/elasticsearch .

Then run your image

docker run -d -p 9200:9200 -p 9300:9300 --name elasticsearch-pb my/elasticsearch

You might want to publish your image to the Docker Hub or another registry so you only need to build it once.

You can also use docker-compose to manage the build process and multiple containers.

Sign up to request clarification or add additional context in comments.

Comments

2

One approach is to create your own elasticsearch image, through a Dockerfile starting with the official elasticsearch image.

FROM elasticsearch:5
COPY myconfig /path/to/elasticsearch.yml

That way, your image can start an elasticsearch container with the right configuration pre-setted.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.