docker使用Dockerfile中的淘宝镜像源打包报错

执行RUN npm install --registry https://registry.npm.taobao.org

报错

 > [build-stage 5/6] RUN npm install --registry https://registry.npm.taobao.org:
6.230 npm ERR! code CERT_HAS_EXPIRED
6.231 npm ERR! errno CERT_HAS_EXPIRED
6.241 npm ERR! request to https://registry.npm.taobao.org/vue-loader failed, reason: certificate has expired
6.274
6.274 npm ERR! A complete log of this run can be found in:
6.274 npm ERR!     /root/.npm/_logs/2024-01-31T06_17_26_469Z-debug.log
------
Dockerfile:8
--------------------
   6 |     # 根据设置,替换favicon
   7 |     RUN chmod +x change_favicon.sh && sh change_favicon.sh -m $MODE
   8 | >>> RUN npm install --registry https://registry.npm.taobao.org
   9 |     RUN npm run build -- --mode $MODE
  10 |
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install --registry https://registry.npm.taobao.org" did not complete successfully: exit code: 1

发现那个镜像源过期了,换成下边这个重新打包可以了
RUN npm install --registry https://registry.npmmirror.com

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容