我在运行sudo docker-compose build时收到错误消息
在我的Dockerfile中,它正在运行:
RUN npm install
错误消息显示:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t https://git.mycompany.com/path_public/speakeasy.git
npm ERR!
npm ERR! remote: HTTP Basic: Access denied
npm ERR! fatal: Authentication failed for 'https://git.mycompany.com/path_public/speakeasy.git/'
npm ERR!
npm ERR! exited with error code: 128我不明白为什么运行npm install需要git证书。
我尝试用docker cp将我的本地git凭证复制到docker容器,但不起作用。
发布于 2021-02-04 08:18:07
出现此错误的原因是,您正在尝试从专用注册表安装库,但尚未登录。
让你的git仓库记住你的登录: (15分钟)
运行git config --global credential.helper cache
2.复制并粘贴上面显示的命令,在本例中为:
/usr/bin/git ls-remote -h -t https://git.mycompany.com/path_public/speakeasy.git
这将要求您提供凭据。如果您使用双因素身份验证,则必须输入您的用户名和访问令牌,否则请输入您的密码。
https://stackoverflow.com/questions/65431154
复制相似问题