Docker documentation says we need to use something like the below one, for passing a file env.list which has several environment variables in it. How can we pass more than one environment file, say env.list and newenv.list
$ docker run --env-file ./env.list ubuntu bash
You can try volume mounting the env.list
& newenv.list
from the host into the container and sourcing it.
Reference Link:
http://stackoverflow.com/questions/27583057/workaround-to-docker-run-env-file-supplied-file-not-being-evaluated-as-expec
Yes, but i was just wondering how can i point to two env-files, say /var/app/old/file.conf and /var/market/old/db.conf , both in the command line as I find there is support for mutiple -e flags. Does Docker supports pointing to multiple env-file in a command line
docker run -d --hostname=158.64.72.80 -d -p 80:80 --env-file /var/app/old/file.conf --env-file /var/market/old/db.conf
For anyone who comes after, yes this is possible:
docker run -it --rm -v ${PWD}:/usr/src/app --env-file .env/development/database --env-file .env/development/web
This topic was automatically closed after 12 days. New replies are no longer allowed.