ES Index Not setting correctly

Using Docker Build I have build my custom images of base-builder. base-server, admin-tool, auto-setup
before building these images inside “docker-builds\temporal\schema\elasticsearch\visibility\cluster_setting_v7” I made change where in i didi auto creation true as below
“persistent”: {
“action.auto_create_index”: “true”
Then when i do docker-compose up with my custome auto-setup and admin-tool images
my elastic search gets started

but then i get this error:- curl: (22) The requested URL returned error: 400

Because of which my default namespace is not setting up also search attributes which means this two methods are not getting called (register_default_namespace(), add_custom_search_attributes()) (So I looked under docker-builds\ where i can figure it out that it is falling in this section:- setup_es_index() { curl --fail --user “${ES_USER}”:“${ES_PWD}” -X PUT “${TEMPLATE_URL}” -H ‘Content-Type: application/json’ --data-binary “@${SCHEMA_FILE}” --write-out “\n”

curl --user "${ES_USER}":"${ES_PWD}" -X PUT "${INDEX_URL}" --write-out "\n"} So I am getting error basically in this line particularly. where I Think for http://elasticsearch:9200/temporal_visibility_v1_dev 

url it is getting "curl: (22) The requested URL returned error: 400 "…

And when i seee on temporal-ui i get namespace not register

If i try setting namespace using tctl --namespace default namespace register from admin-tool cmd
then i get below error :-
"ListWorkflowExecutions failed: elastic: Error 400 (Bad Request): all shards failed [type=search_phase_execution_exception], root causes: No mapping found for [CloseTime] in order to sort on [type=query_shard_exception] "
And if i try adding search attribute then this error goes but my workflow which are running are not shown on the temporal-ui

And if in docker-compose i remove the elastic elasticsearch:
container_name: temporal-elasticsearch
- cluster.routing.allocation.disk.threshold_enabled=true
- cluster.routing.allocation.disk.watermark.low=512mb
- cluster.routing.allocation.disk.watermark.high=256mb
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m
image: elasticsearch:${ELASTICSEARCH_VERSION}
- temporal-network
- 9200
- 9200:9200
- /var/lib/elasticsearch/data

this part then it works.

But it Need elastic search for my application so please help regarding this.