-
Notifications
You must be signed in to change notification settings - Fork 1
/
elastic.mk
40 lines (32 loc) · 1.03 KB
/
elastic.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SHELL := /bin/bash
ELASTICSEARCH := .elasticsearch_container
KIBANA := .kibana_container
ES_TAG := 2
KIBANA_TAG := 4
$(ELASTICSEARCH):
docker run -d \
--name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
--entrypoint bash \
elasticsearch:$(ES_TAG) -c '\
bin/plugin install cloud-aws ; \
/docker-entrypoint.sh elasticsearch' >> $(ELASTICSEARCH)
docker exec -it elasticsearch sh -c 'bin/plugin install lmenezes/elasticsearch-kopf';
$(KIBANA):
docker run -d \
--name kibana \
-p 5601:5601 \
-e ELASTICSEARCH_URL=http://elasticsearch:9200 \
--link elasticsearch kibana:$(KIBANA_TAG) >> $(KIBANA)
start-elastic: $(ELASTICSEARCH) $(KIBANA)
wait-elastic:
@while [[ ! `curl -sf http://localhost:9200` ]]; do sleep 5; done
@echo "Elasticsearch is running at: http://localhost:9200"
open-elastic: wait-elastic
open http://localhost:5601
open http://localhost:9200/_plugin/kopf
stop-elastic:
-cat $(KIBANA) $(ELASTICSEARCH) | xargs docker kill
-cat $(KIBANA) $(ELASTICSEARCH) | xargs docker rm
rm -f $(KIBANA) $(ELASTICSEARCH)