{"id":13607,"date":"2024-11-15T19:53:56","date_gmt":"2024-11-15T11:53:56","guid":{"rendered":"https:\/\/fwq.ai\/blog\/13607\/"},"modified":"2024-11-15T19:53:56","modified_gmt":"2024-11-15T11:53:56","slug":"docker%e6%95%85%e9%9a%9c%e7%a0%81%e5%92%8c%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95-error-network-not-found-create-network-first","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/13607\/","title":{"rendered":"Docker\u6545\u969c\u7801\u548c\u89e3\u51b3\u529e\u6cd5 &#8211; Error: network not found, create network first"},"content":{"rendered":"<h1 id=\"docker%e6%95%85%e9%9a%9c%e7%a0%81%e5%92%8c%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95-error-network-not-found-create-network-first-pLTdsFdwKk\">Docker\u6545\u969c\u7801\u548c\u89e3\u51b3\u529e\u6cd5 &#8211; Error: network not found, create network first<\/h1>\n<p>\u5728\u4f7f\u7528Docker\u8fdb\u884c\u5bb9\u5668\u5316\u5e94\u7528\u7ba1\u7406\u65f6\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u6545\u969c\u7801\uff0c\u5176\u4e2d\u4e4b\u4e00\u5c31\u662f\u201cError: network not found, create network first\u201d\u3002\u8fd9\u4e2a\u9519\u8bef\u901a\u5e38\u51fa\u73b0\u5728\u7528\u6237\u5c1d\u8bd5\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668\u5e76\u6307\u5b9a\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u7f51\u7edc\u65f6\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u53ca\u5176\u89e3\u51b3\u529e\u6cd5\u3002<\/p>\n<h2 id=\"%e4%bb%80%e4%b9%88%e6%98%afdocker%e7%bd%91%e7%bb%9c%ef%bc%9f-pLTdsFdwKk\">\u4ec0\u4e48\u662fDocker\u7f51\u7edc\uff1f<\/h2>\n<p>Docker\u7f51\u7edc\u662fDocker\u5bb9\u5668\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u7684\u57fa\u7840\u8bbe\u65bd\u3002Docker\u63d0\u4f9b\u4e86\u591a\u79cd\u7f51\u7edc\u9a71\u52a8\u7a0b\u5e8f\uff0c\u5982bridge\u3001host\u548coverlay\u7b49\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u7f51\u7edc\u7c7b\u578b\u3002\u6bcf\u4e2aDocker\u7f51\u7edc\u90fd\u6709\u5176\u72ec\u7279\u7684\u7279\u6027\u548c\u7528\u9014\uff0c\u7406\u89e3\u8fd9\u4e9b\u7f51\u7edc\u7684\u5de5\u4f5c\u539f\u7406\u5bf9\u4e8e\u6709\u6548\u7ba1\u7406Docker\u5bb9\u5668\u81f3\u5173\u91cd\u8981\u3002<\/p>\n<h2 id=\"%e9%94%99%e8%af%af%e5%8e%9f%e5%9b%a0%e5%88%86%e6%9e%90-pLTdsFdwKk\">\u9519\u8bef\u539f\u56e0\u5206\u6790<\/h2>\n<p>\u5f53\u4f60\u5728Docker\u4e2d\u9047\u5230\u201cError: network not found, create network first\u201d\u9519\u8bef\u65f6\uff0c\u901a\u5e38\u662f\u56e0\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u539f\u56e0\uff1a<\/p>\n<ul>\n<li><strong>\u7f51\u7edc\u672a\u521b\u5efa\uff1a<\/strong>\u4f60\u5c1d\u8bd5\u4f7f\u7528\u7684\u7f51\u7edc\u5c1a\u672a\u88ab\u521b\u5efa\u3002Docker\u4e0d\u4f1a\u81ea\u52a8\u521b\u5efa\u7f51\u7edc\uff0c\u7528\u6237\u9700\u8981\u624b\u52a8\u521b\u5efa\u3002<\/li>\n<li><strong>\u7f51\u7edc\u540d\u79f0\u62fc\u5199\u9519\u8bef\uff1a<\/strong>\u5728\u547d\u4ee4\u4e2d\u6307\u5b9a\u7684\u7f51\u7edc\u540d\u79f0\u53ef\u80fd\u5b58\u5728\u62fc\u5199\u9519\u8bef\uff0c\u5bfc\u81f4Docker\u65e0\u6cd5\u627e\u5230\u8be5\u7f51\u7edc\u3002<\/li>\n<li><strong>\u7f51\u7edc\u5df2\u88ab\u5220\u9664\uff1a<\/strong>\u5982\u679c\u7f51\u7edc\u5728\u4e4b\u524d\u7684\u64cd\u4f5c\u4e2d\u88ab\u5220\u9664\uff0c\u5c1d\u8bd5\u4f7f\u7528\u8be5\u7f51\u7edc\u65f6\u4e5f\u4f1a\u51fa\u73b0\u6b64\u9519\u8bef\u3002<\/li>\n<\/ul>\n<h2 id=\"%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95-pLTdsFdwKk\">\u89e3\u51b3\u529e\u6cd5<\/h2>\n<p>\u9488\u5bf9\u4e0a\u8ff0\u539f\u56e0\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n<h3 id=\"1-%e5%88%9b%e5%bb%ba%e7%bd%91%e7%bb%9c-pLTdsFdwKk\">1. \u521b\u5efa\u7f51\u7edc<\/h3>\n<p>\u5982\u679c\u4f60\u5c1a\u672a\u521b\u5efa\u6240\u9700\u7684\u7f51\u7edc\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Docker\u7f51\u7edc\uff1a<\/p>\n<pre><code>docker network create my_network<\/code><\/pre>\n<p>\u5728\u8fd9\u4e2a\u547d\u4ee4\u4e2d\uff0c`my_network`\u662f\u4f60\u60f3\u8981\u521b\u5efa\u7684\u7f51\u7edc\u540d\u79f0\u3002\u521b\u5efa\u6210\u529f\u540e\uff0c\u4f60\u53ef\u4ee5\u518d\u6b21\u5c1d\u8bd5\u542f\u52a8\u5bb9\u5668\u3002<\/p>\n<h3 id=\"2-%e6%a3%80%e6%9f%a5%e7%bd%91%e7%bb%9c%e5%90%8d%e7%a7%b0-pLTdsFdwKk\">2. \u68c0\u67e5\u7f51\u7edc\u540d\u79f0<\/h3>\n<p>\u786e\u4fdd\u5728\u542f\u52a8\u5bb9\u5668\u65f6\u4f7f\u7528\u7684\u7f51\u7edc\u540d\u79f0\u662f\u6b63\u786e\u7684\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5217\u51fa\u6240\u6709\u73b0\u6709\u7684Docker\u7f51\u7edc\uff1a<\/p>\n<pre><code>docker network ls<\/code><\/pre>\n<p>\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u67e5\u770b\u6240\u6709\u5df2\u521b\u5efa\u7684\u7f51\u7edc\uff0c\u5e76\u786e\u8ba4\u4f60\u8981\u4f7f\u7528\u7684\u7f51\u7edc\u662f\u5426\u5b58\u5728\u3002<\/p>\n<h3 id=\"3-%e9%87%8d%e6%96%b0%e5%88%9b%e5%bb%ba%e7%bd%91%e7%bb%9c-pLTdsFdwKk\">3. \u91cd\u65b0\u521b\u5efa\u7f51\u7edc<\/h3>\n<p>\u5982\u679c\u4f60\u53d1\u73b0\u7f51\u7edc\u5df2\u7ecf\u88ab\u5220\u9664\uff0c\u6216\u8005\u9700\u8981\u91cd\u65b0\u914d\u7f6e\u7f51\u7edc\uff0c\u53ef\u4ee5\u5148\u5220\u9664\u65e7\u7f51\u7edc\uff0c\u7136\u540e\u91cd\u65b0\u521b\u5efa\uff1a<\/p>\n<pre><code>docker network rm my_network\ndocker network create my_network<\/code><\/pre>\n<p>\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u7f51\u7edc\u7684\u914d\u7f6e\u662f\u6700\u65b0\u7684\uff0c\u5e76\u4e14\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-pLTdsFdwKk\">\u603b\u7ed3<\/h2>\n<p>\u5728Docker\u4e2d\uff0c\u7f51\u7edc\u662f\u5bb9\u5668\u4e4b\u95f4\u901a\u4fe1\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\u3002\u9047\u5230\u201cError: network not found, create network first\u201d\u9519\u8bef\u65f6\uff0c\u901a\u5e38\u662f\u7531\u4e8e\u7f51\u7edc\u672a\u521b\u5efa\u3001\u540d\u79f0\u62fc\u5199\u9519\u8bef\u6216\u7f51\u7edc\u5df2\u88ab\u5220\u9664\u7b49\u539f\u56e0\u5bfc\u81f4\u7684\u3002\u901a\u8fc7\u521b\u5efa\u7f51\u7edc\u3001\u68c0\u67e5\u7f51\u7edc\u540d\u79f0\u548c\u91cd\u65b0\u521b\u5efa\u7f51\u7edc\u7b49\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6709\u6548\u89e3\u51b3\u6b64\u95ee\u9898\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u5bfb\u627e\u9ad8\u6027\u80fd\u7684 <a href=\"https:\/\/fwq.ai\">\u7f8e\u56fdVPS<\/a> \u6216 <a href=\"https:\/\/fwq.ai\">\u4e91\u670d\u52a1\u5668<\/a>\uff0c\u7c73\u4e91\u63d0\u4f9b\u591a\u79cd\u9009\u62e9\uff0c\u6ee1\u8db3\u4e0d\u540c\u7528\u6237\u7684\u9700\u6c42\u3002\u6211\u4eec\u7684\u670d\u52a1\u5305\u62ec\u533f\u540d\u670d\u52a1\u5668\u548cUSDT\u4ed8\u6b3e\uff0c\u786e\u4fdd\u60a8\u7684\u9690\u79c1\u548c\u5b89\u5168\u3002\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u8bbf\u95ee\u6211\u4eec\u7684 <a href=\"https:\/\/fwq.ai\">\u7f51\u7ad9<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker\u6545\u969c\u7801\u548c\u89e3\u51b3\u529e\u6cd5 &#8211; Error: network not found, create network first \u5728\u4f7f\u7528Docker\u8fdb\u884c\u5bb9\u5668\u5316\u5e94\u7528\u7ba1\u7406\u65f6\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u6545\u969c\u7801\uff0c\u5176\u4e2d\u4e4b\u4e00\u5c31\u662f\u201cError: network not found, create network first\u201d\u3002\u8fd9\u4e2a\u9519\u8bef\u901a\u5e38\u51fa\u73b0\u5728\u7528\u6237\u5c1d\u8bd5\u542f\u52a8\u4e00\u4e2a\u5bb9\u5668\u5e76\u6307\u5b9a\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u7f51\u7edc\u65f6\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u53ca\u5176\u89e3\u51b3\u529e\u6cd5\u3002 \u4ec0\u4e48\u662fDocker\u7f51\u7edc\uff1f Docker\u7f51\u7edc\u662fDocker\u5bb9\u5668\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u7684\u57fa\u7840\u8bbe\u65bd\u3002Docker\u63d0\u4f9b\u4e86\u591a\u79cd\u7f51\u7edc\u9a71\u52a8\u7a0b\u5e8f\uff0c\u5982bridge\u3001host\u548coverlay\u7b49\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u7f51\u7edc\u7c7b\u578b\u3002\u6bcf\u4e2aDocker\u7f51\u7edc\u90fd\u6709\u5176\u72ec\u7279\u7684\u7279\u6027\u548c\u7528\u9014\uff0c\u7406\u89e3\u8fd9\u4e9b\u7f51\u7edc\u7684\u5de5\u4f5c\u539f\u7406\u5bf9\u4e8e\u6709\u6548\u7ba1\u7406Docker\u5bb9\u5668\u81f3\u5173\u91cd\u8981\u3002 \u9519\u8bef\u539f\u56e0\u5206\u6790 \u5f53\u4f60\u5728Docker\u4e2d\u9047\u5230\u201cError: network not found, create network first\u201d\u9519\u8bef\u65f6\uff0c\u901a\u5e38\u662f\u56e0\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\u539f\u56e0\uff1a \u7f51\u7edc\u672a\u521b\u5efa\uff1a\u4f60\u5c1d\u8bd5\u4f7f\u7528\u7684\u7f51\u7edc\u5c1a\u672a\u88ab\u521b\u5efa\u3002Docker\u4e0d\u4f1a\u81ea\u52a8\u521b\u5efa\u7f51\u7edc\uff0c\u7528\u6237\u9700\u8981\u624b\u52a8\u521b\u5efa\u3002 \u7f51\u7edc\u540d\u79f0\u62fc\u5199\u9519\u8bef\uff1a\u5728\u547d\u4ee4\u4e2d\u6307\u5b9a\u7684\u7f51\u7edc\u540d\u79f0\u53ef\u80fd\u5b58\u5728\u62fc\u5199\u9519\u8bef\uff0c\u5bfc\u81f4Docker\u65e0\u6cd5\u627e\u5230\u8be5\u7f51\u7edc\u3002 \u7f51\u7edc\u5df2\u88ab\u5220\u9664\uff1a\u5982\u679c\u7f51\u7edc\u5728\u4e4b\u524d\u7684\u64cd\u4f5c\u4e2d\u88ab\u5220\u9664\uff0c\u5c1d\u8bd5\u4f7f\u7528\u8be5\u7f51\u7edc\u65f6\u4e5f\u4f1a\u51fa\u73b0\u6b64\u9519\u8bef\u3002 \u89e3\u51b3\u529e\u6cd5 \u9488\u5bf9\u4e0a\u8ff0\u539f\u56e0\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u89e3\u51b3\u529e\u6cd5\uff1a 1. \u521b\u5efa\u7f51\u7edc \u5982\u679c\u4f60\u5c1a\u672a\u521b\u5efa\u6240\u9700\u7684\u7f51\u7edc\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Docker\u7f51\u7edc\uff1a docker network create my_network \u5728\u8fd9\u4e2a\u547d\u4ee4\u4e2d\uff0c`my_network`\u662f\u4f60\u60f3\u8981\u521b\u5efa\u7684\u7f51\u7edc\u540d\u79f0\u3002\u521b\u5efa\u6210\u529f\u540e\uff0c\u4f60\u53ef\u4ee5\u518d\u6b21\u5c1d\u8bd5\u542f\u52a8\u5bb9\u5668\u3002 2. \u68c0\u67e5\u7f51\u7edc\u540d\u79f0 \u786e\u4fdd\u5728\u542f\u52a8\u5bb9\u5668\u65f6\u4f7f\u7528\u7684\u7f51\u7edc\u540d\u79f0\u662f\u6b63\u786e\u7684\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5217\u51fa\u6240\u6709\u73b0\u6709\u7684Docker\u7f51\u7edc\uff1a docker network ls \u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u67e5\u770b\u6240\u6709\u5df2\u521b\u5efa\u7684\u7f51\u7edc\uff0c\u5e76\u786e\u8ba4\u4f60\u8981\u4f7f\u7528\u7684\u7f51\u7edc\u662f\u5426\u5b58\u5728\u3002 3. \u91cd\u65b0\u521b\u5efa\u7f51\u7edc \u5982\u679c\u4f60\u53d1\u73b0\u7f51\u7edc\u5df2\u7ecf\u88ab\u5220\u9664\uff0c\u6216\u8005\u9700\u8981\u91cd\u65b0\u914d\u7f6e\u7f51\u7edc\uff0c\u53ef\u4ee5\u5148\u5220\u9664\u65e7\u7f51\u7edc\uff0c\u7136\u540e\u91cd\u65b0\u521b\u5efa\uff1a docker network rm my_network docker network [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-13607","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/13607","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=13607"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/13607\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=13607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=13607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=13607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}