# Primary Indexes are lost for Aerospike container after it is relaunched

**URL:** <https://discuss.aerospike.com/t/primary-indexes-are-lost-for-aerospike-container-after-it-is-relaunched/7764>\
**Category:** Containers (Docker, etc.)\
**Created:** [August 18, 2020, 9:28pm UTC](https://discuss.aerospike.com/t/primary-indexes-are-lost-for-aerospike-container-after-it-is-relaunched/7764 "2020-08-18T21:28:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pks](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@pks](https://discuss.aerospike.com/u/pks)\
**Post date:** [August 18, 2020, 9:28pm UTC](https://discuss.aerospike.com/t/primary-indexes-are-lost-for-aerospike-container-after-it-is-relaunched/7764/1 "2020-08-18T21:28:26Z")

</div>

Hi, I am running an Aerospike container in “In-Memory with Persistence” mode with following command:

docker run -d -e “REPL\_FACTOR=1” -v :/opt/aerospike/etc -v /opt/aerospike/data:/opt/aerospike/data --name aerospike -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3003:3003 aerospike/aerospike-server

I can see a .dat file being created under /opt/aerospike/data/ as expected. I create some data and primary indexes using aql and then stop and remove the container

docker stop aerospike docker rm aerospike

Now when I start a new container again with the docker run command exactly same as the first one above, I see that the data gets restored back but not the indexes.

Why is that? If it can restore data correctly why can it not rebuild the primary indexes? Is there some config I am missing? Thank you!

---

_[View the full topic](https://discuss.aerospike.com/t/primary-indexes-are-lost-for-aerospike-container-after-it-is-relaunched/7764)._
