Files
dockerfiles/elasticsearch
Qi Zheng 3259d3bab3 Use su-exec to run commands on entryponit
With su-exec, make sure the SIGTERM upon docker stop
could be received by the running program thus causing
a clean stop/exit.

Signed-off-by: Qi Zheng <qi.zheng@intel.com>
2019-07-23 15:47:45 -07:00
..
2019-04-16 09:25:18 -07:00
2019-06-18 14:57:22 +08:00

Elasticsearch

This provides a Clear Linux* Elasticsearch instance.

Build

docker build -t clearlinux/elasticsearch .

Or just pull it from Dockerhub

docker pull clearlinux/elasticsearch

Start a elasticsearch instance

docker volume create esdata
docker run -d -p 9200:9200 -e "discovery.type=single-node" -v esdata:/var/data/elasticsearch clearlinux/elasticsearch

Set the configuration file to the path /etc/elasticsearch/ by default CMD "-Epath.conf=/etc/elasticsearch/".

Check cluster health

curl http://localhost:9200/_cluster/health?pretty

Create an index called customer

curl -X PUT "localhost:9200/customer?pretty"

Add new document to that index

curl -X PUT "localhost:9200/customer/doc/1?pretty" -H 'Content-Type: application/json' -d'{"name": "Tom John" }'
curl -X PUT "localhost:9200/customer/doc/2?pretty" -H 'Content-Type: application/json' -d'{"name": "Kelly Wong" }'

View documents in the index

curl localhost:9200/customer/_search?pretty

Details of how-to

Please refer to page.

Extra Build ARGs

  • swupd_args Specifies SWUPD flags

Default build args in Docker are on: https://docs.docker.com/engine/reference/builder/#arg