【发布时间】:2021-01-27 18:35:58
【问题描述】:
我正在尝试对 Vue SPA 进行 docker 化,但是当我在 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://vuejs.org/v2/cookbook/dockerize-vuejs-app.html 的默认 Dockerfile,所以我希望它能够开箱即用
【问题讨论】:
-
这个问题是 stackoverflow.com/questions/23810845/… 的 NPM 特定版本,所以如果我的解决方案不适合你,请尝试那里的答案