How to change default elasticsearch password in docker-compose? How to change default elasticsearch password in docker-compose? elasticsearch elasticsearch

How to change default elasticsearch password in docker-compose?


Starting from 6.0 elasticsearch docker images has the ability to configure the password using the following environment variable - ELASTIC_PASSWORD.
For example:
docker run -e ELASTIC_PASSWORD=MagicWord docker.elastic.co/elasticsearch/elasticsearch-platinum:6.1.3
See:https://www.elastic.co/guide/en/elasticsearch/reference/6.1/docker.html