伊谢尔伦2017-04-24 16:03:05
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 ...