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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.