go 执行 docker build 报错
在构建 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.
解决方案:
要解决此问题,请增加 git 环境变量:
export GIT_TERMINAL_PROMPT=1
再次执行 go build,系统将提示你输入 git 仓库的登录密码以进行验证。输入密码后,构建过程即可正常进行。
以上就是Go 执行 Docker Build 报错:如何解决 git ls-remote 错误?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号