{"id":958,"date":"2021-07-29T18:00:34","date_gmt":"2021-07-29T10:00:34","guid":{"rendered":"https:\/\/egonlin.com\/?p=958"},"modified":"2021-07-29T18:00:34","modified_gmt":"2021-07-29T10:00:34","slug":"%e7%ac%ac%e4%ba%8c%e8%8a%82%ef%bc%9adocker%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/egonlin.com\/?p=958","title":{"rendered":"\u7b2c\u4e8c\u8282\uff1adocker\u5b89\u88c5"},"content":{"rendered":"<h1>docker\u7684\u5b89\u88c5<\/h1>\n<h2>\u4e00\u3001\u5982\u679c\u4e4b\u524d\u5b89\u88c5\u8fc7docker\uff0c\u5378\u8f7d<\/h2>\n<pre><code class=\"language-bash\">yum remove docker docker-common docker-selinux docker-engine -y<\/code><\/pre>\n<h2>\u4e8c\u3001\u66f4\u65b0yum\u6e90<\/h2>\n<pre><code class=\"language-bash\">curl -o \/etc\/yum.repos.d\/CentOS-Base.repo https:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo<\/code><\/pre>\n<h2>\u4e09\u3001\u5982\u679c\u662f\u65b0\u5b89\u88c5\u7684\u7cfb\u7edf\uff0c\u53ef\u4ee5\u66f4\u65b0\u64cd\u4f5c\u7cfb\u7edf\u548c\u5185\u6838<\/h2>\n<pre><code class=\"language-bash\">yum update -y<\/code><\/pre>\n<h2>\u56db\u3001\u6dfb\u52a0docker-ce yum\u6e90<\/h2>\n<pre><code class=\"language-bash\">wget -O \/etc\/yum.repos.d\/docker-ce.repo https:\/\/repo.huaweicloud.com\/docker-ce\/linux\/centos\/docker-ce.repo\n\n# \u6e05\u9664rpm\u5305\u53caheader\nyum clean all\n\n# \u91cd\u65b0\u7f13\u5b58\u8fdc\u7aef\u670d\u52a1\u5668rpm\u5305\u4fe1\u606f\nyum makecache<\/code><\/pre>\n<h2>\u4e94\u3001\u6dfb\u52a0\u963f\u91cc\u4e91\u955c\u50cf\u52a0\u901f\u5668<\/h2>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/1-28.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/1-28.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/2-27.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/2-27.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/3-26.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  data-original=\"https:\/\/egonlin.com\/wp-content\/uploads\/2021\/07\/3-26.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/p>\n<pre><code class=\"language-bash\">mkdir -p \/etc\/docker\ntee \/etc\/docker\/daemon.json &lt;&lt;-&#039;EOF&#039;\n{\n  &quot;registry-mirrors&quot;: [&quot;https:\/\/qi3pe2qe.mirror.aliyuncs.com&quot;]\n}\nEOF\nsystemctl daemon-reload<\/code><\/pre>\n<h2>\u516d\u3001\u5b89\u88c5Docker<\/h2>\n<pre><code class=\"language-bash\">yum install docker-ce -y<\/code><\/pre>\n<h2>\u4e03\u3001\u542f\u52a8\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/h2>\n<pre><code class=\"language-bash\">[root@docker01 ~]# systemctl start docker\n[root@docker01 ~]# systemctl enable docker\n<\/code><\/pre>\n<h2>\u516b\u3001\u68c0\u67e5docker\u662f\u5426\u542f\u52a8\u6210\u529f<\/h2>\n<pre><code class=\"language-bash\">[root@docker01 ~]# docker info\n[root@docker01 ~]# docker version<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>docker\u7684\u5b89\u88c5 \u4e00\u3001\u5982\u679c\u4e4b\u524d\u5b89\u88c5\u8fc7docker\uff0c\u5378\u8f7d yum remove docker docker-c [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":960,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[120],"tags":[21,133,134,135,19,22,132,20],"_links":{"self":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/958"}],"collection":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=958"}],"version-history":[{"count":0,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/posts\/958\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=\/wp\/v2\/media\/960"}],"wp:attachment":[{"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=958"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=958"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/egonlin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=958"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}