# DNS Problem, probably related to proxy?

**URL:** <https://forums.docker.com/t/dns-problem-probably-related-to-proxy/3935>\
**Category:** General\
**Created:** [October 20, 2015, 7:08am UTC](https://forums.docker.com/t/dns-problem-probably-related-to-proxy/3935 "2015-10-20T07:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iiptyf](https://avatars.discourse-cdn.com/v4/letter/i/9e8a1a/32.png) [@iiptyf](https://forums.docker.com/u/iiptyf)\
**Post date:** [October 20, 2015, 7:08am UTC](https://forums.docker.com/t/dns-problem-probably-related-to-proxy/3935/1 "2015-10-20T07:08:46Z")

</div>

Hi, I’m trying to create an image using a dockerfile, which failes. I guess it’s because of my proxy settings. Using DockerToolbox-1.8.2c.

“FROM java:8-jdk  
RUN apt-get update && apt-get install -y curl unzip zip inotify-tools”

I can pull images from docker hub, I achieved this by setting http\_proxy, https\_proxy, no\_proxy, docker\_tls and ntp\_server in “/var/lib/boot2docker/profile”. I had to use the ip of the proxy. And now, the same problem happens with apt-get. The code above fails with

"W: Failed to fetch [http://httpredir.debian.org/debian/dists/jessie-updates/Release.gpg](http://httpredir.debian.org/debian/dists/jessie-updates/Release.gpg) Cannot initiate the connection to [httpredir.debian.org:80](http://httpredir.debian.org:80) (2001:41c8:1000:21::21:35). - connect (101: Network is unreachable) [IP: 2001:41c8:1000:21::21:35 80]“  
and other errors. Also  
"E: Package ‘zip’ has no installation candidate  
E: Unable to locate package inotify-tools”.  
So I could try again the use the IPs of the servers, but this seems like the wrong solution. In /etc/resolv.conf are my namerservers of the host already entered.

Anyone got better ideas?  
I could also try to preload the packages and add them as static resource, as a workaround. Still not the way to go.  
I’m at home now and disabled the vpn, so I can use the internet without a proxy. Still no luck

---

<div class="post-metadata">

**Author:** ![programmerq](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/programmerq/32/208_2.png) [@programmerq](https://forums.docker.com/u/programmerq)\
**Post date:** [October 21, 2015, 4:22pm UTC](https://forums.docker.com/t/dns-problem-probably-related-to-proxy/3935/2 "2015-10-21T16:22:28Z")

</div>

/var/lib/boot2docker/profile only affects processes running directly on the boot2docker host. Containers are still have their own isolated environment.

The quick fix for getting your container to build inside a network with a proxy is to simply set HTTP\_PROXY, HTTPS\_PROXY, and NO\_PROXY inside the Dockerfile using the ENV directive.

Cheers!

---

<div class="post-metadata">

**Author:** ![iiptyf](https://avatars.discourse-cdn.com/v4/letter/i/9e8a1a/32.png) [@iiptyf](https://forums.docker.com/u/iiptyf)\
**Post date:** [October 26, 2015, 8:48am UTC](https://forums.docker.com/t/dns-problem-probably-related-to-proxy/3935/3 "2015-10-26T08:48:49Z")

</div>

Thank you for your answer, I posted a follow up here: [Docker commands from windows with proxy](https://forums.docker.com/t/docker-commands-from-windows-with-proxy/4039) to clear out all problems, where this is just one of them.
