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:
For me the problem was, that my swap-partition had problems after resizing my root partition and asked me for my passphrase for almost all system tasks (like apt get commands, re-/booting, etc.).
Please enter passphrase for disk … (cryptswap1) on none
Note
Only try this, if you are seeing the error above, too, and experience the problem described in the question when you try to execute npm install inside a docker container:
Error: getaddrinfo ENOTFOUND/EAI_AGAIN registry.npmjs.org registry.npmjs.org:443
The Solution
Edit /etc/crypttab and replace UUID=**** to get the following pattern:
cryptswap1 /dev/SWAP_PARTITION/ /dev/urandom swap,**,cipher=****
Reboot, if you are still asked for your passphrase, continue:
sudo dd if=/dev/zero of=/dev/SWAP_PARTITION/ bs=512 count=20480 and reboot. This fixed it for me.source