Is there an alternative to Ener Dockerfile instructions?

On its official website ( https://docs.docker.com/reference/builder/#env ), Docker support claims that:

The ENV command sets the environment variable to a value. This value will be passed to all future RUN instructions. This is functionally equivalent to a prefix command with <key> = <value>

I tried:

http_proxy=<PROXY> docker build .

However, this does not seem to bring the same effect as adding ENV http_proxy = <PROXY> inside the Docker file. Why???

+4
source share
1 answer

This is functionally equivalent to the command prefix with <key> = <value>

, , docker build, .

, ENV , .

, RUN :

RUN http_proxy=<PROXY> curl https://www.google.com

, ( ):

$ http_proxy=<PROXY> curl https://www.google.com
+2

All Articles