ElasticSearch container without persistent volume

Hi,
I would like to have an empty container when I restart ElasticSearch container. because i use test index,

The following service persist data on disk, data remain if container starts
elasticsearch:
restart: always
image: elasticsearch:5.1.2
container_name: elastic
environment:
- ES_JAVA_OPTS=-Xms1g -Xmx1g
ports:
- 9200:9200
- 9300:9300
volumes:
- ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- "es-data:/usr/share/elasticsearch/data"

But when I remove the volume mapping , I can no longer create an index : - "es-data:/usr/share/elasticsearch/data"

So how to have an empty container when it restarts ?
regards

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