Build the Docker image using the following command
$ docker build -t elasticsearch-index:<tag> .
Run the Docker container using the command below.
$ docker run -d -p 9200:9200 elasticsearch-index:<tag>
Default Port for application is 9200
.
-
ES_JAVA_OPTS
- Heap Size can be specified$ docker run -d -p 9200:9200 -e ES_JAVA_OPTS='<HEAP_SIZE>' elasticsearch-index:<tag>
-
/usr/share/elasticsearch/data
- Will contain the elasticsearch data files$ docker run -d -p 9200:9200 -v /your/path/to/es_data:/usr/share/elasticsearch/data elasticsearch-index:<tag>