go执行docker build时遇到的问题?

作者站长头像
站长
· 阅读数 9

各位大佬们,当我在构建docker容器的时候意外遇到了这个错误,想问问各位如何解决其中docker报错

answer imports
        github.com/answerdev/answer-basic-connector: module github.com/answerdev/answer-basic-connector: git ls-remote -q origin in /go/pkg/mod/cache/vcs/2eb01f4aadbb28882970063faa18a6e807b04bd4da767dddd04d856f1fa4e95b: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
回复
1个回答
avatar
test
2024-06-25

增加git环境变量

export GIT_TERMINAL_PROMPT=1

再次执行go build 会提示输入git仓库输入登录密码验证,即可。

回复
likes
适合作为回答的
  • 经过验证的有效解决办法
  • 自己的经验指引,对解决问题有帮助
  • 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
  • 询问内容细节或回复楼层
  • 与题目无关的内容
  • “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容