- The
ARGinstruction defines a variable that users can pass at build-time to the builder with the docker build command using the--build-arg <varname>=<value>flag.ARG指令定义了用户可以在编译时或者运行时传递的变量,如使用如下命令:--build-arg <varname>=<value> - The
ENVinstruction sets the environment variable<key>to the value<value>. The environment variables set usingENVwill persist when a container is run from the resulting image.ENV指令是在dockerfile里面设置环境变量,不能在编译时或运行时传递。
You can then either build an image with a specificARG var ENV var=${var}
var value at build-time (docker build --build-arg var=xxx), or run a container with a specific runtime value (docker run -e var=yyy) 欢迎关注橙子博客微信公众号:chengziboke888 
查看原文:http://zccbbg.top/2017/06/19/dockerfile-%e4%b8%ad-arg%e4%b8%8eenv%e7%9a%84%e5%8c%ba%e5%88%ab/
版权声明:本文为qq_27575627原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。