I’m trying to run an elasticsearch docker container passing the following environment variable, which is required in my case.
docker run -e “discovery.type=single-node” some_path/Elasticsearch:1.2.3
It fails as follows because the environment variable is not processed.
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
I’ve seen chatter about similar but no useful resolution. I’d appreciate if anyone has ideas on the matter.
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
Version: 3.2.3
API Version: 3.2.3
Go Version: go1.15.14
Built: Thu Sep 23 23:03:03 2021
OS/Arch: linux/amd64
You actually run a Podman container not Docker container. Podman is not Docker. It has a compatible interface with Docker and you can use Docker images but that’s all. I just wanted to clarify that although I don’t think that is the problem here.
I tried the official elasticsearch image and it works even without setting the discovery type. Can you tell more about what kind of image you are using? How elastic search runs in the container? Directly as PID 1 or started with supervisor?
I worked with an ElasticSearch container which couldn’t use the environment variables. I couldn’t figure out why so I created a script which regenerated the configuration file and restarted Elasticsearch. It was a nasty solution it was acceptable in my case. I don’t know what causes your problem but the official elasticsearch works well, so you could try to compare yours and the official version.
hi! I understand that the answer is a little late, but I faced the same situation and tried to find information in the documentation and forums for a couple of days. In the end, I spat on everything and went to read the scripts of the original container. After 4 hours, after checking the formation of paths and variables several times, I came across an interesting point.
by creating a test script with the contents in the original container, in the /usr/share/elasticsearch/bin directory
source "`dirname "$0"`"/elasticsearch-env
echo $@
and running it, I got a list of variables
having performed this operation in my container, I did not get anything.
I compared the scripts /usr/share/elasticsearch/bin/elasticsearch
and it turned out that when installing from the deb package, we have a hard-coded value of the variable ES_DISTRIBUTION_TYPE=deb, in the original image, the value of this variable = docker, and then there is a check
if [[ “$ES_DISTRIBUTION_TYPE” == “docker” ]]
in which a list of variables is already being generated.
Solution: replace the /usr/share/elasticsearch/bin/elasticsearch script with the original one from the container, or replace the value of the ES_DISTRIBUTION_TYPE variable during assembly