{"id":129,"date":"2023-02-28T19:18:00","date_gmt":"2023-02-28T11:18:00","guid":{"rendered":"http:\/\/47.107.115.238\/?p=129"},"modified":"2024-09-15T15:26:39","modified_gmt":"2024-09-15T07:26:39","slug":"docker","status":"publish","type":"post","link":"https:\/\/lxylp.com\/?p=129","title":{"rendered":"docker"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_69_1 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/lxylp.com\/?p=129\/#%E5%AE%89%E8%A3%85Docker\" title=\"\u5b89\u88c5Docker\">\u5b89\u88c5Docker<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/lxylp.com\/?p=129\/#%E5%AE%89%E8%A3%85\" title=\"\u5b89\u88c5\">\u5b89\u88c5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/lxylp.com\/?p=129\/#%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1%E5%B9%B6%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF%E5%8A%A8\" title=\"\u542f\u52a8\u670d\u52a1\u5e76\u5f00\u673a\u81ea\u542f\u52a8\">\u542f\u52a8\u670d\u52a1\u5e76\u5f00\u673a\u81ea\u542f\u52a8<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/lxylp.com\/?p=129\/#%E7%A1%AE%E8%AE%A4%E5%AE%89%E8%A3%85%E7%89%88%E6%9C%AC\" title=\"\u786e\u8ba4\u5b89\u88c5\u7248\u672c\">\u786e\u8ba4\u5b89\u88c5\u7248\u672c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/lxylp.com\/?p=129\/#%E9%85%8D%E7%BD%AE%E7%94%A8%E6%88%B7\" title=\"\u914d\u7f6e\u7528\u6237\">\u914d\u7f6e\u7528\u6237<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/lxylp.com\/?p=129\/#%E9%85%8D%E7%BD%AE%E9%95%9C%E5%83%8F\" title=\"\u914d\u7f6e\u955c\u50cf\">\u914d\u7f6e\u955c\u50cf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/lxylp.com\/?p=129\/#%E9%97%AE%E9%A2%98\" title=\"\u95ee\u9898\">\u95ee\u9898<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/lxylp.com\/?p=129\/#is_the_docker_daemon_runing\" title=\"is the docker daemon runing?\">is the docker daemon runing?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>Docker \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5e94\u7528\u5bb9\u5668\u5f15\u64ce\uff0c\u8ba9\u5f00\u53d1\u8005\u53ef\u4ee5\u6253\u5305\u4ed6\u4eec\u7684\u5e94\u7528\u4ee5\u53ca\u4f9d\u8d56\u5305\u5230\u4e00\u4e2a\u53ef\u79fb\u690d\u7684\u5bb9\u5668\u4e2d,\u7136\u540e\u53d1\u5e03\u5230\u4efb\u4f55\u6d41\u884c\u7684Linux\u6216Windows\u64cd\u4f5c\u7cfb\u7edf\u7684\u673a\u5668\u4e0a,\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u865a\u62df\u5316,\u5bb9\u5668\u662f\u5b8c\u5168\u4f7f\u7528\u6c99\u7bb1\u673a\u5236,\u76f8\u4e92\u4e4b\u95f4\u4e0d\u4f1a\u6709\u4efb\u4f55\u63a5\u53e3\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><br>\u4e00\u4e2a\u5b8c\u6574\u7684Docker\u6709\u4ee5\u4e0b\u51e0\u4e2a\u90e8\u5206\u7ec4\u6210\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>DockerClient\u5ba2\u6237\u7aef<\/li>\n\n\n\n<li>Docker Daemon\u5b88\u62a4\u8fdb\u7a0b<\/li>\n\n\n\n<li>Docker Image\u955c\u50cf<\/li>\n\n\n\n<li>DockerContainer\u5bb9\u5668<\/li>\n<\/ul>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%89%E8%A3%85Docker\"><\/span>\u5b89\u88c5Docker<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u66f4\u65b0\u7cfb\u7edf\uff0c\u786e\u4fdd\u7cfb\u7edf\u4e3a\u6700\u65b0\u72b6\u6001<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pacman -Syu<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%89%E8%A3%85\"><\/span>\u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo pacman -S docker<\/code><\/pre>\n\n\n\n<p>\u4e5f\u53ef\u4ee5\u7528yay\u5b89\u88c5\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yay -S docker<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1%E5%B9%B6%E5%BC%80%E6%9C%BA%E8%87%AA%E5%90%AF%E5%8A%A8\"><\/span>\u542f\u52a8\u670d\u52a1\u5e76\u5f00\u673a\u81ea\u542f\u52a8<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start docker<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable docker<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%A1%AE%E8%AE%A4%E5%AE%89%E8%A3%85%E7%89%88%E6%9C%AC\"><\/span>\u786e\u8ba4\u5b89\u88c5\u7248\u672c<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker version<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE%E7%94%A8%E6%88%B7\"><\/span>\u914d\u7f6e\u7528\u6237<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u9ed8\u8ba4\u53ea\u6709root\u7528\u6237\u53ef\u4ee5\u7ba1\u7406Docker\uff0c\u53ef\u8fd0\u884c\u4e0b\u5217\u547d\u4ee4\u5c06\u5f53\u524d\u7528\u6237\u8d4b\u4e88\u7ba1\u7406\u6743\u9650<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo usermod -aG docker $USER<\/code><\/pre>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE%E9%95%9C%E5%83%8F\"><\/span>\u914d\u7f6e\u955c\u50cf<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u9ed8\u8ba4\u7684\u955c\u50cf\u4e0b\u8f7d\u7ad9\u70b9\u662f\u5728\u6d77\u5916\uff0c\u5207\u6362\u5230\u56fd\u5185\u955c\u50cf\u7ad9\u70b9\u53ef\u4ee5\u63d0\u9ad8\u4e0b\u8f7d\u901f\u5ea6\u3002<\/p>\n\n\n\n<p>\u6253\u5f00\u6216\u65b0\u5efa<code>\/etc\/docker\/daemon.json<\/code>\u6587\u4ef6\uff0c\u5c06\u955c\u50cf\u5730\u5740\u6dfb\u52a0\u5230 <code>registry-mirrors<\/code>\u6570\u7ec4\u91cc\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"registry-mirrors\": &#91;\n        \"https:\/\/registry.docker-cn.com\"\n    ]\n}<\/code><\/pre>\n\n\n\n<p>ref: <a href=\"https:\/\/www.jianshu.com\/p\/7753e124b65c\">jianshu<\/a><\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%97%AE%E9%A2%98\"><\/span>\u95ee\u9898<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"is_the_docker_daemon_runing\"><\/span>is the docker daemon runing?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start docker.sevice<\/code><\/pre>\n\n\n\n<p>\u6c38\u4e45\u6027\u89e3\u51b3\u95ee\u9898<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl enable docker.service<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Docker \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5e94\u7528\u5bb9&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":373,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[10],"class_list":["post-129","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-10"],"_links":{"self":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=129"}],"version-history":[{"count":1,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions\/130"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=\/wp\/v2\/media\/373"}],"wp:attachment":[{"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lxylp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}