{"id":18250,"date":"2024-11-18T14:10:50","date_gmt":"2024-11-18T06:10:50","guid":{"rendered":"https:\/\/fwq.ai\/blog\/18250\/"},"modified":"2024-11-18T14:10:50","modified_gmt":"2024-11-18T06:10:50","slug":"docker%e5%90%af%e5%8a%a8%e6%8a%a5%e9%94%99%e6%80%8e%e4%b9%88%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/18250\/","title":{"rendered":"docker\u542f\u52a8\u62a5\u9519\u600e\u4e48\u89e3\u51b3"},"content":{"rendered":"<blockquote><p>\n  \u89e3\u51b3 docker \u542f\u52a8\u5931\u8d25\u95ee\u9898\uff1a1. \u4f7f\u7528 root \u7528\u6237\u6743\u9650\u8fd0\u884c docker\uff1b2. \u68c0\u67e5\u7aef\u53e3\u51b2\u7a81\u5e76\u8c03\u6574\u7aef\u53e3\u53f7\uff1b3. \u6e05\u7406\u672a\u4f7f\u7528\u7684\u955c\u50cf\u548c\u5377\u91ca\u653e\u5b58\u50a8\u7a7a\u95f4\uff1b4. \u589e\u52a0 docker \u5206\u914d\u7684\u5185\u5b58\uff1b5. \u5b89\u88c5\u6240\u9700\u4f9d\u8d56\u9879\uff1b6. \u68c0\u67e5\u5377\u6302\u8f7d\u7684\u6b63\u786e\u6027\uff1b7. \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7\u83b7\u53d6\u9519\u8bef\u4fe1\u606f\uff1b8. \u66f4\u65b0\u5185\u6838\u7248\u672c\u4ee5\u7b26\u5408 docker \u8981\u6c42\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/05\/2024060506271890745.jpg\" class=\"aligncenter\" title=\"docker\u542f\u52a8\u62a5\u9519\u600e\u4e48\u89e3\u51b3\u63d2\u56fe\" alt=\"docker\u542f\u52a8\u62a5\u9519\u600e\u4e48\u89e3\u51b3\u63d2\u56fe\" \/><\/p>\n<p><strong>Docker \u542f\u52a8\u62a5\u9519\u89e3\u51b3\u6307\u5357<\/strong><\/p>\n<p><strong>1. \u542f\u52a8\u5931\u8d25\uff1a\u6743\u9650\u95ee\u9898<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u4f7f\u7528 sudo \u4ee5 root \u7528\u6237\u6743\u9650\u8fd0\u884c Docker \u547d\u4ee4\u3002<\/li>\n<\/ul>\n<p><strong>2. \u542f\u52a8\u5931\u8d25\uff1a\u7f51\u7edc\u51b2\u7a81<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u68c0\u67e5 Docker \u5b88\u62a4\u8fdb\u7a0b\u662f\u5426\u76d1\u542c\u6b63\u786e\u7684\u7aef\u53e3\u3002\u5982\u679c\u5df2\u4f7f\u7528\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\uff0c\u8bf7\u66f4\u6539 Docker \u7684\u7aef\u53e3\u53f7\u6216\u505c\u6b62\u51b2\u7a81\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<p><strong>3. \u542f\u52a8\u5931\u8d25\uff1a\u5b58\u50a8\u7a7a\u95f4\u4e0d\u8db3<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u91ca\u653e Docker \u5b58\u50a8\u7a7a\u95f4\u3002\u53ef\u4ee5\u901a\u8fc7\u6e05\u7406\u672a\u4f7f\u7528\u7684\u955c\u50cf\u548c\u5377\u6765\u5b9e\u73b0\u3002<\/li>\n<\/ul>\n<p><strong>4. \u542f\u52a8\u5931\u8d25\uff1a\u5185\u5b58\u4e0d\u8db3<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u589e\u52a0 Docker \u5206\u914d\u7684\u5185\u5b58\u3002\u53ef\u4ee5\u7f16\u8f91 \/etc\/default\/ \u6587\u4ef6\u5e76\u4fee\u6539 DOCKER_OPTS \u53d8\u91cf\uff0c\u8bbe\u7f6e\u66f4\u9ad8\u7684\u5185\u5b58\u9650\u5236\u3002<\/li>\n<\/ul>\n<p><strong>5. \u542f\u52a8\u5931\u8d25\uff1a\u7f3a\u5c11\u4f9d\u8d56\u9879<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u5b89\u88c5 Docker \u6240\u9700\u7684\u4f9d\u8d56\u9879\u3002\u5728 Ubuntu\/Debian \u7cfb\u7edf\u4e2d\uff0c\u8fd0\u884c sudo apt-get install docker-ce docker-ce-cli\u3002<\/li>\n<\/ul>\n<p><strong>6. \u542f\u52a8\u5931\u8d25\uff1a\u5377\u6302\u8f7d\u5931\u8d25<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u786e\u4fdd\u5377\u5b58\u5728\u4e14\u5df2\u6b63\u786e\u6302\u8f7d\u3002\u4f7f\u7528 docker inspect \u547d\u4ee4\u68c0\u67e5\u5bb9\u5668\u7684\u5377\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p><strong>7. \u542f\u52a8\u5931\u8d25\uff1a\u5bb9\u5668\u9519\u8bef<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u68c0\u67e5\u5bb9\u5668\u7684\u65e5\u5fd7\u4ee5\u83b7\u53d6\u8be6\u7ec6\u9519\u8bef\u4fe1\u606f\u3002\u53ef\u4ee5\u4f7f\u7528 docker logs \u547d\u4ee4\u67e5\u770b\u65e5\u5fd7\u3002<\/li>\n<\/ul>\n<p><strong>8. \u542f\u52a8\u5931\u8d25\uff1a\u5185\u6838\u7248\u672c\u4e0d\u517c\u5bb9<\/strong><\/p>\n<ul>\n<li> <strong>\u89e3\u51b3\u65b9\u6cd5\uff1a<\/strong>\u66f4\u65b0\u5185\u6838\u7248\u672c\u4ee5\u7b26\u5408 Docker \u8981\u6c42\u3002\u67d0\u4e9b Docker \u7248\u672c\u9700\u8981\u7279\u5b9a\u7684\u5185\u6838\u7248\u672c\u624d\u80fd\u6b63\u5e38\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u542f\u52a8\u62a5\u9519\u600e\u4e48\u89e3\u51b3\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u51b3 docker \u542f\u52a8\u5931\u8d25\u95ee\u9898\uff1a1. \u4f7f\u7528 root \u7528\u6237\u6743\u9650\u8fd0\u884c docker\uff1b2. \u68c0\u67e5\u7aef\u53e3\u51b2\u7a81\u5e76\u8c03\u6574\u7aef\u53e3\u53f7\uff1b3. \u6e05\u7406\u672a\u4f7f\u7528\u7684\u955c\u50cf\u548c\u5377\u91ca\u653e\u5b58\u50a8\u7a7a\u95f4\uff1b4. \u589e\u52a0 docker \u5206\u914d\u7684\u5185\u5b58\uff1b5. \u5b89\u88c5\u6240\u9700\u4f9d\u8d56\u9879\uff1b6. \u68c0\u67e5\u5377\u6302\u8f7d\u7684\u6b63\u786e\u6027\uff1b7. \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7\u83b7\u53d6\u9519\u8bef\u4fe1\u606f\uff1b8. \u66f4\u65b0\u5185\u6838\u7248\u672c\u4ee5\u7b26\u5408 docker \u8981\u6c42\u3002 Docker \u542f\u52a8\u62a5\u9519\u89e3\u51b3\u6307\u5357 1. \u542f\u52a8\u5931\u8d25\uff1a\u6743\u9650\u95ee\u9898 \u89e3\u51b3\u65b9\u6cd5\uff1a\u4f7f\u7528 sudo \u4ee5 root \u7528\u6237\u6743\u9650\u8fd0\u884c Docker \u547d\u4ee4\u3002 2. \u542f\u52a8\u5931\u8d25\uff1a\u7f51\u7edc\u51b2\u7a81 \u89e3\u51b3\u65b9\u6cd5\uff1a\u68c0\u67e5 Docker \u5b88\u62a4\u8fdb\u7a0b\u662f\u5426\u76d1\u542c\u6b63\u786e\u7684\u7aef\u53e3\u3002\u5982\u679c\u5df2\u4f7f\u7528\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\uff0c\u8bf7\u66f4\u6539 Docker \u7684\u7aef\u53e3\u53f7\u6216\u505c\u6b62\u51b2\u7a81\u5e94\u7528\u7a0b\u5e8f\u3002 3. \u542f\u52a8\u5931\u8d25\uff1a\u5b58\u50a8\u7a7a\u95f4\u4e0d\u8db3 \u89e3\u51b3\u65b9\u6cd5\uff1a\u91ca\u653e Docker \u5b58\u50a8\u7a7a\u95f4\u3002\u53ef\u4ee5\u901a\u8fc7\u6e05\u7406\u672a\u4f7f\u7528\u7684\u955c\u50cf\u548c\u5377\u6765\u5b9e\u73b0\u3002 4. \u542f\u52a8\u5931\u8d25\uff1a\u5185\u5b58\u4e0d\u8db3 \u89e3\u51b3\u65b9\u6cd5\uff1a\u589e\u52a0 Docker \u5206\u914d\u7684\u5185\u5b58\u3002\u53ef\u4ee5\u7f16\u8f91 \/etc\/default\/ \u6587\u4ef6\u5e76\u4fee\u6539 DOCKER_OPTS \u53d8\u91cf\uff0c\u8bbe\u7f6e\u66f4\u9ad8\u7684\u5185\u5b58\u9650\u5236\u3002 5. \u542f\u52a8\u5931\u8d25\uff1a\u7f3a\u5c11\u4f9d\u8d56\u9879 \u89e3\u51b3\u65b9\u6cd5\uff1a\u5b89\u88c5 Docker \u6240\u9700\u7684\u4f9d\u8d56\u9879\u3002\u5728 [&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-18250","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18250","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=18250"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/18250\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=18250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=18250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=18250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}