{"id":63779,"date":"2025-04-29T14:51:12","date_gmt":"2025-04-29T06:51:12","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63779\/"},"modified":"2025-04-29T14:51:12","modified_gmt":"2025-04-29T06:51:12","slug":"docker%e5%ae%b9%e5%99%a8%e6%80%8e%e4%b9%88%e5%ae%89%e8%a3%85nacos-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63779\/","title":{"rendered":"docker\u5bb9\u5668\u600e\u4e48\u5b89\u88c5nacos"},"content":{"rendered":"<blockquote><p>\n  \u5728 docker \u5bb9\u5668\u4e2d\u5b89\u88c5 nacos\uff0c\u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u62c9\u53d6 nacos \u955c\u50cf\u521b\u5efa nacos \u6570\u636e\u5377\u8fd0\u884c nacos \u5bb9\u5668\uff0c\u5c06\u7aef\u53e3 8848 \u6620\u5c04\u5230\u4e3b\u673a\u7684\u540c\u4e00\u7aef\u53e3\u68c0\u67e5 nacos \u72b6\u6001\u8bbf\u95ee nacos \u63a7\u5236\u53f0\uff0c\u9ed8\u8ba4\u7528\u6237\u540d\u548c\u5bc6\u7801\u5747\u4e3a &#8220;nacos&#8221;\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/05\/2024060507302287806.jpg\" class=\"aligncenter\" title=\"docker\u5bb9\u5668\u600e\u4e48\u5b89\u88c5nacos\u63d2\u56fe\" alt=\"docker\u5bb9\u5668\u600e\u4e48\u5b89\u88c5nacos\u63d2\u56fe\" \/><\/p>\n<p><strong>Docker \u5bb9\u5668\u4e2d\u5b89\u88c5 Nacos<\/strong><\/p>\n<p>Nacos \u662f\u4e00\u4e2a\u52a8\u6001\u670d\u52a1\u53d1\u73b0\u3001\u914d\u7f6e\u7ba1\u7406\u548c\u670d\u52a1\u7ba1\u7406\u5e73\u53f0\u3002\u5728 Docker \u5bb9\u5668\u4e2d\u5b89\u88c5 Nacos \u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>\u524d\u63d0\u6761\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u5b89\u88c5 Docker<\/li>\n<li>\u5177\u6709 root \u6743\u9650\u6216 sudo \u6743\u9650<\/li>\n<\/ul>\n<p><strong>\u6b65\u9aa4\uff1a<\/strong><\/p>\n<p><strong>1. \u62c9\u53d6 Nacos \u955c\u50cf:<\/strong><\/p>\n<pre>docker pull nacos\/nacos-server<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u521b\u5efa Nacos \u6570\u636e\u5377:<\/strong><\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a nacos-data \u7684\u5377\u6765\u5b58\u50a8 Nacos \u6570\u636e\u3002<\/p>\n<pre>docker volume create nacos-data<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u8fd0\u884c Nacos \u5bb9\u5668:<\/strong><\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c Nacos \u5bb9\u5668\uff0c\u5c06\u7aef\u53e3 8848 \u6620\u5c04\u5230\u4e3b\u673a\u7684\u540c\u4e00\u7aef\u53e3\uff1a<\/p>\n<pre>docker run -d --name nacos-server -p 8848:8848 -v nacos-data:\/home\/nacos\/nacos\/data nacos\/nacos-server<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u68c0\u67e5 Nacos \u72b6\u6001:<\/strong><\/p>\n<p>\u7b49\u5f85\u5bb9\u5668\u542f\u52a8\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u5176\u72b6\u6001\uff1a<\/p>\n<pre>docker logs nacos-server<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5982\u679c\u770b\u5230 &#8220;[INFO] Nacos started successfully&#8221;\uff0c\u5219\u8868\u793a Nacos \u5df2\u6210\u529f\u542f\u52a8\u3002<\/p>\n<p><strong>5. \u8bbf\u95ee Nacos \u63a7\u5236\u53f0:<\/strong><\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee Nacos \u63a7\u5236\u53f0\uff1a<\/p>\n<p>http:\/\/localhost:8848\/nacos<\/p>\n<p><strong>6. \u767b\u5f55 Nacos \u63a7\u5236\u53f0:<\/strong><\/p>\n<p>\u9ed8\u8ba4\u7528\u6237\u540d\u548c\u5bc6\u7801\u5747\u4e3a &#8220;nacos&#8221;\u3002<\/p>\n<p><strong>\u81f3\u6b64\uff0c\u60a8\u5df2\u6210\u529f\u5728 Docker \u5bb9\u5668\u4e2d\u5b89\u88c5\u5e76\u542f\u52a8 Nacos\u3002<\/strong><\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5bb9\u5668\u600e\u4e48\u5b89\u88c5nacos\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728 docker \u5bb9\u5668\u4e2d\u5b89\u88c5 nacos\uff0c\u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a\u62c9\u53d6 nacos \u955c\u50cf\u521b\u5efa nacos \u6570\u636e\u5377\u8fd0\u884c nacos \u5bb9\u5668\uff0c\u5c06\u7aef\u53e3 8848 \u6620\u5c04\u5230\u4e3b\u673a\u7684\u540c\u4e00\u7aef\u53e3\u68c0\u67e5 nacos \u72b6\u6001\u8bbf\u95ee nacos \u63a7\u5236\u53f0\uff0c\u9ed8\u8ba4\u7528\u6237\u540d\u548c\u5bc6\u7801\u5747\u4e3a &#8220;nacos&#8221; Docker \u5bb9\u5668\u4e2d\u5b89\u88c5 Nacos Nacos \u662f\u4e00\u4e2a\u52a8\u6001\u670d\u52a1\u53d1\u73b0\u3001\u914d\u7f6e\u7ba1\u7406\u548c\u670d\u52a1\u7ba1\u7406\u5e73\u53f0\u3002\u5728 Docker \u5bb9\u5668\u4e2d\u5b89\u88c5 Nacos \u9700\u8981\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u524d\u63d0\u6761\u4ef6\uff1a \u5b89\u88c5 Docker \u5177\u6709 root \u6743\u9650\u6216 sudo \u6743\u9650 \u6b65\u9aa4\uff1a 1. \u62c9\u53d6 Nacos \u955c\u50cf: docker pull nacos\/nacos-server \u767b\u5f55\u540e\u590d\u5236 2. \u521b\u5efa Nacos \u6570\u636e\u5377: \u521b\u5efa\u4e00\u4e2a\u540d\u4e3a nacos-data \u7684\u5377\u6765\u5b58\u50a8 Nacos \u6570\u636e\u3002 docker volume create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-63779","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63779","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=63779"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63779\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}