zadig npm install 报奇怪的网络问题。

dockerfile:
FROM node:16.19.1 as builder
WORKDIR /build
COPY . .
RUN npm install

在linux主机上docker build 正常,但放到zadig上构建就报错:
#10 601.9 npm notice
#10 601.9 npm notice New major version of npm available! 8.19.3 → 9.8.0
#10 601.9 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.8.0
#10 601.9 npm notice Run npm install -g npm@9.8.0 to update!
#10 601.9 npm notice
#10 601.9 npm ERR! code ERR_SOCKET_TIMEOUT
#10 601.9 npm ERR! errno ERR_SOCKET_TIMEOUT
#10 601.9 npm ERR! network request to https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz failed, reason: Socket timeout
#10 601.9 npm ERR! network This is a problem related to network connectivity.
#10 601.9 npm ERR! network In most cases you are behind a proxy or have bad network settings.
#10 601.9 npm ERR! network
#10 601.9 npm ERR! network If you are behind a proxy, please make sure that the
#10 601.9 npm ERR! network ‘proxy’ config is set properly. See: ‘npm help config’
#10 601.9
#10 601.9 npm ERR! A complete log of this run can be found in:
#10 601.9 npm ERR! /root/.npm/_logs/2023-07-17T10_20_10_965Z-debug-0.log

经过实际测试,上面报错的 yocto-queue-0.1.0.tgz 文件url,是能够正常下载的,包括进入zadig创建的构建job的容器上,也是能够正常下载。

这说明 Zadig 执行 npm install 是没问题的,也许是网络偶尔异常,可以多尝试几次,或者求助下公司负责网络的小伙伴儿

估计是k8s集群网络的问题,重试多次都是一个结果。
在linux主机上,抓包显示都是正常的,在k8s集群上抓包则各种重传。
不使用docker多段构建,直接使用zadig的脚本构建,则出现的概率非常低。