# Elasticsearch not generating certificates and enrollment tokens when started from a DockerFile

**URL:** <https://discuss.elastic.co/t/elasticsearch-not-generating-certificates-and-enrollment-tokens-when-started-from-a-dockerfile/340119>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 4, 2023, 9:38am UTC](https://discuss.elastic.co/t/elasticsearch-not-generating-certificates-and-enrollment-tokens-when-started-from-a-dockerfile/340119 "2023-08-04T09:38:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanmay\_Sharma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanmay_sharma/32/123756_2.png) [@Tanmay\_Sharma](https://discuss.elastic.co/u/Tanmay_Sharma)\
**Post date:** [August 4, 2023, 9:38am UTC](https://discuss.elastic.co/t/elasticsearch-not-generating-certificates-and-enrollment-tokens-when-started-from-a-dockerfile/340119/1 "2023-08-04T09:38:22Z")

</div>

Hello everyone, i'm trying to spin up a docker container for elasticsearch using the Dockerfile:

```auto
FROM elasticsearch:8.8.1

# Set the environment variables for Elasticsearch.
ENV discovery.type=single-node
ENV xpack.security.enabled=true
ENV ELASTIC_PASSWORD=changeme
ENV http.cors.enabled=true
ENV http.cors.allow-origin="http://local.company.com"
ENV http.cors.allow-methods=POST
ENV http.cors.allow-credentials=true
ENV http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization,Access-Control-Allow-Headers,Accept

EXPOSE 9200
EXPOSE 9300

```

But for some reason it is not generating the default certificates in the certs folder (i checked by attaching a shell to the container and in the config folder) neither it is generating password and enrollment tokens. Is anyone aware of this problem?

---

<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:** [September 1, 2023, 9:39am UTC](https://discuss.elastic.co/t/elasticsearch-not-generating-certificates-and-enrollment-tokens-when-started-from-a-dockerfile/340119/2 "2023-09-01T09:39:13Z")

</div>

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