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.

4

1 に答える 1

0

ここで私の解決策を見つけたのはDNS関連でした:

Docker - 企業ネットワークでのイメージのビルド中にネットワーク呼び出しが失敗する

TLDR; 私のDNS IPでDOCKER_OPTSを設定する必要があります。

于 2016-02-16T21:54:12.623 に答える