ElasticSearch(8.15.0) Docker setup, ENV not able to reset built in user-elastic's password

Perhaps try an .env file and reference the password:

.env file:

ELASTIC_PASSWORD=elastic123

Dockerfile:

...
ENV ELASTIC_PASSWORD=$ELASTIC_PASSWORD
...

This is lifted from what I found here.