Docker: Set value of ENV variable using RUN comman

2019-06-24 17:41发布

I'm writing a Dockerfile to set up my customized WordPress environment. I'm starting with ubuntu:latest and would like to add some repositories dynamically, by setting an ENV variable to the codename of the current Ubuntu version. How can I do this, or is there a better way to achieve this?

标签: ubuntu docker
1条回答
放荡不羁爱自由
2楼-- · 2019-06-24 18:28

Start your container like this: docker run -e VAR=value -e ANOTHER_VAR=another_value .... VAR and ANOTHER_VAR will be available in the container's environment.

查看更多
登录 后发表回答