![](/img/trans.png)
[英]Jenkins,Docker,Kubernetes,AWS EKS: RUN npm install either hangs or produces EAI_AGAIN
[英]EAI_AGAIN when running npm install in Docker container
我正在嘗試對接 Vue SPA,但是當我在docker build.
# install simple http server for serving static content
RUN npm install -g http-server
幾秒鍾后我得到以下信息:
Step 2/9 : RUN npm install -g http-server
---> Running in e30d7aa11a71
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/http-server failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-27T18_15_59_366Z-debug.log
我正在使用來自https://v2.vuejs.org/v2/cookbook/dockerize-vuejs-app.ZFC35FDC70D5FC69D269883A822C7A5的默認 Dockerfile
使用docker run build. --network=host
docker run build. --network=host
為我解決了這個問題。
我得到的錯誤是由 Docker 無法訪問 Internet 引起的,所以用勺子喂它“嘿,只使用主機”似乎已經解決了這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.