我在设置镜像的环境变量的时候,他的值从宿主机的环境变量来。
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
Dockerfile cannot directly use the host’s environment variables when building the image, but it can be achieved in the following ways
Dockerfile:
... ARG JAVA_HOME ENV JAVA_HOME $JAVA_HOME ...
Build using:
docker build --build-arg JAVA_HOME=$JAVA_HOME ...
http://stackoverflow.com/ques...
Dockerfile cannot directly use the host’s environment variables when building the image, but it can be achieved in the following ways
Dockerfile:
Build using:
http://stackoverflow.com/ques...