# v8.X Docker image does not accept bin/elasticsearch env variables

**URL:** <https://discuss.elastic.co/t/v8-x-docker-image-does-not-accept-bin-elasticsearch-env-variables/302446>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [April 14, 2022, 2:56pm UTC](https://discuss.elastic.co/t/v8-x-docker-image-does-not-accept-bin-elasticsearch-env-variables/302446 "2022-04-14T14:56:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![violetaria](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@violetaria](https://discuss.elastic.co/u/violetaria)\
**Post date:** [April 14, 2022, 2:56pm UTC](https://discuss.elastic.co/t/v8-x-docker-image-does-not-accept-bin-elasticsearch-env-variables/302446/1 "2022-04-14T14:56:49Z")

</div>

Using the existing docker image does not accept positional arguments for Elasticsearch environment variables correctly. The [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-configuration-methods) states that we should be able to pass the arguments in with this command

```auto
docker run --rm --name es8 --net elastic -p 9200:9200 -p 9300:9300 -it elasticsearch:8.1.2 bin/elasticsearch -Ediscovery.type=single-node -Expack.security.enabled=false

```

However security is enabled (confirmed via logs) and the server fails to start.

```auto
{"@timestamp":"2022-04-14T14:47:25.182Z", "log.level": "INFO", "message":"Security is enabled", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main","log.logger":"org.elasticsearch.xpack.security.Security","elasticsearch.node.name":"0e0953f434a9","elasticsearch.cluster.name":"docker-cluster"}
...
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
bootstrap check failure [1] of [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/docker-cluster.log

```

A custom Dockerfile with the environment variables set works and correctly starts with security disabled

```auto
FROM elasticsearch:8.1.2
ENV xpack.security.enabled=false discovery.type=single-node

```

Also, using variable names in the CI tool like this works correctly, but I believe there is still a bug around what documentation states and how the image works.

```auto
    ES_SETTING_DISCOVERY_TYPE: "single-node"
    ES_SETTING_XPACK_SECURITY_ENABLED: "false"

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [April 14, 2022, 3:47pm UTC](https://discuss.elastic.co/t/v8-x-docker-image-does-not-accept-bin-elasticsearch-env-variables/302446/2 "2022-04-14T15:47:10Z")

</div>

> [@violetaria](#):
>
> ```auto
> ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
> 
> ```

What makes you think that this error is about security? Just to be sure that this is the only error, or is there more?

Take a look at [Install Elasticsearch with Docker | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#_set_vm_max_map_count_to_at_least_262144)

---

<div class="post-metadata">

**Author:** ![violetaria](https://avatars.discourse-cdn.com/v4/letter/v/3bc359/32.png) [@violetaria](https://discuss.elastic.co/u/violetaria)\
**Post date:** [April 14, 2022, 4:56pm UTC](https://discuss.elastic.co/t/v8-x-docker-image-does-not-accept-bin-elasticsearch-env-variables/302446/3 "2022-04-14T16:56:31Z")

</div>

That error is due to discovery\_type not being set to `single-node` (it's running in production mode). That error doesn't happen when the environment variable is set.

The first item isn't an error, just an INFO log saying `"message":"Security is enabled"` when it was requested to be disabled. The server is not available on http unless the environment variable is set.

---

<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:** [May 12, 2022, 4:57pm UTC](https://discuss.elastic.co/t/v8-x-docker-image-does-not-accept-bin-elasticsearch-env-variables/302446/4 "2022-05-12T16:57:04Z")

</div>

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