I have also faced this issue when I was using this docker.elastic.co/elasticsearch/elasticsearch:7.6.2
elastic-search docker image for a single node cluster.
The error I was getting is:
ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
To start a single-node Elasticsearch cluster with Docker
Solution1
So the solution would be to run a docker image with an environment variable -e "discovery.type=single-node"
in docker run command.
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.6.2
Solution2
Add this "discovery.seed_hosts : 127.0.0.1:9300"
in eleasticsearch.yml file. And build your own docker image and use it.
Dockerfile
will look like this.
FROM docker.elastic.co/elasticsearch/elasticsearch:7.6.2
RUN echo discovery.seed_hosts : 127.0.0.1:9300 >> /usr/share/elasticsearch/config/elasticsearch.yml
RUN cat /usr/share/elasticsearch/config/elasticsearch.yml
For more details click here.