# Creating and loading index after Elasticsearch docker container bootstrap

**URL:** <https://discuss.elastic.co/t/creating-and-loading-index-after-elasticsearch-docker-container-bootstrap/231848>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [May 9, 2020, 3:02pm UTC](https://discuss.elastic.co/t/creating-and-loading-index-after-elasticsearch-docker-container-bootstrap/231848 "2020-05-09T15:02:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shekharshan](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@shekharshan](https://discuss.elastic.co/u/shekharshan)\
**Post date:** [May 9, 2020, 3:02pm UTC](https://discuss.elastic.co/t/creating-and-loading-index-after-elasticsearch-docker-container-bootstrap/231848/1 "2020-05-09T15:02:26Z")

</div>

I am doing some development for which I am using Elasticsearch 6.7 in a docker container. Every time my container starts up I have to use 'curl' commands to create the index and then index the data stored in my json file. I would like this to happen automatically as part of container bootstrap. I have copied the Json data file and Json index mapping file into `/usr/share/elasticsearch/` directory and I know that `/usr/local/bin/docker-entrypoint.sh` gets executed as part of docker startup command. Do I need to add `curl` calls into this entrypoint shell script or is there an elasticsearch command line tool that I can invoke to create index, upload the mappings, and index the data? For some reason `curl` is not working if I add it as last steps of entrypoint shell script.

---

<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:** [May 18, 2020, 2:40am UTC](https://discuss.elastic.co/t/creating-and-loading-index-after-elasticsearch-docker-container-bootstrap/231848/2 "2020-05-18T02:40:16Z")

</div>

> [@shekharshan](#):
>
> Do I need to add `curl` calls into this entrypoint shell script

Yes, there's no way for Elasticsearch to load things from file like that.

---

<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:** [June 15, 2020, 2:40am UTC](https://discuss.elastic.co/t/creating-and-loading-index-after-elasticsearch-docker-container-bootstrap/231848/3 "2020-06-15T02:40:24Z")

</div>

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