常见 docker 构建错误及解决方案
在执行 go 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.
解决方案:
此错误表示 go 无法获取 github 用户名,因为终端提示被禁用。要解决此问题,请执行以下步骤:
export GIT_TERMINAL_PROMPT=1
以上就是Docker 容器构建时出现 "fatal: could not read Username for 'https://github.com'" 错误,如何解决?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号