How does Dockerfile reference host environment variables?
When I set the environment variable for the mirror, his value comes from the host environment variable.
2 Solutions collect form web for “How does Dockerfile reference host environment variables?”
Dockerfile build the mirror can not directly use the host environment variables, but can be achieved through the following ways
... ARG JAVA_HOME ENV JAVA_HOME $JAVA_HOME ...
docker build --build-arg JAVA_HOME=$JAVA_HOME ...