This repository contains a Dockerfile of ElasticSearch for Docker's automated build published to the public Docker Hub Registry.
-
Install Docker.
-
Download the automated build from the public Docker Hub Registry:
docker pull uqlibrary/elasticsearch
(or, you can build an image from Dockerfile: `docker build -t uqlibrary/elasticsearch .)
-
Create a mountable data directory
<data-dir>
on the host. -
Start a container by mounting the data directory and specifying the cluster name as an environment variable:
docker run -v <data-dir>:/data uqlibrary/elasticsearch
After few seconds, open http://<host>:9200
to see the result.
The following environment variables can be used to configure the container:
ES_CLUSTER_NAME (REQUIRED) The name of the Elasticsearch cluster.
ES_NODE_MASTER (REQUIRED) Whether the node will be the master in the cluster.
Setting to "true" makes this node the master.
ES_NODE_DATA (REQUIRED) Whether the node will be a data node in the cluster.
Setting to "true" makes this a data node.