6

I am deploying some node.js services to a corporate system within docker containers. My Dockerfiles for these services are very basic, with the exception that I am setting the proxy environment variables:

FROM node:4.2.3

ADD . /src

WORKDIR /src

ENV http_proxy http://proxy.gc.corp.com:8888/  
ENV https_proxy http://proxy.gc.corp.com:8888/  
ENV HTTP_PROXY http://proxy.gc.corp.com:8888/  
ENV HTTPS_PROXY http://proxy.gc.corp.com:8888/  


RUN npm install --production

EXPOSE 3000

CMD npm start >> /log/eva_web_api

When I build my image from this file I receive the following error from NPM:

error on last attempt: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND proxy.gc.corp.com proxy.gc.corp.com:8888

However when I perform the NPM install on the host machine (which has Node.js installed as well as Docker), the NPM install performs as normally and completes with no issue. One the host I have those same ENV variables set as I define in my Dockerfile.

Anyone have any ideas as to what is going on here, I have a ticket open with my networking team in charge of the proxy but they are yet to be any help.

Collin Estes
  • 5,577
  • 7
  • 51
  • 71
  • 1
    Your container can't resolve proxy.gc.corp.com via dns. Can you resolve any addresses in a running container? – Matt Feb 13 '16 at 02:28
  • No I can't, you are right. Why is it different from within the docker container than the same http calls being performed on the host? They are both Ubunutu 14.04 OSs, I'm guessing the docker container I.P. or something. – Collin Estes Feb 13 '16 at 13:03
  • Hard to say, should normally work. What version of docker? What does your containers `/etc/resolv.conf` say? Can you ping anything external from your container? – Matt Feb 13 '16 at 13:05

1 Answers1

0

It was DNS related found my solution here:

Docker - Network calls fail during image build on corporate network

TLDR; gotta config the DOCKER_OPTS with my DNS IP.

Community
  • 1
  • 1
Collin Estes
  • 5,577
  • 7
  • 51
  • 71