# ES container in Docker changes the "temp" directory every time the container runs!

**URL:** <https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 13, 2021, 2:21pm UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371 "2021-08-13T14:21:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aza-zil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aza-zil/32/92217_2.png) [@aza-zil](https://discuss.elastic.co/u/aza-zil)\
**Post date:** [August 13, 2021, 2:21pm UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371/1 "2021-08-13T14:21:33Z")

</div>

I am trying to develope a plugin, it must writes files on a click. After I searched, I found out that I can only write to "temp" folder, is that right?  
So, in windows, I was able to locate the "temp" folder and everything run fine! but when I tried to install the plugin in Docker, I found out that the "temp" directory changes every time I start ES container in Docker!!  
what can I do?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 17, 2021, 1:12am UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371/2 "2021-08-17T01:12:09Z")

</div>

Which temp directory are you referring to here?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 17, 2021, 5:02am UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371/3 "2021-08-17T05:02:30Z")

</div>

Is the data stored local per node or does it need to be available to all nodes in the cluster in multi-node deployments? As far as I know most plugins tend to store data in system indices avaiulable to all nodes in the cluster instead of writing data to disk locally.

---

<div class="post-metadata">

**Author:** ![aza-zil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aza-zil/32/92217_2.png) [@aza-zil](https://discuss.elastic.co/u/aza-zil)\
**Post date:** [August 20, 2021, 2:17pm UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371/4 "2021-08-20T14:17:14Z")

</div>

The temp directory that I was talking about is "es\_tmpdir".

---

<div class="post-metadata">

**Author:** ![aza-zil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aza-zil/32/92217_2.png) [@aza-zil](https://discuss.elastic.co/u/aza-zil)\
**Post date:** [August 20, 2021, 2:18pm UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371/5 "2021-08-20T14:18:57Z")

</div>

The data is stored in indices, but I wanted to create locally a temporary file that will contain part of this data.

---

<div class="post-metadata">

**Author:** ![aza-zil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aza-zil/32/92217_2.png) [@aza-zil](https://discuss.elastic.co/u/aza-zil)\
**Post date:** [August 20, 2021, 2:21pm UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371/6 "2021-08-20T14:21:06Z")

</div>

I solved it using docker-compose file by adding this field to "volumes":

```auto
volumes:
      - "es_tmpdir:/tmp/elasticsearch"
      ....

```

Thank you @warkolm and @Christian_Dahlqvist for your help!

---

<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 17, 2021, 2:21pm UTC](https://discuss.elastic.co/t/es-container-in-docker-changes-the-temp-directory-every-time-the-container-runs/281371/7 "2021-09-17T14:21:39Z")

</div>

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