Hi
I'm new with docker and elastic, i would like to change the default password for x-pack user at the building of my image. I tried to use curl inside a dockfile but without succes :
FROM docker.elastic.co/elasticsearch/elasticsearch:5.3.0
ADD ./config/elasticsearch.yml /usr/share/elasticsearch/config/
USER root
RUN chown elasticsearch:elasticsearch config/elasticsearch.yml
USER elasticsearch
CMD curl -XPUT -m 5 -u elastic:changeme 'http://my_ip:9200/_xpack/security/user/elastic/_password' -H "Content-Type: application/json" -d '{ "password" : "myNewPwd" }
but the curl will never work because the instance of elasticsearch is not up when docker execute that command .
Any idea of how to do what i want ? :
- run contenair of docker.elastic.co/elasticsearch/elasticsearch:5.3.0
- when is up exec my curl to change the default password.
Thanx by advance