Passing environment variables not working with Docker

后端 未结 1 1195
暗喜
暗喜 2021-01-08 01:29

I am learning how to pass environment variables to Docker containers. While the following works fine,


Dockerfile

FROM ubuntu
E         


        
相关标签:
1条回答
  • 2021-01-08 01:45

    OK, I got it. Instead of the following,

    docker run -d enviro -e USERNAME='david'
    

    it must be like this

    docker run -d -e USERNAME='david' enviro 
    

    No idea, why docker requires the environment variable before the image's name though.

    0 讨论(0)
提交回复
热议问题