+-
我在RHEL 7上使用docker版本1.10.1并在使用Dockerfile下面时获取npm install错误.错误:getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443.与ubuntu 14.04上的docker 1.91相同的工作.当我得到bash并在容器上安装inetutils-ping时,我注意到我无法ping任何地方
root@9deb4b274c1e:/home/nodexp#ping 8.8.8.8 PING 8.8.8.8 (8.8.8.8): 56 data bytes ^C--- 8.8.8.8 ping statistics --- 4 packets transmitted, 0 packets received, 100% packet loss
这是为什么 ?当然我可以从RHEL ping
Dockerfile
FROM node:argon # Create user nodexp in group nodexp RUN groupadd -r nodexp \ && useradd -m -r -g nodexp nodexp WORKDIR /home/nodexp # Install app dependencies COPY package.json /home/nodexp RUN npm install # Bundle app source COPY . /home/nodexp EXPOSE 3000 CMD [ "npm", "start" ]和package.json
{ "name": "mp", "version": "0.0.0", "private": true, "scripts": { "start": "node app.js" }, "dependencies": { "express": "~4.13.1" } }
最佳答案
使用此命令重新启动docker会为我修复它,但我不知道为什么
sudo服务码头重启
点击查看更多相关文章
转载注明原文:node.js – docker npm install错误:getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 - 乐贴网