{"id":4404,"date":"2019-07-11T11:44:15","date_gmt":"2019-07-11T03:44:15","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=4404"},"modified":"2019-07-11T11:44:15","modified_gmt":"2019-07-11T03:44:15","slug":"docker-compose-%e7%9a%84%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4404","title":{"rendered":"Docker-Compose \u7684\u5b89\u88c5\u6559\u7a0b"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4e0a\u4e2a\u661f\u671f\uff0c\u5f88\u591a\u4e70 ES \u8bfe\u7a0b\u7684\u4eba\uff0c\u5728\u89c6\u9891\u6559\u7a0b\u7684\u7b2c\u4e03\u8bb2\u88ab\u96be\u4f4f\u4e86\u3002\u8fd9\u662f\u4e3a\u4ec0\u4e48\u5462\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4e13\u95e8\u82b1\u65f6\u95f4\u8dd1\u53bb\u770b\u4e86\u7b2c\u4e03\u8bb2\uff0c\u6211\u53d1\u73b0\uff0c\u8001\u5e08\u518d\u8bb2 Docker \u5b89\u88c5 Elastcsearch \u65f6\uff0c\u76f4\u63a5\u628a\u5b89\u88c5 Docker \u548c Docker-Compose \u7684\u6b65\u9aa4\u7565\u8fc7\u4e86\uff0c\u56e0\u6b64\uff0c\u9020\u6210\u4e86\u5f88\u591a\u4eba\u7559\u8a00\uff0c\u8bf4\u5b89\u88c5\u4e0d\u6210\u529f\u3002\u8fd9\u5c31\u662f\u5f80\u5f80\u4f60\u8ba4\u4e3a\u5f88\u7b80\u5355\u7684\u4e1c\u897f\uff0c\u4e0d\u8d77\u773c\u7684\u4e1c\u897f\uff0c\u53ef\u80fd\u5bf9\u521d\u5b66\u8005\u6765\u8bf4\uff0c\u5c31\u662f\u4e00\u4e2a\u5927\u96be\u9898\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\uff0c\u6211\u8fd9\u91cc\u4e13\u95e8\u62bd\u51fa\u4e00\u70b9\u65f6\u95f4\uff0c\u6765\u5e2e\u52a9\u4e00\u90e8\u5206\u4eba\u5b8c\u6210 Docker-Compose \u7684\u5b89\u88c5\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws4.sinaimg.cn\/large\/8fa5dcfcgy1g4vqyjpck0j20ds08rmxv.jpg\" alt=\"\" \/><figcaption>4 \u79cd\u59ff\u52bf\u5b89\u88c5 Docker-Compose<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5df2\u7ecf\u89e3\u91ca\u8fc7\uff0cDocker \u7684\u5b89\u88c5\u4e86\u3002\u56e0\u6b64\u5b89\u88c5 Docker-Compose \u5c31\u663e\u5f97\u975e\u5e38\u7684\u7b80\u5355\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c\u4e00\u79cd\u5b89\u88c5\u529e\u6cd5\u5c31\u662f\u4f7f\u7528 docker pull docker-compose \u8fdb\u884c\u5b89\u88c5\u3002\u56e0\u4e3a\u6211\u4eec\u5df2\u7ecf\u5b89\u88c5\u4e86 Docker \u4e86\uff0c\u6240\u4ee5\u6ca1\u5fc5\u8981\u5728\u53bb\u91c7\u7528\u5176\u4ed6\u7684\u5b89\u88c5\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7136\u8fd9\u79cd\u65b9\u6cd5\u7684\u7f3a\u70b9\u5c31\u662f\uff0cDocker \u7528\u7684\u4e0d\u719f\u7684\u8bdd\uff0c\u5bb9\u6613\u51fa\u9519\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u65f6\u4f60\u5c31\u53ef\u4ee5\u91c7\u7528\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u6765\u5b89\u88c5\u4e86\u3002\u5728\u7ebf\u5b89\u88c5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\uff0c\u4e0b\u8f7d\u4e00\u4e2a Docker-Compose\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo curl -L \"https:\/\/github.com\/docker\/compose\/releases\/download\/1.23.2\/docker-compose-$(uname -s)-$(uname -m)\" -o \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\uff0c\u4fee\u6539\u6587\u4ef6\u7684\u6267\u884c\u6743\u9650\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u81f3\u6b64\uff0c\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u5c31\u4ecb\u7ecd\u5b8c\u4e86\uff0c\u4f46\u662f\u8fd9\u79cd\u5b89\u88c5\u65b9\u6cd5\u7f3a\u70b9\u4e5f\u5f88\u660e\u663e\uff0c\u5c31\u662f\u4ece github \u4e0b\u8f7d\u6587\u4ef6\u7684\u8bdd\uff0c\u975e\u5e38\u7684\u6162\uff0c\u5f88\u5bb9\u6613\u5931\u8d25\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\uff0c\u6709\u5728\u7ebf\u5b89\u88c5\uff0c\u90a3\u4e00\u5b9a\u5c31\u4f1a\u6709\u79bb\u7ebf\u5b89\u88c5\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u53ef\u4ee5\u5148\u5728 https:\/\/github.com\/docker\/compose\/releases \u9009\u62e9\u4e00\u4e2a\u7248\u672c\uff0c\u7ed9\u5b83\u4e0b\u8f7d\u4e0b\u6765\u3002\u7136\u540e\uff0c\u4f60\u5728\u4f7f\u7528 Linux \u7684 FTP \u7b49\u5f62\u5f0f\u4e2a\u5b83\u4e0a\u4f20\u5230\u4f60\u7684\u670d\u52a1\u5668\u4e2d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\uff0c\u6211\u73b0\u5728\u4e0a\u4f20\u5230\u4e86 \/home\/xttblog\/docker-compose \u76ee\u5f55\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u4e48\uff0c\u6211\u5c31\u53ef\u4ee5\u5c06 Docker-Compose \u79fb\u52a8\u5230 bin \u76ee\u5f55\u5e76\u66f4\u6539\u6267\u884c\u6743\u9650\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv \/home\/xttblog\/docker-compose\/docker-compose-Linux-x86_64 \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\uff0c\u4fee\u6539\u6587\u4ef6\u7684\u6267\u884c\u6743\u9650\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo chmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\uff0c\u6267\u884c docker-compose version\uff0c\u67e5\u770b\u662f\u5426\u5b89\u88c5 OK \u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u6709\u4e00\u79cd\u5b89\u88c5\u65b9\u6cd5\uff0c\u90a3\u5c31\u662f\u901a\u8fc7 pip \u5728\u7ebf\u5b89\u88c5\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ea\u9700\u51e0\u884c\u547d\u4ee4\u5c31\u641e\u5b9a\u4e86\uff0c\u6df1\u53d7\u5927\u5bb6\u559c\u6b22\uff0c\u4e5f\u662f\u5b98\u65b9\u63a8\u8350\u7684\u4e00\u79cd\u5b89\u88c5\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Docker-Compose \u53ef\u4ee5\u901a\u8fc7 python \u7684 pip \u5de5\u5177\u8fdb\u884c\u5b89\u88c5\u3002\u6240\u4ee5\uff0c\u9700\u8981\u5148\u5b89\u88c5\u597d pip \u5de5\u5177\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u5b89\u88c5\u4f9d\u8d56\nyum -y install epel-release\n#\u5b89\u88c5PIP\nyum -y install python-pip\n#\u5347\u7ea7PIP\npip install --upgrade pip<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c pip \u540e\uff0c\u67e5\u770b\u7248\u672c\u53f7\u9a8c\u8bc1\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\uff0c\u5c31\u53ef\u4ee5\u6b63\u5f0f\u5b89\u88c5 Docker-Compose \u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -U docker-compose==1.23.2<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u540c\u6837\u7684\u6267\u884c docker-compose \u2014version \u67e5\u770b\u7248\u672c\u3002\u9a8c\u8bc1\u662f\u5426\u5b89\u88c5\u6b63\u786e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u81f3\u6b64\uff0c\u6211\u5df2\u7ecf\u6559\u4f60\u4e86 4 \u79cd\u5b89\u88c5\u65b9\u6cd5\uff0c\u5e0c\u671b\u80fd\u591f\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4404\">Docker-Compose \u7684\u5b89\u88c5\u6559\u7a0b<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e2a\u661f\u671f\uff0c\u5f88\u591a\u4e70 ES \u8bfe\u7a0b\u7684\u4eba\uff0c\u5728\u89c6\u9891\u6559\u7a0b\u7684\u7b2c\u4e03\u8bb2\u88ab\u96be\u4f4f\u4e86\u3002\u8fd9\u662f\u4e3a\u4ec0\u4e48\u5462\uff1f \u6211\u4e13\u95e8\u82b1\u65f6\u95f4\u8dd1\u53bb\u770b\u4e86\u7b2c\u4e03\u8bb2\uff0c\u6211\u53d1 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[512,1136,1137,1716,1134],"class_list":["post-4404","post","type-post","status-publish","format-standard","hentry","category-java","tag-docker","tag-docker-compose","tag-docker-swarm","tag-kubernetes","tag-1134"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4404"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4404\/revisions"}],"predecessor-version":[{"id":4405,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4404\/revisions\/4405"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}