{"id":206702,"date":"2025-06-12T13:55:55","date_gmt":"2025-06-12T05:55:55","guid":{"rendered":"https:\/\/server.hk\/cnblog\/206702\/"},"modified":"2025-06-12T13:55:55","modified_gmt":"2025-06-12T05:55:55","slug":"docker-build-%e9%81%87%e5%88%b0-fatal-could-not-read-username-%e9%94%99%e8%af%af%e8%af%a5%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/206702\/","title":{"rendered":"Docker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p>\u4eb2\u7231\u7684\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5982\u679c\u4f60\u70b9\u5f00\u4e86\u8fd9\u7bc7\u6587\u7ae0\uff0c\u8bf4\u660e\u4f60\u5bf9\u300aDocker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u5f88\u611f\u5174\u8da3\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u7ed9\u5927\u5bb6\u8be6\u7ec6\u89e3\u6790\u4e00\u4e0b\uff0c\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u6240\u6709\u8ba4\u771f\u8bfb\u5b8c\u7684\u7ae5\u978b\u4eec\uff0c\u90fd\u6709\u5b9e\u8d28\u6027\u7684\u63d0\u9ad8\u3002,<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732063009673d2f214c718.jpg\" class=\"aligncenter\">,<br \/>\n<strong>go\u6267\u884cdocker build\u65f6\u906d\u9047\u7684\u56f0\u6270<\/strong>,\u5728\u8fdb\u884cdocker\u5bb9\u5668\u6784\u5efa\u65f6\uff0c\u65b0\u624b\u5f80\u5f80\u4f1a\u9047\u5230\u4e00\u4e9b\u68d8\u624b\u7684\u95ee\u9898\u3002\u5c31\u6bd4\u5982\u4e0b\u9762\u7684\u62a5\u9519\uff1a,\u8fd9\u79cd\u95ee\u9898\u5f80\u5f80\u662f\u7531\u4e8egit\u73af\u5883\u53d8\u91cf\u6ca1\u6709\u8bbe\u7f6e\u5bfc\u81f4\u7684\u3002\u89e3\u51b3\u529e\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u6dfb\u52a0\u4ee5\u4e0b\u73af\u5883\u53d8\u91cf\u5373\u53ef\uff1a,\u6dfb\u52a0\u73af\u5883\u53d8\u91cf\u540e\uff0c\u518d\u6b21\u6267\u884cgo build\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u8f93\u5165git\u4ed3\u5e93\u7684\u767b\u5f55\u5bc6\u7801\uff0c\u9a8c\u8bc1\u901a\u8fc7\u540e\u5373\u53ef\u6b63\u5e38\u6784\u5efadocker\u5bb9\u5668\u3002,\u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300aDocker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~GOLANG\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03GOLANG\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01,go\u6267\u884cdocker build\u65f6\u906d\u9047\u7684\u56f0\u6270,\u4eb2\u7231\u7684\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5982\u679c\u4f60\u70b9\u5f00\u4e86\u8fd9\u7bc7\u6587\u7ae0\uff0c\u8bf4\u660e\u4f60\u5bf9\u300aDocker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u5f88\u611f\u5174\u8da3\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u7ed9\u5927\u5bb6\u8be6\u7ec6\u89e3\u6790\u4e00\u4e0b\uff0c\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u6240\u6709\u8ba4\u771f\u8bfb\u5b8c\u7684\u7ae5\u978b\u4eec\uff0c\u90fd\u6709\u5b9e\u8d28\u6027\u7684\u63d0\u9ad8\u3002,<br \/>\n<b><\/b> <\/p>\n<p>\u5f53\u524d\u4f4d\u7f6e\uff1a <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span>  <span>&gt;<\/span> <span>Docker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/span><\/p>\n<h1>Docker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/h1>\n<p><span>2024-11-20 08:37:05<\/span><br \/>\n<span><i><\/i>0\u6d4f\u89c8<\/span><br \/>\n<span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span> <\/p>\n<p>\u4eb2\u7231\u7684\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5982\u679c\u4f60\u70b9\u5f00\u4e86\u8fd9\u7bc7\u6587\u7ae0\uff0c\u8bf4\u660e\u4f60\u5bf9\u300aDocker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u5f88\u611f\u5174\u8da3\u3002\u672c\u7bc7\u6587\u7ae0\u5c31\u6765\u7ed9\u5927\u5bb6\u8be6\u7ec6\u89e3\u6790\u4e00\u4e0b\uff0c\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5e0c\u671b\u6240\u6709\u8ba4\u771f\u8bfb\u5b8c\u7684\u7ae5\u978b\u4eec\uff0c\u90fd\u6709\u5b9e\u8d28\u6027\u7684\u63d0\u9ad8\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732063009673d2f214c718.jpg\" class=\"aligncenter\"><\/p>\n<p><strong>go\u6267\u884cdocker build\u65f6\u906d\u9047\u7684\u56f0\u6270<\/strong><\/p>\n<p>\u5728\u8fdb\u884cdocker\u5bb9\u5668\u6784\u5efa\u65f6\uff0c\u65b0\u624b\u5f80\u5f80\u4f1a\u9047\u5230\u4e00\u4e9b\u68d8\u624b\u7684\u95ee\u9898\u3002\u5c31\u6bd4\u5982\u4e0b\u9762\u7684\u62a5\u9519\uff1a<\/p>\n<pre>answer imports\ngithub.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:\n        fatal: could not read username for 'https:\/\/github.com': terminal prompts disabled\nconfirm the import path was entered correctly.\nif this is a private repository, see https:\/\/golang.org\/doc\/faq#git_https for additional information.<\/pre>\n<p>\u8fd9\u79cd\u95ee\u9898\u5f80\u5f80\u662f\u7531\u4e8egit\u73af\u5883\u53d8\u91cf\u6ca1\u6709\u8bbe\u7f6e\u5bfc\u81f4\u7684\u3002\u89e3\u51b3\u529e\u6cd5\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u6dfb\u52a0\u4ee5\u4e0b\u73af\u5883\u53d8\u91cf\u5373\u53ef\uff1a<\/p>\n<pre>export GIT_TERMINAL_PROMPT=1<\/pre>\n<p>\u6dfb\u52a0\u73af\u5883\u53d8\u91cf\u540e\uff0c\u518d\u6b21\u6267\u884cgo build\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u8f93\u5165git\u4ed3\u5e93\u7684\u767b\u5f55\u5bc6\u7801\uff0c\u9a8c\u8bc1\u901a\u8fc7\u540e\u5373\u53ef\u6b63\u5e38\u6784\u5efadocker\u5bb9\u5668\u3002<\/p>\n<p>\u7ec8\u4e8e\u4ecb\u7ecd\u5b8c\u5566\uff01\u5c0f\u4f19\u4f34\u4eec\uff0c\u8fd9\u7bc7\u5173\u4e8e\u300aDocker Build \u9047\u5230 &#8220;fatal: could not read Username&#8221; \u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f\u300b\u7684\u4ecb\u7ecd\u5e94\u8be5\u8ba9\u4f60\u6536\u83b7\u591a\u591a\u4e86\u5427\uff01\u6b22\u8fce\u5927\u5bb6\u6536\u85cf\u6216\u5206\u4eab\u7ed9\u66f4\u591a\u9700\u8981\u5b66\u4e60\u7684\u670b\u53cb\u5427~GOLANG\u516c\u4f17\u53f7\u4e5f\u4f1a\u53d1\u5e03GOLANG\u76f8\u5173\u77e5\u8bc6\uff0c\u5feb\u6765\u5173\u6ce8\u5427\uff01<\/p>\n<dl>\n<dt>\n <\/dt>\n<dd>\n   \u5982\u4f55\u6b63\u786e\u8fde\u63a5\u7535\u8111\u5230WiFi\u7f51\u7edc\n <\/dd>\n<\/dl>\n<dl>\n<dt>\n <\/dt>\n<dd>\n   \u5982\u4f55\u4f7f\u7528 Python \u6279\u91cf\u4fee\u6539 JSON \u6587\u4ef6\u4e2d\u7684\u6307\u5b9a\u5185\u5bb9\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u4eb2\u7231\u7684\u7f16\u7a0b\u5b66\u4e60\u7231\u597d\u8005\uff0c\u5982\u679c\u4f60\u70b9\u5f00&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-206702","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/206702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=206702"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/206702\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=206702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=206702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=206702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}