File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ services:
2525
2626 kibana :
2727 image : docker.elastic.co/kibana/kibana:${TAG}
28- environment : ['ELASTICSEARCH_PASSWORD=${ELASTIC_PASSWORD}']
28+ environment :
29+ - ELASTICSEARCH_USERNAME=kibana
30+ - ELASTICSEARCH_PASSWORD=${ELASTIC_PASSWORD}
2931 ports : ['127.0.0.1:5601:5601']
3032 networks : ['stack']
3133 depends_on : ['elasticsearch']
@@ -102,6 +104,14 @@ services:
102104 networks : ['stack']
103105 depends_on : ['elasticsearch']
104106
107+ setup_kibana :
108+ image : centos:7
109+ volumes : ['./scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro']
110+ command : ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash']
111+ environment : ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
112+ networks : ['stack']
113+ depends_on : ['elasticsearch']
114+
105115 setup_auditbeat :
106116 image : docker.elastic.co/beats/auditbeat:${TAG}
107117 volumes : ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ es_url=http://elastic:${ELASTIC_PASSWORD} @elasticsearch:9200
6+
7+ # Wait for Elasticsearch to start up before doing anything.
8+ until curl -s $es_url -o /dev/null; do
9+ sleep 1
10+ done
11+
12+ # Set the password for the kibana user.
13+ # REF: https://www.elastic.co/guide/en/x-pack/6.0/setting-up-authentication.html#set-built-in-user-passwords
14+ until curl -s -H ' Content-Type:application/json' \
15+ -XPUT $es_url /_xpack/security/user/kibana/_password \
16+ -d " {\" password\" : \" ${ELASTIC_PASSWORD} \" }"
17+ do
18+ sleep 2
19+ echo Retrying...
20+ done
You can’t perform that action at this time.
0 commit comments