{"id":50034,"date":"2025-07-30T20:53:20","date_gmt":"2025-07-30T12:53:20","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/50034.html"},"modified":"2025-07-30T20:53:20","modified_gmt":"2025-07-30T12:53:20","slug":"%e9%98%bf%e9%87%8c%e4%ba%91%e8%bd%bb%e9%87%8f%e7%ba%a7%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8adocker-compose%e7%9a%84%e5%ae%89%e8%a3%85%e6%95%99%e7%a8%8b-%e5%8d%81%e4%ba%8c%e6%9c%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/50034.html","title":{"rendered":"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708"},"content":{"rendered":"<p style=\"background-color:transparent\">\u4f7f\u7528\u5230\u7684\u670d\u52a1\u5668\u7248\u672c&#xff1a;<\/p>\n<p style=\"background-color:transparent\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1329\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125259-688a15ab443ee.png\" width=\"2103\" \/><br \/>\n\u914d\u7f6e&#xff1a;2\u68382G&#xff1b;<\/p>\n<p style=\"background-color:transparent\">\u7cfb\u7edf\u4e3a&#xff1a;Alibaba Cloud Linux 3.21.04<\/p>\n<p>\u00a0\u4f7f\u7528\u5230\u7684\u8fdc\u7a0b\u8fde\u63a5\u8f6f\u4ef6&#xff1a;MobaXterm_Personal<\/p>\n<h4>\u6b63\u6587<\/h4>\n<h5>1. \u5f15\u8a00<\/h5>\n<ul>\n<li>1.1 \u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u7b80\u4ecb&#xff1a;\u8f7b\u91cf\u3001\u6613\u7528\u3001\u9002\u5408\u5bb9\u5668\u5316\u90e8\u7f72<\/li>\n<li>1.2 docker-compose\u7684\u4f5c\u7528&#xff1a;\u7b80\u5316\u591a\u5bb9\u5668\u5e94\u7528\u7ba1\u7406<\/li>\n<li>1.3 \u672c\u6587\u76ee\u6807&#xff1a;\u6307\u5bfc\u4ece\u96f6\u5b89\u88c5\u5230\u5b9e\u6218\u4f7f\u7528<\/li>\n<\/ul>\n<h5>2. \u51c6\u5907\u5de5\u4f5c<\/h5>\n<ul>\n<li>2.1 \u521b\u5efa\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u5b9e\u4f8b\n<ul>\n<li>\u914d\u7f6e\u5b89\u5168\u7ec4&#xff08;\u5f00\u653e\u7aef\u53e322&#xff0c;3306&#xff09;<\/li>\n<li><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1022\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125302-688a15ae3e598.png\" width=\"2481\" \/><br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1206\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125304-688a15b030d45.png\" width=\"2178\" \/><\/li>\n<\/ul>\n<\/li>\n<li>2.2 \u8fde\u63a5\u5230\u670d\u52a1\u5668\n<ul>\n<li>\u6253\u5f00SSH\u5de5\u5177&#xff08;MobaXterm_Personal&#xff09;<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1106\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125306-688a15b24d3aa.png\" width=\"1650\" \/><br \/>\n1.\u70b9\u51fb\u4f1a\u8bdd&#xff0c;\u521b\u5efa\u4e00\u4e2a\u65b0\u7684session&#xff1b;<br \/>\n2.\u70b9\u51fbSSH&#xff1b;<br \/>\n3.\u4f7f\u7528\u963f\u91cc\u4e91\u670d\u52a1\u5668\u5b9e\u4f8b\u7684\u516c\u7f51IP&#xff08;\u5728\u963f\u91cc\u4e91\u63a7\u5236\u53f0\u67e5\u770b&#xff09;&#xff0c;\u8f93\u5165\u670d\u52a1\u5668\u8fde\u63a5\u7684\u8d26\u53f7\u548c\u5bc6\u7801&#xff1b;<br \/>\n4.\u9009\u62e9\u7aef\u53e322\u53f7&#xff0c;\u70b9\u51fbok\u5373\u53ef&#xff0c;\u51fa\u73b0\u4e0b\u9762\u754c\u9762\u8bf4\u660e\u5df2\u7ecf\u6210\u529f\u8fde\u63a5\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1106\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125307-688a15b3b1806.png\" width=\"1650\" \/><\/p>\n<p>\u00a0<\/p>\n<\/li>\n<\/ul>\n<h5>3. \u5b89\u88c5Docker\u5f15\u64ce<\/h5>\n<ul>\n<li>1.\u5b89\u88c5net-tools\u5de5\u5177<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u7528\u00a0yum\u00a0\u5305\u7ba1\u7406\u5668\u5b89\u88c5\u00a0net-tools\u00a0\u5de5\u5177\u96c6\u3002<\/p>\n<p>\u5173\u952e\u53c2\u6570&#xff1a;-y\u00a0\u81ea\u52a8\u786e\u8ba4\u5b89\u88c5\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;\u83b7\u53d6\u57fa\u7840\u7f51\u7edc\u5de5\u5177&#xff08;\u5982\u00a0ifconfig\u3001netstat&#xff09;\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b<\/p>\n<p>yum install net-tools -y<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"246\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125309-688a15b557828.png\" width=\"1643\" \/><\/p>\n<p>\u672c\u6b21\u4f7f\u7528\u7684\u7cfb\u7edf\u81ea\u5e26\u8be5\u5de5\u5177\u3002<\/p>\n<ul>\n<li>2.\u5b89\u88c5\u4f9d\u8d56\u5305<br \/>\n\u00a0<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u5b89\u88c5 Docker \u6240\u9700\u7684\u4f9d\u8d56\u5305&#xff1a;<\/p>\n<p>yum-utils&#xff1a;\u63d0\u4f9b\u00a0yum-config-manager\u00a0\u5de5\u5177\u3002<\/p>\n<p>device-mapper-persistent-data\u00a0\u548c\u00a0lvm2&#xff1a;\u5b58\u50a8\u9a71\u52a8\u4f9d\u8d56\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;\u4e3a\u5b89\u88c5 Docker \u51c6\u5907\u73af\u5883\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>yum install -y yum-utils device-mapper-persistent-data lvm2<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1134\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125309-688a15b5ce94e.png\" width=\"1647\" \/><\/p>\n<ul>\n<li>3.\u6dfb\u52a0Docker\u4ed3\u5e93<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u6dfb\u52a0 Docker \u5b98\u65b9 YUM \u4ed3\u5e93\u3002<\/p>\n<p>\u4f9d\u8d56&#xff1a;yum-utils&#xff08;\u7531\u4e0a\u4e00\u6b65\u5b89\u88c5&#xff09;\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;\u5141\u8bb8\u901a\u8fc7\u00a0yum\u00a0\u5b89\u88c5 Docker CE&#xff08;\u793e\u533a\u7248&#xff09;\u3002<\/p>\n<p>yum-config-manager &#8211;add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<\/p>\n<p>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1151\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125311-688a15b740bcb.png\" width=\"1644\" \/><br \/>\n\u00a0<\/p>\n<ul>\n<li>4.\u67e5\u770bdocker\u5217\u8868<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;<\/p>\n<p>\u5217\u51fa\u6240\u6709\u53ef\u7528\u7248\u672c\u7684 Docker CE \u5305&#xff08;x86_64\u00a0\u67b6\u6784&#xff09;\u3002<\/p>\n<p>\u5012\u5e8f\u6392\u5e8f&#xff08;sort -r&#xff09;\u3002<\/p>\n<p>\u8fc7\u6ee4\u51fa\u7a33\u5b9a\u7248&#xff08;grep stable&#xff09;\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;\u67e5\u770b\u53ef\u5b89\u88c5\u7684 Docker \u7a33\u5b9a\u7248\u672c&#xff0c;\u4fbf\u4e8e\u9009\u62e9\u7279\u5b9a\u7248\u672c\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>yum list docker-ce.x86_64 &#8211;showduplicates | sort -r | grep stable<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1154\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125312-688a15b85985e.png\" width=\"1656\" \/><br \/>\n\u6b64\u6b21\u6211\u4eec\u5b89\u88c5\u7684\u662f\u6700\u65b0\u7248\u3002<\/p>\n<ul>\n<li>5.docker\u7684\u5b89\u88c5<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u5b89\u88c5 Docker CE \u793e\u533a\u7248&#xff08;\u672a\u6307\u5b9a\u7248\u672c&#xff0c;\u9ed8\u8ba4\u5b89\u88c5\u6700\u65b0\u7a33\u5b9a\u7248&#xff09;\u3002<\/p>\n<p>\u4f9d\u8d56&#xff1a;\u5df2\u914d\u7f6e Docker \u5b98\u65b9\u4ed3\u5e93&#xff08;\u7b2c 9 \u6b65&#xff09;\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>yum install docker-ce<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1133\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125313-688a15b96f3b7.png\" width=\"1643\" \/><br \/>\n\u53ef\u80fd\u4f1a\u51fa\u73b0\u4ee5\u4e0b\u62a5\u9519&#xff1a;<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1133\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125314-688a15ba6170e.png\" width=\"1283\" \/><\/p>\n<p>\u7b80\u5355\u8bf4&#xff0c;\u5c31\u662f\u5b89\u88c5 Docker \u793e\u533a\u7248&#xff08;docker-ce\u00a0&#xff09;\u65f6&#xff0c;\u56e0\u65e0\u6cd5\u4ece\u955c\u50cf\u6e90\u5efa\u7acb SSL \u8fde\u63a5\u83b7\u53d6\u5b89\u88c5\u5305&#xff0c;\u5bfc\u81f4\u5b89\u88c5\u5931\u8d25&#xff0c;\u540e\u7eed\u53ef\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\u3001\u955c\u50cf\u6e90\u914d\u7f6e&#xff08;\u6bd4\u5982\u6362\u56fd\u5185\u53ef\u7528\u7684 Docker \u955c\u50cf\u6e90&#xff09;\u3001SSL \u8bc1\u4e66\u7b49\u65b9\u9762\u6392\u67e5\u89e3\u51b3 \u3002<\/p>\n<p>\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u5c31\u662f&#xff0c;\u8fc7\u4f1a\u518d\u6b21\u6267\u884c\u5b89\u88c5\u547d\u4ee4\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1133\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125314-688a15baeabe9.png\" width=\"1283\" \/><\/p>\n<p>\u518d\u6b21\u8f93\u5165y\u786e\u8ba4\u5b89\u88c5\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1133\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125315-688a15bb75c7a.png\" width=\"1283\" \/><\/p>\n<p>\u770b\u5230Complete&#xff0c;\u8bf4\u660e\u5b89\u88c5\u5b8c\u6bd5\u3002\u8f93\u5165docker -v &#xff0c;\u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u5b89\u88c5\u7684\u7248\u672c<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1133\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125315-688a15bbf3ce7.png\" width=\"1283\" \/><\/p>\n<ul>\n<li>6.\u542f\u52a8docker\u5b88\u62a4\u8fdb\u7a0b<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u542f\u52a8 Docker \u5b88\u62a4\u8fdb\u7a0b\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;\u542f\u7528 Docker \u670d\u52a1&#xff0c;\u5141\u8bb8\u8fd0\u884c\u5bb9\u5668\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b&#xff08;\u6ce8\u610f&#xff1a;\u6b64\u884c\u547d\u4ee4\u6267\u884c\u6210\u529f\u540e\u4e0d\u4f1a\u6709\u4efb\u4f55\u63d0\u793a&#xff09;&#xff1a;<\/p>\n<p>systemctl start docker<\/p>\n<p>\u81ea\u6b64docker\u5df2\u7ecf\u5b89\u88c5\u5b8c\u6bd5&#xff01;<\/p>\n<ul>\n<li>7.\u5207\u6362\u76ee\u5f55<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u5207\u6362\u5de5\u4f5c\u76ee\u5f55\u5230\u00a0\/etc\/docker\/&#xff08;Docker \u7684\u914d\u7f6e\u76ee\u5f55&#xff09;\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;\u51c6\u5907\u4fee\u6539 Docker \u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>cd \/etc\/docker\/<\/p>\n<p>ls -al<\/p>\n<p>\u64cd\u4f5c&#xff1a;\u5217\u51fa\u5f53\u524d\u76ee\u5f55&#xff08;\/etc\/docker\/&#xff09;\u4e0b\u6240\u6709\u6587\u4ef6\/\u76ee\u5f55\u7684\u8be6\u7ec6\u4fe1\u606f&#xff08;\u5305\u62ec\u9690\u85cf\u6587\u4ef6&#xff09;\u3002<\/p>\n<p>\u53c2\u6570&#xff1a;<br \/>\n-a&#xff1a;\u663e\u793a\u9690\u85cf\u6587\u4ef6&#xff08;\u4ee5\u00a0.\u00a0\u5f00\u5934\u7684\u6587\u4ef6&#xff09;\u3002<br \/>\n-l&#xff1a;\u957f\u683c\u5f0f\u663e\u793a&#xff08;\u6743\u9650\u3001\u6240\u6709\u8005\u3001\u5927\u5c0f\u3001\u4fee\u6539\u65f6\u95f4\u7b49&#xff09;\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;\u67e5\u770b\u76ee\u5f55\u5185\u5bb9&#xff0c;\u786e\u8ba4\u662f\u5426\u5b58\u5728\u00a0daemon.json\u00a0\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<ul>\n<li>8.\u914d\u7f6e\u955c\u50cf\u52a0\u901f<br \/>\n\u00a0<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;<\/p>\n<p>tee \/etc\/docker\/daemon.json&#xff1a;\u5c06\u6807\u51c6\u8f93\u5165\u7684\u5185\u5bb9\u5199\u5165\u6587\u4ef6\u00a0\/etc\/docker\/daemon.json&#xff08;\u82e5\u6587\u4ef6\u5b58\u5728\u5219\u8986\u76d6&#xff09;\u3002<\/p>\n<p>&lt;&lt;-&#039;EOF&#039;&#xff1a;Here Document \u8bed\u6cd5&#xff0c;\u5c06\u4e24\u4e2a\u00a0EOF\u00a0\u4e4b\u95f4\u7684\u5185\u5bb9\u4f5c\u4e3a\u8f93\u5165&#xff08;-\u00a0\u8868\u793a\u5ffd\u7565\u5185\u5bb9\u4e2d\u7684\u7f29\u8fdb&#xff09;\u3002<\/p>\n<p>\u914d\u7f6e\u5185\u5bb9&#xff1a;\u5411\u00a0daemon.json\u00a0\u6dfb\u52a0\u00a0registry-mirrors\u00a0\u5b57\u6bb5&#xff0c;\u5305\u542b\u00a07 \u4e2a\u56fd\u5185 Docker \u955c\u50cf\u52a0\u901f\u5668\u5730\u5740&#xff08;\u963f\u91cc\u4e91\u3001\u4e2d\u79d1\u5927\u3001\u5357\u4eac\u5927\u5b66\u7b49&#xff09;\u3002<\/p>\n<p>\u76ee\u7684&#xff1a;<\/p>\n<p>\u89e3\u51b3 Docker Hub \u5b98\u65b9\u6e90\u5728\u56fd\u5185\u62c9\u53d6\u955c\u50cf\u6162\u7684\u95ee\u9898\u3002<\/p>\n<p>\u52a0\u901f\u5bb9\u5668\u955c\u50cf\u4e0b\u8f7d&#xff08;\u540e\u7eed\u6267\u884c\u00a0docker pull\u00a0\u65f6\u4f1a\u4f18\u5148\u4f7f\u7528\u8fd9\u4e9b\u955c\u50cf\u6e90&#xff09;\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b&#xff1a;<\/p>\n<p>tee \/etc\/docker\/daemon.json &lt;&lt;-&#039;EOF&#039;<br \/>\n{<br \/>\n    &#034;registry-mirrors&#034;: [<br \/>\n        &#034;https:\/\/eeyer9qf.mirror.aliyuncs.com&#034;,<br \/>\n        &#034;https:\/\/do.nark.eu.org&#034;,<br \/>\n        &#034;https:\/\/dc.j8.work&#034;,<br \/>\n        &#034;https:\/\/docker.m.daocloud.io&#034;,<br \/>\n        &#034;https:\/\/dockerproxy.com&#034;,<br \/>\n        &#034;https:\/\/docker.mirrors.ustc.edu.cn&#034;,<br \/>\n        &#034;https:\/\/docker.nju.edu.cn&#034;<br \/>\n    ]<br \/>\n}<br \/>\nEOF<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1293\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125316-688a15bc761bc.png\" width=\"2067\" \/><\/p>\n<ul>\n<li>9.\u91cd\u65b0\u52a0\u8f7d\u8fdb\u7a0b\u914d\u7f6e<br \/>\n\u00a0<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u91cd\u65b0\u52a0\u8f7d systemd \u5b88\u62a4\u8fdb\u7a0b\u914d\u7f6e\u3002<\/p>\n<p>\u4f5c\u7528&#xff1a;\u626b\u63cf\u65b0\u7684\u6216\u4fee\u6539\u8fc7\u7684 systemd \u670d\u52a1\u5355\u5143\u6587\u4ef6&#xff08;\u5982\u00a0nginx.service\u3001docker.service&#xff09;\u3002<\/p>\n<p>\u6ce8\u610f&#xff1a;\u6b64\u64cd\u4f5c\u4e0d\u5f71\u54cd\u00a0Docker \u7684\u00a0daemon.json\u00a0\u914d\u7f6e&#xff08;\u8be5\u6587\u4ef6\u7531 Docker \u81ea\u8eab\u8bfb\u53d6&#xff09;\u3002<\/p>\n<p>\u547d\u4ee4\u5982\u4e0b&#xff08;\u6ce8\u610f&#xff1a;\u6b64\u884c\u4ee3\u7801\u6267\u884c\u6210\u529f\u540e\u4e0d\u4f1a\u6709\u4efb\u4f55\u63d0\u793a&#xff09;&#xff1a;<\/p>\n<p>systemctl daemon-reload<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"114\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125318-688a15be46a78.png\" width=\"845\" \/><\/p>\n<ul>\n<li>10.\u91cd\u542f\u670d\u52a1<\/li>\n<\/ul>\n<p>\u64cd\u4f5c&#xff1a;\u91cd\u542f Docker \u670d\u52a1\u3002<\/p>\n<p>\u5173\u952e\u4f5c\u7528&#xff1a;<\/p>\n<p>\u4f7f\u00a0\/etc\/docker\/daemon.json\u00a0\u4e2d\u7684\u955c\u50cf\u52a0\u901f\u5668\u914d\u7f6e\u751f\u6548&#xff08;Docker \u53ea\u4f1a\u5728\u542f\u52a8\u65f6\u52a0\u8f7d\u6b64\u6587\u4ef6&#xff09;\u3002<\/p>\n<p>\u91cd\u542f\u540e&#xff0c;\u6240\u6709\u540e\u7eed\u7684\u00a0docker pull\u00a0\u547d\u4ee4\u5c06\u4f7f\u7528\u914d\u7f6e\u7684\u955c\u50cf\u52a0\u901f\u5668\u3002<\/p>\n<p>\u5fc5\u8981\u6027&#xff1a;\u4fee\u6539 Docker \u914d\u7f6e\u540e\u5fc5\u987b\u91cd\u542f\u670d\u52a1\u624d\u80fd\u751f\u6548\u3002<br \/>\n\u547d\u4ee4\u5982\u4e0b&#xff08;\u6ce8\u610f&#xff1a;\u6b64\u884c\u4ee3\u7801\u6267\u884c\u6210\u529f\u540e\u4e0d\u4f1a\u6709\u4efb\u4f55\u63d0\u793a&#xff09;&#xff1a;<\/p>\n<p>systemctl restart docker<\/p>\n<h5>4. \u5b89\u88c5docker-compose<\/h5>\n<ul>\n<li>4.1 \u4e0b\u8f7ddocker-compose\u4e8c\u8fdb\u5236\u6587\u4ef6\n<p>sudo curl -L &#034;https:\/\/github.com\/docker\/compose\/releases\/download\/v2.23.0\/docker-compose-$(uname -s)-$(uname -m)&#034; -o \/usr\/local\/bin\/docker-compose<\/p>\n<p>\u53ef\u4ee5\u91c7\u7528\u4e0a\u9762\u7684\u547d\u4ee4\u8fdb\u884c\u4e0b\u8f7d&#xff0c;\u4e5f\u53ef\u4ee5\u81ea\u884c\u4e0agithub\u4e0b\u8f7d\u7279\u5b9a\u7248\u672c&#xff0c;\u6b64\u6b21\u4f7f\u7528\u7279\u5b9a\u7248\u672c\u3002<br \/>\n\u4e0b\u8f7d\u5b8c\u6bd5\u540e&#xff0c;\u5e76cd\u8fdb\u8be5\u6587\u4ef6\u5939&#xff0c;\u5e76\u5c06\u4e0b\u8f7d\u7684docker-compose\u653e\u5165\u8be5\u6587\u4ef6\u5939&#xff08;bin&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<p>cd \/usr\/bin<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1146\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125318-688a15be6c9b7.png\" width=\"1653\" \/><br \/>\n\u00a0<\/p>\n<ul>\n<li>4.2 \u8bbe\u7f6e\u6267\u884c\u6743\u9650\n<p>chmod a&#043;x docker-compose<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"467\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125319-688a15bf6241c.png\" width=\"939\" \/><br \/>\n\u81ea\u6b64&#xff0c;docker-compose\u5b89\u88c5\u5b8c\u6bd5&#xff0c;\u8f93\u5165docker-compose -v \u53ef\u4ee5\u67e5\u770b\u5f53\u524d\u7248\u672c<br \/>\n<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"107\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125319-688a15bf8c5dc.png\" width=\"687\" \/><\/p>\n<\/li>\n<\/ul>\n<h5><\/h5>\n<h5><\/h5>\n<h5>5. \u603b\u7ed3<\/h5>\n<ul>\n<li>5.1 \u4f18\u52bf\u603b\u7ed3&#xff1a;\u5feb\u901f\u90e8\u7f72\u3001\u8d44\u6e90\u9ad8\u6548<\/li>\n<li>5.2 \u540e\u7eed\u5b66\u4e60\u5efa\u8bae&#xff08;\u5982Kubernetes\u8fdb\u9636&#xff09;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e29\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u7b80\u4ecb\uff1a\u8f7b\u91cf\u3001\u6613\u7528\u3001\u9002\u5408\u5bb9\u5668\u5316\u90e8\u7f72\uff0c docker-compose\u7684\u4f5c\u7528\uff1a\u7b80\u5316\u591a\u5bb9\u5668\u5e94\u7528\u7ba1\u7406\uff0c\u672c\u6587\u76ee\u6807\uff1a\u6307\u5bfc\u4ece\u96f6\u5b89\u88c5\u5230\u5b9e\u6218\u4f7f\u7528_\u963f\u91cc\u4e91\u955c\u50cf \u4e0b\u8f7d docker-compose<\/p>\n","protected":false},"author":2,"featured_media":50015,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27,1804,43,96],"topic":[],"class_list":["post-50034","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-docker","tag-docker-compose","tag-43","tag-96"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/50034.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e29\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u7b80\u4ecb\uff1a\u8f7b\u91cf\u3001\u6613\u7528\u3001\u9002\u5408\u5bb9\u5668\u5316\u90e8\u7f72\uff0c docker-compose\u7684\u4f5c\u7528\uff1a\u7b80\u5316\u591a\u5bb9\u5668\u5e94\u7528\u7ba1\u7406\uff0c\u672c\u6587\u76ee\u6807\uff1a\u6307\u5bfc\u4ece\u96f6\u5b89\u88c5\u5230\u5b9e\u6218\u4f7f\u7528_\u963f\u91cc\u4e91\u955c\u50cf \u4e0b\u8f7d docker-compose\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/50034.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T12:53:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125259-688a15ab443ee.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50034.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/50034.html\",\"name\":\"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T12:53:20+00:00\",\"dateModified\":\"2025-07-30T12:53:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/50034.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/50034.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/50034.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/50034.html","og_locale":"zh_CN","og_type":"article","og_title":"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e29\u6b21\uff0c\u6536\u85cf27\u6b21\u3002\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u7b80\u4ecb\uff1a\u8f7b\u91cf\u3001\u6613\u7528\u3001\u9002\u5408\u5bb9\u5668\u5316\u90e8\u7f72\uff0c docker-compose\u7684\u4f5c\u7528\uff1a\u7b80\u5316\u591a\u5bb9\u5668\u5e94\u7528\u7ba1\u7406\uff0c\u672c\u6587\u76ee\u6807\uff1a\u6307\u5bfc\u4ece\u96f6\u5b89\u88c5\u5230\u5b9e\u6218\u4f7f\u7528_\u963f\u91cc\u4e91\u955c\u50cf \u4e0b\u8f7d docker-compose","og_url":"https:\/\/www.wsisp.com\/helps\/50034.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T12:53:20+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/07\/20250730125259-688a15ab443ee.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/50034.html","url":"https:\/\/www.wsisp.com\/helps\/50034.html","name":"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T12:53:20+00:00","dateModified":"2025-07-30T12:53:20+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/50034.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/50034.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/50034.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u963f\u91cc\u4e91\u8f7b\u91cf\u7ea7\u670d\u52a1\u5668\u4e0adocker-compose\u7684\u5b89\u88c5\u6559\u7a0b-\u5341\u4e8c\u6708"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50034","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=50034"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/50034\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/50015"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=50034"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=50034"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=50034"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=50034"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}