{"id":36,"date":"2024-03-06T17:52:57","date_gmt":"2024-03-06T09:52:57","guid":{"rendered":"http:\/\/www.syu1.cn\/?p=36"},"modified":"2024-03-06T18:19:15","modified_gmt":"2024-03-06T10:19:15","slug":"centos%e5%ae%89%e8%a3%85docker%e4%bb%a5%e5%8f%8adocker-compose","status":"publish","type":"post","link":"http:\/\/www.syu1.cn\/?p=36","title":{"rendered":"CentOS\u5b89\u88c5Docker\u4ee5\u53caDocker Compose"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4f7f\u7528\u5b98\u65b9\u5b89\u88c5\u811a\u672c\u81ea\u52a8\u5b89\u88c5Docker<\/h2>\n\n\n\n<p>\u5b89\u88c5\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncurl -fsSL https:\/\/get.docker.com | bash -s docker --mirror Aliyun\n<\/pre><\/div>\n\n\n<p>\u901a\u8fc7\u67e5\u770bdocker\u7248\u672c\uff0c\u5224\u65ad\u662f\u5426\u5b89\u88c5\u6210\u529f<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker -v \n\nDocker version 18.09.5, build e8ff056\n<\/pre><\/div>\n\n\n<p>\u542f\u52a8docker<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsystemctl start docker\n<\/pre><\/div>\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">\u5b89\u88c5Docker Compose<\/h2>\n\n\n\n<p>\u5b89\u88c5\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncurl -SL https:\/\/github.com\/docker\/compose\/releases\/download\/v2.24.6\/docker-compose-linux-x86_64 -o \/usr\/local\/bin\/docker-compose\n<\/pre><\/div><\/div><\/div>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo ln -s \/usr\/local\/bin\/docker-compose \/usr\/bin\/docker-compose\n<\/pre><\/div>\n\n\n<p>\u6d4b\u8bd5docker compose<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker-compose version\n\nDocker Compose version v2.24.6\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u914d\u7f6e\u56fd\u5185\u955c\u50cf\u52a0\u901f\u6e90<\/h2>\n\n\n\n<p>\u7531\u4e8e\u5f88\u591adocker\u955c\u50cf\u6e90\u90fd\u5728\u56fd\u5916\uff0c\u56fd\u5185\u8bbf\u95ee\u901f\u5ea6\u76f8\u5bf9\u6bd4\u8f83\u6162\uff0c\u5e76\u4e14\u6781\u6613\u65ad\u5f00\u3002\u6211\u4eec\u914d\u7f6e\u56fd\u5185\u4ee3\u7406\u540e\u4f1a\u52a0\u901f\u4e0b\u8f7d\u3002\u6211\u4eec\u9700\u8981\u4fee\u6539\u6216\u65b0\u5efa\u914d\u7f6e\u6587\u4ef6\/etc\/docker\/daemon.json\uff0c\u6267\u884ctee\u547d\u4ee4\u5c06\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u5199\u5165\u6587\u4ef6\u4e2d\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntee \/etc\/docker\/daemon.json &lt;&lt;-&#039;EOF&#039;{\n&quot;registry-mirrors&quot;: &#x5B;\n&quot;https:\/\/docker.m.daocloud.io&quot;,\n&quot;https:\/\/dockerproxy.com&quot;,\n&quot;https:\/\/docker.mirrors.sjtug.sjtu.edu.cn&quot;,\n&quot;https:\/\/docker.nju.edu.cn&quot;\n] } EOF\n<\/pre><\/div>\n\n\n<p>\u5c06\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5230daemon\u4e2d\uff0c\u5e76\u6267\u884c\u91cd\u542f\u547d\u4ee4\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsystemctl daemon-reload\nsystemctl restart docker\n<\/pre><\/div>\n\n\n<p>\u786e\u8ba4\u914d\u7f6e\u7684\u955c\u50cf\u5730\u5740\u662f\u5426\u751f\u6548<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker info\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u5b98\u65b9\u5b89\u88c5\u811a\u672c\u81ea\u52a8\u5b89\u88c5Docker \u5b89\u88c5\u547d\u4ee4\u5982\u4e0b\uff1a \u901a\u8fc7\u67e5\u770bdocker\u7248\u672c\uff0c\u5224\u65ad\u662f\u5426\u5b89\u88c5\u6210\u529f \u542f\u52a8dock [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[],"class_list":["post-36","post","type-post","status-publish","format-standard","hentry","category-docker","category-zhishi"],"_links":{"self":[{"href":"http:\/\/www.syu1.cn\/index.php?rest_route=\/wp\/v2\/posts\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.syu1.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.syu1.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.syu1.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.syu1.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36"}],"version-history":[{"count":4,"href":"http:\/\/www.syu1.cn\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions"}],"predecessor-version":[{"id":42,"href":"http:\/\/www.syu1.cn\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions\/42"}],"wp:attachment":[{"href":"http:\/\/www.syu1.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.syu1.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.syu1.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}