Docker echo environment variable

前端 未结 3 1293
刺人心
刺人心 2021-02-19 13:56

I\'m trying to write a little docker file that sets a User and just echos the current user as a little example to prove to myself it is working. I\'ve tried a number of variants

3条回答
  •  既然无缘
    2021-02-19 14:00

    Couldn't you set, in the Dockerfile, the ENV command to a default value, and then, when run-ning a container, use the -e, --env dictionary to override what would be interpreted by the:

    ENTRYPOINT echo $SOMEENVVAR
    

    form of ENTRYPOINT?

提交回复
热议问题