Elasticsearch docker environment variables prefix

I'm trying to run ES in docker with specific env variables such as discovery.type=single-node, but my hosting provider prohibits . characters in env variable names.

This is discussed here: Install Elasticsearch with Docker | Elasticsearch Guide [master] | Elastic

With the instructions to convert the setting name as follows:

    Change the setting name to uppercase
    Prefix it with ES_SETTING_
    Escape any underscores (_) by duplicating them
    Convert all periods (.) to underscores (_)

So, I think it should become ES_SETTING_DISCOVERY_TYPE=single-node

This works on my laptop:

docker run -e "discovery.type=single-node" -p 9200:9200 elasticsearch:7.16.0

This fails:

docker run -e "ES_SETTING_DISCOVERY_TYPE=single-node" -p 9200:9200 elasticsearch:7.16.0

is there anything wrong?

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.