﻿{"id":21846,"date":"2023-06-15T08:25:22","date_gmt":"2023-06-15T00:25:22","guid":{"rendered":"https:\/\/www.linuxmi.com\/?p=21846"},"modified":"2023-06-14T21:02:15","modified_gmt":"2023-06-14T13:02:15","slug":"lazydocke-docker","status":"publish","type":"post","link":"https:\/\/www.linuxmi.com\/lazydocke-docker.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 lazydocker \u7ba1\u7406\u60a8\u7684 Docker \u5bb9\u5668"},"content":{"rendered":"<p>Docker\u548cDocker Compose\u662f\u6613\u4e8e\u4f7f\u7528\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5728\u9694\u79bb\u7684\u73af\u5883\u4e2d\u7b80\u5355\u5730\u90e8\u7f72\u8f6f\u4ef6\u3002\u4f46\u662f\uff0c\u8ddf\u8e2a\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u7684\u5065\u5eb7\u72b6\u51b5\u53ef\u80fd\u4f1a\u8017\u8d39\u5927\u91cf\u65f6\u95f4\u3002<\/p>\n<p>lazydocker\u662f\u4e00\u4e2aTUI\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5728\u4e00\u4e2a\u5730\u65b9\u7ba1\u7406\u548c\u76d1\u63a7\u6240\u6709\u7684Docker\u5bb9\u5668\u3002<\/p>\n<p>\u4e3a\u4ec0\u4e48\u4f7f\u7528lazydocker\uff1f \u4e00\u8258\u8239\u8d27\u88ab\u8d77\u91cd\u673a\u540a\u8d77 \u5982\u679c\u60a8\u60f3\u5728\u4e0d\u6df7\u4e71\u60a8\u7684\u7cfb\u7edf\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\u8f6f\u4ef6\uff0c\u90a3\u4e48Docker\u662f\u4e00\u4e2a\u5fc5\u4e0d\u53ef\u5c11\u7684\u5de5\u5177\u3002\u6bcf\u4e2aDocker\u5e94\u7528\u90fd\u5728\u4e00\u4e2a\u5355\u72ec\u7684\u5bb9\u5668\u4e2d\u8fd0\u884c\uff0c\u5e76\u4e14\u9664\u975e\u60a8\u660e\u786e\u9700\u8981\uff0c\u5426\u5219\u5b83\u6c38\u8fdc\u4e0d\u4f1a\u4e0e\u7cfb\u7edf\u4e0a\u7684\u5176\u4ed6\u5e94\u7528\u7a0b\u5e8f\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<p>\u5982\u679c\u60a8\u8fd8\u6ca1\u6709\u5b89\u88c5\u5b83\uff0c\u60a8\u5e94\u8be5\u9605\u8bfb\u6211\u4eec\u7684\u6307\u5357\uff0c\u4e86\u89e3\u5982\u4f55\u5728Linux\u4e0a\u5b89\u88c5Docker\u548cDocker Compose\u3002<\/p>\n<p>Docker Compose\u4f7f\u90e8\u7f72\u670d\u52a1\u53d8\u5f97\u66f4\u52a0\u7b80\u5355\uff0c\u5728\u6811\u8393\u6d3e\u4e0a\u81ea\u4e3b\u6258\u7ba1\u9879\u76ee\u65f6\u5c24\u5176\u6709\u7528\u3002\u60a8\u53ef\u4ee5\u5728\u5355\u4e2aYAML\u6587\u4ef6\u4e2d\u5b9a\u4e49\u914d\u7f6e\uff0c\u5e76\u4f7f\u7528\u5355\u4e2a\u547d\u4ee4\u542f\u52a8\u591a\u4e2aDocker\u5bb9\u5668\uff0c\u8be5\u547d\u4ee4\u5c06\u542f\u52a8\u6587\u4ef6\u4e2d\u6307\u5b9a\u7684\u5bb9\u5668\u3002<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"null\">docker-compose ps<\/code><\/pre>\n<p>&#8230;\u4f4d\u4e8e\u60a8\u7684docker-compose.yml\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u4e2d\u3002<\/p>\n<p>\u968f\u7740\u60a8\u6d4b\u8bd5\u548c\u90e8\u7f72\u66f4\u591a\u7684\u8f6f\u4ef6\uff0c\u60a8\u53ef\u80fd\u4f1a\u5728\u6587\u4ef6\u7cfb\u7edf\u7684\u4e0d\u540c\u4f4d\u7f6e\u521b\u5efa\u591a\u4e2adocker-compose.yml\u6587\u4ef6\uff0c\u540c\u65f6\u542f\u52a8\u548c\u5fd8\u8bb0\u4e86\u4e3a\u4e00\u6b21\u6027\u76ee\u7684\u800c\u542f\u52a8\u7684Docker\u5316\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u5982\u679c\u60a8\u7684Docker Compose\u6587\u4ef6\u6563\u843d\u5728\u786c\u76d8\u4e0a\uff0c\u8981\u63a7\u5236\u6216\u751a\u81f3\u8ddf\u8e2a\u6b63\u5728\u8fd0\u884c\u7684\u5185\u5bb9\u5c31\u53d8\u5f97\u56f0\u96be\u3002<\/p>\n<p>\u7ba1\u7406\u53ef\u80fd\u4f1a\u53d8\u5f97\u6df7\u4e71\uff0c\u800c\u8bb0\u4f4f\u5b8c\u6574\u7684Docker\u547d\u4ee4\u8303\u56f4\u5219\u662f\u4e00\u9879\u5355\u72ec\u7684\u4efb\u52a1\u3002<\/p>\n<p>lazydocker\u4f1a\u6536\u96c6\u5173\u4e8e\u60a8\u7684Docker\u5bb9\u5668\u7684\u6240\u6709\u4fe1\u606f\uff0c\u5e76\u5c06\u5176\u6574\u9f50\u5730\u5448\u73b0\u5728\u7ec8\u7aef\u4e2d\u3002\u60a8\u53ef\u4ee5\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u5185\u5bb9\uff0c\u68c0\u67e5\u65e5\u5fd7\uff0c\u67e5\u770b\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\uff0c\u5e76\u68c0\u67e5\u73af\u5883\u3002<\/p>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u505c\u6b62\u3001\u6682\u505c\u3001\u91cd\u65b0\u542f\u52a8\u4ee5\u53ca\u5bf9\u5355\u4e2a\u5bb9\u5668\u6267\u884c\u5176\u4ed6\u64cd\u4f5c\uff0c\u6216\u8005\u5c06\u64cd\u4f5c\u5e94\u7528\u4e8e\u6bcf\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u3002<\/p>\n<p>\u76f8\u5173\uff1a10\u5206\u949f\u5b66\u4f1a\u4f7f\u7528 Docker \u90e8\u7f72 Ghost \u535a\u5ba2 <a href=\"https:\/\/www.linuxmi.com\/docker-bushu-ghost.html\">https:\/\/www.linuxmi.com\/docker-bushu-ghost.html<\/a><\/p>\n<h2><strong>\u5982\u4f55\u5728Linux\u4e0a\u5b89\u88c5lazydocker <\/strong><\/h2>\n<p>\u4f7f\u7528\u811a\u672c\u5b89\u88c5lazydocker \u867d\u7136lazydocker\u672c\u8eab\u662f\u4e00\u4e2aDocker\u5316\u7684\u955c\u50cf\uff0c\u4f46\u4ee5\u8fd9\u79cd\u65b9\u5f0f\u90e8\u7f72\u5b83\u610f\u5473\u7740\u60a8\u5c06\u65e0\u6cd5\u67e5\u770b\u5176\u4ed6Docker\u5bb9\u5668\u7684\u65e5\u5fd7\u6216CPU\u4f7f\u7528\u60c5\u51b5\u56fe\u3002<\/p>\n<p>\u76f8\u53cd\uff0c\u60a8\u5e94\u8be5\u4f7f\u7528lazydocker\u5b89\u88c5\u811a\u672c\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"null\">curl https:\/\/raw.githubusercontent.com\/jesseduffield\/lazydocker\/master\/scripts\/install_update_linux.sh | bash<\/code><\/pre>\n<p>\u6bcb\u5eb8\u7f6e\u7591\uff0c\u5728\u5c06\u4efb\u4f55\u811a\u672c\u5bfc\u5165Bash\u4e4b\u524d\uff0c\u60a8\u5e94\u8be5\u68c0\u67e5\u811a\u672c\u7684\u5185\u5bb9\u3002<\/p>\n<h2><strong>\u4f7f\u7528lazydocker\u7ba1\u7406\u60a8\u7684Docker\u5bb9\u5668 <\/strong><\/h2>\n<p>\u901a\u8fc7\u952e\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8lazydocker\uff1a<\/p>\n<pre class=\"pure-highlightjs\"><code class=\"null\">lazydocker<\/code><\/pre>\n<p>\u65e0\u8bba\u60a8\u5728\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u54ea\u4e2a\u4f4d\u7f6e\uff0c\u6216\u8005\u60a8\u7684Docker\u955c\u50cf\u6216Docker Compose\u6587\u4ef6\u4f4d\u4e8e\u4f55\u5904\uff0clazydocker\u90fd\u4f1a\u4ece\u4e2d\u83b7\u53d6\u4fe1\u606f\u3002<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21847\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/06\/d2.jpg\" alt=\"\" width=\"1920\" height=\"1079\" \/><\/p>\n<p style=\"text-align: center;\">lazydocker\u663e\u793aaudiobookshelf\u7684\u65e5\u5fd7<\/p>\n<p>\u5728TUI\u7684\u5de6\u4fa7\u5782\u76f4\u8fd0\u884c\uff0c\u60a8\u4f1a\u770b\u5230\u56db\u4e2a\u90e8\u5206\u3002\u5b83\u4eec\u5206\u522b\u662fServices\uff08\u670d\u52a1\uff09\u3001Standalone containers\uff08\u72ec\u7acb\u5bb9\u5668\uff09\u3001Images\uff08\u955c\u50cf\uff09\u548cVolumes\uff08\u5377\uff09\u3002<\/p>\n<p>\u5728\u6bcf\u4e2a\u90e8\u5206\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u952e\u76d8\u4e0a\u7684\u5411\u4e0a\u548c\u5411\u4e0b\u7bad\u5934\u952e\u6d4f\u89c8\u6761\u76ee\u3002\u5f53\u60a8\u9009\u62e9\u6bcf\u4e2a\u6761\u76ee\u65f6\uff0c\u76f8\u5173\u4fe1\u606f\u5c06\u663e\u793a\u5728\u53f3\u4fa7\u7a97\u683c\u4e2d\u3002\u6216\u8005\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u9f20\u6807\u5728\u754c\u9762\u4e0a\u70b9\u51fb\u3002<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21848\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/06\/d3.jpg\" alt=\"\" width=\"1920\" height=\"1076\" \/><\/p>\n<p style=\"text-align: center;\">lazydocker\u663e\u793aaudiobookshelf\u7684CPU\u548c\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/p>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4fe1\u606f\u7a97\u683c\u5c06\u663e\u793a\u60a8\u6240\u9009\u62e9\u6761\u76ee\u7684\u65e5\u5fd7\uff0c\u4f46\u60a8\u53ef\u4ee5\u70b9\u51fb\u9876\u90e8\u7684\u6807\u7b7e\uff0c\u663e\u793aCPU\u548c\u5185\u5b58\u7edf\u8ba1\u4fe1\u606f\u3001\u5bb9\u5668\u73af\u5883\u3001\u914d\u7f6e\u6761\u76ee\u6216top\u3002<\/p>\n<p>\u5982\u679c\u4e00\u4e2aDocker\u5316\u7684\u5e94\u7528\u7a0b\u5e8f\u5d29\u6e83\uff0c\u60a8\u53ef\u4ee5\u5728\u4e0d\u79bb\u5f00lazydocker\u7684\u60c5\u51b5\u4e0b\u68c0\u67e5\u5b83\u7684\u6240\u6709\u4fe1\u606f\uff0c\u4ee5\u53ca\u5176\u4ed6\u6240\u6709Docker\u5316\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u4fe1\u606f\u3002<\/p>\n<p>\u524d\u9762\u63d0\u5230\u7684\u4fe1\u606f\u9009\u9879\u4ec5\u9002\u7528\u4e8e\u5b9e\u9645\u5bb9\u5668\u3002\u5982\u679c\u60a8\u5728Images\u6216Volumes\u4e2d\u9009\u62e9\u4e86\u4e00\u4e2a\u6761\u76ee\uff0c\u60a8\u53ea\u80fd\u770b\u5230\u914d\u7f6e\u3002<\/p>\n<p>\u5728\u9ad8\u4eae\u663e\u793a\u4e00\u4e2a\u5bb9\u5668\u540e\uff0c\u6309\u4e0bx\u952e\u53ef\u4ee5\u6253\u5f00\u53ef\u6267\u884c\u64cd\u4f5c\u7684\u83dc\u5355\u3002\u9664\u4e86\u505c\u6b62\u3001\u6682\u505c\u548c\u91cd\u65b0\u542f\u52a8\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u5220\u9664\u5bb9\u5668\u3001\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u5b83\u4eec\u3001\u542f\u52a8\u548c\u505c\u6b62\u5bb9\u5668\uff0c\u6216\u76f4\u63a5\u6267\u884c\u547d\u4ee4\u3002<\/p>\n<p>\u9664\u4e86\u80fd\u591f\u5728\u83dc\u5355\u5185\u8fd0\u884c\u547d\u4ee4\uff0c\u60a8\u8fd8\u4f1a\u770b\u5230\u76f8\u5173\u7684\u5feb\u6377\u952e\uff0c\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-21849\" src=\"https:\/\/www.linuxmi.com\/wp-content\/uploads\/2023\/06\/d4.jpg\" alt=\"\" width=\"1078\" height=\"413\" \/><\/p>\n<p style=\"text-align: center;\">lazydocker\u6279\u91cf\u64cd\u4f5c\u83dc\u5355<\/p>\n<p>\u5982\u679c\u60a8\u60f3\u5bf9\u6240\u6709\u5bb9\u5668\u6267\u884c\u6279\u91cf\u64cd\u4f5c\uff0c\u8bf7\u6309\u4e0bb\u952e\u6253\u5f00\u6279\u91cf\u547d\u4ee4\u83dc\u5355\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5728Services\uff08\u670d\u52a1\uff09\u90e8\u5206\u9009\u62e9\u6b64\u64cd\u4f5c\uff0c\u60a8\u5c06\u770b\u5230\u6807\u51c6\u7684Docker Compose\u547d\u4ee4\uff0c\u800c\u5982\u679c\u60a8\u5728Standalone containers\uff08\u72ec\u7acb\u5bb9\u5668\uff09\u4e2d\u6253\u5f00\u83dc\u5355\uff0c\u60a8\u5c06\u6709\u505c\u6b62\u3001\u5220\u9664\u548c\u6e05\u7406\u5bb9\u5668\u7684\u9009\u9879\u3002<\/p>\n<p>\u5728\u5269\u4e0b\u7684\u4e24\u4e2a\u90e8\u5206\u4e2d\uff0c\u60a8\u53ea\u80fd\u6267\u884c\u6e05\u7406\u672a\u4f7f\u7528\u7684\u5377\u548c\u955c\u50cf\u7684\u6279\u91cf\u64cd\u4f5c\u3002<\/p>\n<h2><strong>lazydocker\u8ba9Linux\u4e0a\u7684\u5bb9\u5668\u7ba1\u7406\u53d8\u5f97\u7b80\u5355 <\/strong><\/h2>\n<p>\u5c06\u6240\u6709\u5bb9\u5668\u4fe1\u606f\u653e\u5728\u4e00\u4e2a\u5730\u65b9\uff0c\u5e76\u4e14\u7ba1\u7406\u53ea\u9700\u8981\u51e0\u4e2a\u6309\u952e\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5730\u4fdd\u6301\u60a8\u5e9e\u5927\u7684\u865a\u62df\u6e2f\u53e3\u66f4\u6709\u7ec4\u7ec7\u6027\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5bf9Docker\u4e0d\u518d\u611f\u5174\u8da3\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u66ff\u4ee3\u7684\u5bb9\u5668\u7ba1\u7406\u7cfb\u7edf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker\u548cDocker Compose\u662f\u6613\u4e8e\u4f7f\u7528\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5728\u9694\u79bb\u7684\u73af\u5883\u4e2d\u7b80\u5355\u5730\u90e8\u7f72\u8f6f\u4ef6\u3002\u4f46\u662f\uff0c &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[877,1370],"class_list":["post-21846","post","type-post","status-publish","format-standard","hentry","category-linux","tag-docker","tag-lazydocker"],"aioseo_notices":[],"views":816,"_links":{"self":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/21846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/comments?post=21846"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/21846\/revisions"}],"predecessor-version":[{"id":21852,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/21846\/revisions\/21852"}],"wp:attachment":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/media?parent=21846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/categories?post=21846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/tags?post=21846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}