I'm running elk stack on docker swarm, and I've a problem with env variables. Here is a variable "ELASTIC_PASSWORD_FILE" inside of a container. This variable is created by "ENV ELASTIC_PASSWORD_FILE elastic" in Dockerfile.
bash-4.2$ export
declare -x ELASTIC_CONTAINER="true"
declare -x ELASTIC_PASSWORD_FILE="/run/secrets/elastic_password.txt"
I'm trying to change it's value by environment variable in docker-compose file by doing something like below:
secrets:
- source: elasticsearch_password
target: /run/secrets/elasticsearch_password.txt
mode: 0600
uid: "1000"
gid: "1000"
environment:
- LS_JAVA_OPTS=-Xmx256m -Xms256m
- ELASTIC_PASSWORD_FILE=/run/secrets/elastic_password.txt
How to inject content of a file from /run/secrets/elastic_password.txt to the environment variable?
I'm running elk 7.7.0