ElasticSearch Dockerfile. Also published to public Docker Registry.
-
Install Docker
-
Download image from public Docker Registry:
docker pull dockerize/elasticsearch
or build an image from the Dockerfile:
docker build -t dockerize/elasticsearch github.com/dockerize/elasticsearch
docker run -d -p 9200:9200 -p 9300:9300 -v <data-dir>:/data dockerize/elasticsearch
-
Create a mountable data directory on the host.
-
Create ElasticSearch config file at /elasticsearch.yml.
path:
logs: /data/log
data: /data/data
- Start a container by mounting data directory and specifying the custom configuration file:
docker run -d -p 9200:9200 -p 9300:9300 -v <data-dir>:/data dockerize/elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.yml
After few seconds, open [https://localhost:9200] to see the result.