This repository contains Dockerfile of ElasticSearch for Docker's trusted build published to the public Docker Registry.
-
Install Docker.
-
Download trusted build from public Docker Registry:
docker pull dockerfile/elasticsearch
(alternatively, you can build an image from Dockerfile:
docker build -t="dockerfile/elasticsearch" github.com/dockerfile/elasticsearch
)
docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch
- Create a mountable data directory
<workdir>
on the host.
├── conf
│ └── elasticsearch.yml
├── data
│ └── hesa2-esh
├── logs
├── plugins
│ ├── bigdesk
│ ├── eseditor
│ └── head
└── work
- Create ElasticSearch config file at
<workdir>/elasticsearch.yml
.
```yml
path:
logs: /workdir/log
data: /workdir/data
work: /workdir/work
plugins: /workdir/plugins
```
- Start a container by mounting data directory and specifying the custom configuration file:
```sh
docker run -d -p 9200:9200 -p 9300:9300 -v <workdir>:/data dockerfile/elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/workdir/conf/elasticsearch.yml
```
After few seconds, open http://<host>:9200
to see the result.