docker network create elastic
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.12.1
docker run --name es01-test --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
docker pull docker.elastic.co/kibana/kibana:7.12.1
docker run --name kib01-test --net elastic -p 5601:5601 -e "ELASTICSEARCH_HOSTS=http://es01-test:9200" docker.elastic.co/kibana/kibana:7.12.1
# create a network
docker network create elastic
# start elasticsearch server
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.2.3
docker run --name es01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.2.3 # generate token
# reset password for user elastic
docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
# copy the http_ca.crt security certificate to local
docker cp es01:/usr/share/elasticsearch/config/certs/http_ca.crt .
# test elasticsearch server
curl --cacert http_ca.crt -u elastic https://localhost:9200
docker pull docker.elastic.co/kibana/kibana:8.2.3
docker run --name kibana --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.2.3