The problem is that when I use Dockerfile for the image it does not accept the environment so I can not set the password of the elastic user through
- ELASTIC_PASSWORD=password
I need my script to be complete, that when running docker-compose-up it will start the container and then change the elastic password, for that I wrote a .sh, although I do not know if it is the best way, but I do not know how make .sh run after the container is running.
Can anyone help me with this? It does not necessarily have to be through the .sh I created, I just need the password to be set automatically.
But if I have it in my docker-compose.yml:
version: '2.2'
services:
elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:6.7.1
build:
context:.
dockerfile: ./Dockerfile
container_name: elasticsearch
environment:
- "ELASTIC_PASSWORD = test123"
It does not work because I should set the ELASTIC_PASSWORD in Dockerfile and not in docker-compose.
My Dockerfile only has:
FROM elasticsearch: 6.7.1
# copy some files as elasticsearch.yml
CMD ["elasticsearch"]
I can do everything work locally on my machine using only docker-compose.yml, however I need Dockerfile to send it to heroku
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.