Docker-compose environment variables

前端 未结 7 896
滥情空心
滥情空心 2021-02-01 13:44

I am trying to setup a postgres container and want to setup the postgres login with:

POSTGRES_USER: docker
POSTGRES_PASSWORD: docker

So I have

7条回答
  •  面向向阳花
    2021-02-01 14:19

    I had a similar situation. Following the answer from @Greg, I did a docker-compose up, and it picked up the environment variable.

    Prior to that, I had just been using docker-compose run and it wasn't picking up the environment variable as proven by running docker-compose exec task env. Strangely, docker-compose run task env showed the environment variable I was expecting.

提交回复
热议问题