title: Docker at Windows 10 proxy propagation to containers not working
body: <p>I am behind cooperate proxy and running docker on windows 10. I have setup the proxy on docker as per the <a href="https://docs.docker.com/docker-for-windows/#proxies" rel="noreferrer">documentation here</a>. </p>
  
  <p><a href="https://i.stack.imgur.com/unVmQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/unVmQ.png" alt="my docker proxy settings"></a></p>
  
  <p>I am able to pull images but these proxy settings are not propagating to containers e.g. when I run alpine env, it does not show proxy conf. Below is my output</p>
  
  <pre><code>λ docker run alpine env                                          
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    HOSTNAME=14fca5bee12f                                            
    HOME=/root                                                       
  </code></pre>
  
  <p>Following is the expected output as per the documentation.</p>
  
  <p><a href="https://i.stack.imgur.com/vB6BO.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vB6BO.png" alt="exptected output"></a></p>
  
  <p>On building following docker file, I get connection errors from alpine container</p>
  
  <p><strong>Docker Version</strong></p>
  
  <pre><code>Docker version 17.12.0-ce, build c97c6d6
  </code></pre>
  
  <p><strong>DockerFile</strong></p>
  
  <pre><code>FROM alpine:latest
  ADD HelloWorld.class HelloWorld.class
  RUN apk --update add openjdk8-jre
  ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "HelloWorld"]
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code>Step 3/4 : RUN apk --update add openjdk8-jre                                                                      
   ---&gt; Running in 1205b24d5044                                                                                     
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz                                       
  ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/main: could not connect to server (check repositories file)      
  WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file or directory                                             
  fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz                                  
  ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/community: could not connect to server (check repositories file) 
  WARNING: Ignoring APKINDEX.5022a8a2.tar.gz: No such file or directory                                             
  ERROR: unsatisfiable constraints:                                                                                 
    openjdk8-jre (missing):                                                                                         
      required by: world[openjdk8-jre]                                                                              
  The command '/bin/sh -c apk --update add openjdk8-jre' returned a non-zero code: 1                                
  </code></pre>
  
  <p><strong>Passing Proxy as build-arg</strong></p>
  
  <p>I tried the following command and it worked. Is there any other way to automatically propagate the proxy settings as mentioned in documentation (see link above)</p>
  
  <pre><code>docker build --tag "docker-hello-world:latest" . --build-arg http_proxy=http://&lt;username&gt;:&lt;password&gt;@proxy_address:proxy_port/ --build-arg https_proxy=http://&lt;username&gt;:&lt;password&gt;@proxy_address:proxy_port/ --build-arg no_proxy=localhost,127.0.0.1
  </code></pre>