How to use environment variables in docker compose

后端 未结 13 759
孤街浪徒
孤街浪徒 2020-11-28 01:02

I would like to be able to use env variables inside docker-compose.yml, with values passed in at the time of docker-compose up. This is the example.

I am

13条回答
  •  长情又很酷
    2020-11-28 01:28

    You cannot ... yet. But this is an alternative, think like a docker-composer.yml generator:

    https://gist.github.com/Vad1mo/9ab63f28239515d4dafd

    Basically a shell script that will replace your variables. Also you can use Grunt task to build your docker compose file at the end of your CI process.

提交回复
热议问题