docker npm install Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443

前端 未结 7 1368
Happy的楠姐
Happy的楠姐 2020-12-16 23:48

I\'m using docker version 1.10.1 on RHEL 7 and getting npm install error when using below Dockerfile. The Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:

7条回答
  •  北海茫月
    2020-12-17 00:18

    I tried everything above and nothing worked for me. A curiosity dockerd systemd script didn't start when adding the --dns parameter.

    In my case the problem was that in ubuntu /etc/resolv.conf is generated automatically by systemd-resolved and points to a local ip 127.0.0.53, where a cache DNS is running, is crazy but with this information the containers where trying to resolve DNS with themselves in its loopack interface. Changing resolv.conf manually to our company DNS in the LAN fixed the issue, then modified systemd-resolved to do it permanently.

提交回复
热议问题