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:
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.