How to use this image
To start a basic container using ephemeral storage:
docker run --name %p \ --publish 9200:9200 \ --publish 9300:9300 \ cgswong/elasticsearch
Within the container the volume
/var/lib/elasticsearch is exposed. It contains the sub-directories for
config. To start a default container with attached persistent/shared storage for data:
mkdir -p /es/data docker run --rm --name %p --publish 9200:9200 \ --publish 9300:9300 \ --volume /var/lib/elasticsearch/data:/var/lib/elasticsearch/data \ cgswong/elasticsearch
Attaching persistent storage ensures that the data is retained across container restarts (with some obvious caveats). It is recommended this be done instead via a data container, preferably hosted an AWS S3 bucket or other externalized, distributed persistent storage.
A few plugins are installed:
BigDesk: Provides live charts and statistics for an Elasticsearch cluster. You can open a browser and navigate to
http://localhost:9200/_plugin/bigdesk/it will open Bigdesk and auto-connect to the ES node. You will need to change the
9200port to the correct values for your environment/setup.
Elasticsearch Head: A web front end for an Elasticsearch cluster. Open
http://localhost:9200/_plugin/head/and it will run it as a plugin within the Elasticsearch cluster.
Curator: Helps with management of indices.
AWS Cloud - Allows usage of AWS API for unicast discovery and S3 repositories for snapshots.
Environment variables are accepted as a means to provide further configuration by reading those starting with
ES_. Any matching variables will get added to Elasticsearch's configuration file, `elasticsearch.yml' by:
- Removing the
- Transforming to lower case
- Replacing occurrences of
., except where there is a double (
__) which is replaced by a single (
For example, an environment variable
ES_CLUSTER_NAME=lscluster will result in
ES_CLOUD_AWS_ACCESS__KEY=GHKDFIADFNADFIADFKJG would result in
You can also import your own configuration file by setting
ES_CFG_URL to a valid URL. The environment variable substitution can then also be used on your file as well.