{"id":13676,"date":"2024-11-15T20:32:03","date_gmt":"2024-11-15T12:32:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/13676\/"},"modified":"2024-11-15T20:32:03","modified_gmt":"2024-11-15T12:32:03","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-response-from-daemon-container-is-already-running","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/13676\/","title":{"rendered":"Docker\u6545\u969c\u7801\u548c\u89e3\u51b3\u529e\u6cd5 &#8211; Error response from daemon: container is already running"},"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-response-from-daemon-container-is-already-running-JuIYrJyldq\">Docker\u6545\u969c\u7801\u548c\u89e3\u51b3\u529e\u6cd5 &#8211; Error response from daemon: container is already running<\/h1>\n<p>\u5728\u4f7f\u7528Docker\u8fdb\u884c\u5bb9\u5668\u7ba1\u7406\u65f6\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u7801\uff0c\u5176\u4e2d\u4e4b\u4e00\u662f\u201cError response from daemon: container is already running\u201d\u3002\u8fd9\u4e2a\u9519\u8bef\u901a\u5e38\u610f\u5473\u7740\u7528\u6237\u5c1d\u8bd5\u542f\u52a8\u4e00\u4e2a\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5bb9\u5668\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=\"%e9%94%99%e8%af%af%e5%8e%9f%e5%9b%a0%e5%88%86%e6%9e%90-JuIYrJyldq\">\u9519\u8bef\u539f\u56e0\u5206\u6790<\/h2>\n<p>\u5f53\u4f60\u5c1d\u8bd5\u542f\u52a8\u4e00\u4e2a\u5df2\u7ecf\u5728\u8fd0\u884c\u7684Docker\u5bb9\u5668\u65f6\uff0cDocker\u5b88\u62a4\u8fdb\u7a0b\u4f1a\u8fd4\u56de\u8fd9\u4e2a\u9519\u8bef\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u53ef\u80fd\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u5bb9\u5668\u72b6\u6001\uff1a<\/strong>\u5bb9\u5668\u5df2\u7ecf\u5904\u4e8e\u8fd0\u884c\u72b6\u6001\uff0c\u65e0\u6cd5\u518d\u6b21\u542f\u52a8\u3002<\/li>\n<li><strong>\u547d\u4ee4\u9519\u8bef\uff1a<\/strong>\u7528\u6237\u53ef\u80fd\u8bef\u7528\u4e86\u542f\u52a8\u547d\u4ee4\uff0c\u5bfc\u81f4Docker\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u3002<\/li>\n<li><strong>\u811a\u672c\u95ee\u9898\uff1a<\/strong>\u5728\u81ea\u52a8\u5316\u811a\u672c\u4e2d\uff0c\u53ef\u80fd\u5b58\u5728\u903b\u8f91\u9519\u8bef\uff0c\u5bfc\u81f4\u91cd\u590d\u542f\u52a8\u540c\u4e00\u5bb9\u5668\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e6%a3%80%e6%9f%a5%e5%ae%b9%e5%99%a8%e7%8a%b6%e6%80%81-JuIYrJyldq\">\u5982\u4f55\u68c0\u67e5\u5bb9\u5668\u72b6\u6001<\/h2>\n<p>\u5728\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u786e\u8ba4\u5bb9\u5668\u7684\u72b6\u6001\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u8fd0\u884c\u7684\u5bb9\u5668\uff1a<\/p>\n<pre><code>docker ps<\/code><\/pre>\n<p>\u8be5\u547d\u4ee4\u5c06\u5217\u51fa\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\uff0c\u5305\u62ec\u5b83\u4eec\u7684ID\u3001\u540d\u79f0\u548c\u72b6\u6001\u3002\u5982\u679c\u4f60\u53d1\u73b0\u76ee\u6807\u5bb9\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u505c\u6b62\u5b83\uff1a<\/p>\n<pre><code>docker stop <\/code><\/pre>\n<p>\u5176\u4e2d\uff0c<code>&lt;container_id&gt;<\/code>\u662f\u4f60\u8981\u505c\u6b62\u7684\u5bb9\u5668\u7684ID\u3002<\/p>\n<h2 id=\"%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95-JuIYrJyldq\">\u89e3\u51b3\u529e\u6cd5<\/h2>\n<p>\u9488\u5bf9\u201cError response from daemon: container is already running\u201d\u9519\u8bef\uff0c\u4ee5\u4e0b\u662f\u51e0\u79cd\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n<h3 id=\"1-%e6%a3%80%e6%9f%a5%e5%ae%b9%e5%99%a8%e7%8a%b6%e6%80%81-JuIYrJyldq\">1. \u68c0\u67e5\u5bb9\u5668\u72b6\u6001<\/h3>\n<p>\u5982\u524d\u6240\u8ff0\uff0c\u4f7f\u7528<code>docker ps<\/code>\u547d\u4ee4\u786e\u8ba4\u5bb9\u5668\u662f\u5426\u5728\u8fd0\u884c\u3002\u5982\u679c\u662f\uff0c\u51b3\u5b9a\u662f\u5426\u9700\u8981\u505c\u6b62\u6216\u91cd\u542f\u8be5\u5bb9\u5668\u3002<\/p>\n<h3 id=\"2-%e5%81%9c%e6%ad%a2%e5%b9%b6%e9%87%8d%e5%90%af%e5%ae%b9%e5%99%a8-JuIYrJyldq\">2. \u505c\u6b62\u5e76\u91cd\u542f\u5bb9\u5668<\/h3>\n<p>\u5982\u679c\u4f60\u9700\u8981\u91cd\u65b0\u542f\u52a8\u5bb9\u5668\uff0c\u53ef\u4ee5\u5148\u505c\u6b62\u5b83\uff0c\u7136\u540e\u518d\u542f\u52a8\uff1a<\/p>\n<pre><code>docker stop \ndocker start <\/code><\/pre>\n<h3 id=\"3-%e4%bd%bf%e7%94%a8%e4%b8%8d%e5%90%8c%e7%9a%84%e5%91%bd%e4%bb%a4-JuIYrJyldq\">3. \u4f7f\u7528\u4e0d\u540c\u7684\u547d\u4ee4<\/h3>\n<p>\u5982\u679c\u4f60\u53ea\u662f\u60f3\u67e5\u770b\u5bb9\u5668\u7684\u8f93\u51fa\uff0c\u53ef\u4ee5\u4f7f\u7528<code>docker logs<\/code>\u547d\u4ee4\uff0c\u800c\u4e0d\u662f\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8\u5bb9\u5668\uff1a<\/p>\n<pre><code>docker logs <\/code><\/pre>\n<h3 id=\"4-%e6%a3%80%e6%9f%a5%e8%87%aa%e5%8a%a8%e5%8c%96%e8%84%9a%e6%9c%ac-JuIYrJyldq\">4. \u68c0\u67e5\u81ea\u52a8\u5316\u811a\u672c<\/h3>\n<p>\u5982\u679c\u4f60\u5728\u4f7f\u7528\u81ea\u52a8\u5316\u811a\u672c\uff0c\u786e\u4fdd\u811a\u672c\u903b\u8f91\u6b63\u786e\uff0c\u907f\u514d\u91cd\u590d\u542f\u52a8\u540c\u4e00\u5bb9\u5668\u3002\u53ef\u4ee5\u5728\u811a\u672c\u4e2d\u6dfb\u52a0\u72b6\u6001\u68c0\u67e5\uff0c\u4ee5\u786e\u4fdd\u5bb9\u5668\u5728\u542f\u52a8\u4e4b\u524d\u662f\u505c\u6b62\u72b6\u6001\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-JuIYrJyldq\">\u603b\u7ed3<\/h2>\n<p>\u5728Docker\u4e2d\u9047\u5230\u201cError response from daemon: container is already running\u201d\u9519\u8bef\u65f6\uff0c\u9996\u5148\u8981\u786e\u8ba4\u5bb9\u5668\u7684\u72b6\u6001\uff0c\u5e76\u6839\u636e\u9700\u8981\u91c7\u53d6\u76f8\u5e94\u7684\u63aa\u65bd\u3002\u901a\u8fc7\u4f7f\u7528<code>docker ps<\/code>\u3001<code>docker stop<\/code>\u548c<code>docker start<\/code>\u7b49\u547d\u4ee4\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u7ba1\u7406\u5bb9\u5668\u7684\u8fd0\u884c\u72b6\u6001\u3002\u5bf9\u4e8e\u9700\u8981\u9ad8\u6548\u7ba1\u7406\u548c\u90e8\u7f72\u7684\u7528\u6237\uff0c\u9009\u62e9\u5408\u9002\u7684<em><a href=\"https:\/\/fwq.ai\">\u4e91\u670d\u52a1\u5668<\/a><\/em>\u6216<em><a href=\"https:\/\/fwq.ai\">VPS<\/a><\/em>\u89e3\u51b3\u65b9\u6848\u5c06\u5927\u5927\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002\u7c73\u4e91\u63d0\u4f9b\u591a\u79cd\u670d\u52a1\u5668\u9009\u62e9\uff0c\u6ee1\u8db3\u4e0d\u540c\u7528\u6237\u7684\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker\u6545\u969c\u7801\u548c\u89e3\u51b3\u529e\u6cd5 &#8211; Error response from daemon: container is already running \u5728\u4f7f\u7528Docker\u8fdb\u884c\u5bb9\u5668\u7ba1\u7406\u65f6\uff0c\u7528\u6237\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u7801\uff0c\u5176\u4e2d\u4e4b\u4e00\u662f\u201cError response from daemon: container is already running\u201d\u3002\u8fd9\u4e2a\u9519\u8bef\u901a\u5e38\u610f\u5473\u7740\u7528\u6237\u5c1d\u8bd5\u542f\u52a8\u4e00\u4e2a\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u3002\u672c\u6587\u5c06\u6df1\u5165\u63a2\u8ba8\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u53ca\u5176\u89e3\u51b3\u529e\u6cd5\u3002 \u9519\u8bef\u539f\u56e0\u5206\u6790 \u5f53\u4f60\u5c1d\u8bd5\u542f\u52a8\u4e00\u4e2a\u5df2\u7ecf\u5728\u8fd0\u884c\u7684Docker\u5bb9\u5668\u65f6\uff0cDocker\u5b88\u62a4\u8fdb\u7a0b\u4f1a\u8fd4\u56de\u8fd9\u4e2a\u9519\u8bef\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u8fd9\u4e2a\u9519\u8bef\u7684\u539f\u56e0\u53ef\u80fd\u5305\u62ec\uff1a \u5bb9\u5668\u72b6\u6001\uff1a\u5bb9\u5668\u5df2\u7ecf\u5904\u4e8e\u8fd0\u884c\u72b6\u6001\uff0c\u65e0\u6cd5\u518d\u6b21\u542f\u52a8\u3002 \u547d\u4ee4\u9519\u8bef\uff1a\u7528\u6237\u53ef\u80fd\u8bef\u7528\u4e86\u542f\u52a8\u547d\u4ee4\uff0c\u5bfc\u81f4Docker\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u3002 \u811a\u672c\u95ee\u9898\uff1a\u5728\u81ea\u52a8\u5316\u811a\u672c\u4e2d\uff0c\u53ef\u80fd\u5b58\u5728\u903b\u8f91\u9519\u8bef\uff0c\u5bfc\u81f4\u91cd\u590d\u542f\u52a8\u540c\u4e00\u5bb9\u5668\u3002 \u5982\u4f55\u68c0\u67e5\u5bb9\u5668\u72b6\u6001 \u5728\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u786e\u8ba4\u5bb9\u5668\u7684\u72b6\u6001\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u8fd0\u884c\u7684\u5bb9\u5668\uff1a docker ps \u8be5\u547d\u4ee4\u5c06\u5217\u51fa\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\uff0c\u5305\u62ec\u5b83\u4eec\u7684ID\u3001\u540d\u79f0\u548c\u72b6\u6001\u3002\u5982\u679c\u4f60\u53d1\u73b0\u76ee\u6807\u5bb9\u5668\u5df2\u7ecf\u5728\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u505c\u6b62\u5b83\uff1a docker stop \u5176\u4e2d\uff0c&lt;container_id&gt;\u662f\u4f60\u8981\u505c\u6b62\u7684\u5bb9\u5668\u7684ID\u3002 \u89e3\u51b3\u529e\u6cd5 \u9488\u5bf9\u201cError response from daemon: container is already running\u201d\u9519\u8bef\uff0c\u4ee5\u4e0b\u662f\u51e0\u79cd\u89e3\u51b3\u529e\u6cd5\uff1a 1. \u68c0\u67e5\u5bb9\u5668\u72b6\u6001 \u5982\u524d\u6240\u8ff0\uff0c\u4f7f\u7528docker ps\u547d\u4ee4\u786e\u8ba4\u5bb9\u5668\u662f\u5426\u5728\u8fd0\u884c\u3002\u5982\u679c\u662f\uff0c\u51b3\u5b9a\u662f\u5426\u9700\u8981\u505c\u6b62\u6216\u91cd\u542f\u8be5\u5bb9\u5668\u3002 2. \u505c\u6b62\u5e76\u91cd\u542f\u5bb9\u5668 \u5982\u679c\u4f60\u9700\u8981\u91cd\u65b0\u542f\u52a8\u5bb9\u5668\uff0c\u53ef\u4ee5\u5148\u505c\u6b62\u5b83\uff0c\u7136\u540e\u518d\u542f\u52a8\uff1a docker stop docker start 3. \u4f7f\u7528\u4e0d\u540c\u7684\u547d\u4ee4 \u5982\u679c\u4f60\u53ea\u662f\u60f3\u67e5\u770b\u5bb9\u5668\u7684\u8f93\u51fa\uff0c\u53ef\u4ee5\u4f7f\u7528docker logs\u547d\u4ee4\uff0c\u800c\u4e0d\u662f\u5c1d\u8bd5\u91cd\u65b0\u542f\u52a8\u5bb9\u5668\uff1a [&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-13676","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/13676","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=13676"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/13676\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=13676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=13676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=13676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}