# Elasticsearch docker environment variables prefix

**URL:** <https://discuss.elastic.co/t/elasticsearch-docker-environment-variables-prefix/294711>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [January 18, 2022, 4:08pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-environment-variables-prefix/294711 "2022-01-18T16:08:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rschirin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rschirin/32/45283_2.png) [@rschirin](https://discuss.elastic.co/u/rschirin)\
**Post date:** [January 18, 2022, 4:08pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-environment-variables-prefix/294711/1 "2022-01-18T16:08:58Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/reference/master/docker.html#docker-configuration-methods)

With the instructions to convert the setting name as follows:

```auto
    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:

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

```

This fails:

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

```

is there anything wrong?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 15, 2022, 4:09pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-environment-variables-prefix/294711/2 "2022-02-15T16:09:48Z")

</div>

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