{"id":43,"date":"2024-09-20T11:11:34","date_gmt":"2024-09-20T03:11:34","guid":{"rendered":"https:\/\/blog.easitch.com\/?p=43"},"modified":"2026-06-09T16:26:22","modified_gmt":"2026-06-09T08:26:22","slug":"%e5%ae%89%e8%a3%85-docker-compose","status":"publish","type":"post","link":"https:\/\/blog.eastfond.com\/?p=43","title":{"rendered":"\u5b89\u88c5 Docker Compose"},"content":{"rendered":"<div class='admonition shadow-sm admonition-info'><div class='admonition-title'>\u88c5\u524d\u5fc5\u770b<\/div><div class='admonition-body'><\/p>\n<p>\u4e00\u5b9a\u8981\u5148\u5b89\u88c5Docker\uff0c\u6ca1\u6709Docker\u4f5c\u4e3a\u57fa\u7840\u670d\u52a1\u8fd9\u4e2a\u65e0\u6cd5\u8fd0\u884c\u3002<a href=\"https:\/\/blog.easitch.com\/25\/\" target=\"_blank\">\u5b89\u88c5\u6559\u7a0b<\/a><\/p>\n<p><\/div><\/div>\n<h1>\u5378\u8f7d<\/h1>\n<blockquote>\n<p>\u5b89\u88c5\u4e4b\u524d\u5148\u5378\u8f7d\u3002<\/p>\n<\/blockquote>\n<p>\u5982\u679c\u662f\u4e8c\u8fdb\u5236\u5305\u65b9\u5f0f\u5b89\u88c5\u7684\uff0c\u5220\u9664\u4e8c\u8fdb\u5236\u6587\u4ef6\u5373\u53ef\u3002<\/p>\n<pre><code>sudo rm \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n<p>\u5982\u679c\u662f\u901a\u8fc7 <code>pip<\/code> \u5b89\u88c5\u7684\uff0c\u5219\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5373\u53ef\u5220\u9664\u3002<\/p>\n<pre><code>sudo pip uninstall docker-compose<\/code><\/pre>\n<h1>\u4e8c\u8fdb\u5236\u5305\u5b89\u88c5<\/h1>\n<div class='admonition shadow-sm admonition-success'><div class='admonition-title'>\u63d0\u793a<\/div><div class='admonition-body'><\/p>\n<p>\u8fd9\u4e2a\u65b9\u5f0f\u9002\u7528\u4e8e\u5168\u90e8 Linux \u53d1\u578b\u7248\u672c<\/p>\n<p><\/div><\/div>\n<p>\u5728 Linux \u4e0a\u7684\u4e5f\u5b89\u88c5\u5341\u5206\u7b80\u5355\uff0c\u4ece <a href=\"https:\/\/github.com\/docker\/compose\/releases\">\u5b98\u65b9 GitHub Release<\/a> \u5904\u76f4\u63a5\u4e0b\u8f7d\u7f16\u8bd1\u597d\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u5373\u53ef\u3002\u770b\u597d\u5bf9\u5e94\u7684\u7cfb\u7edf\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5728 Linux 64 \u4f4d\u7cfb\u7edf\u4e0a\u76f4\u63a5\u4e0b\u8f7d\u5bf9\u5e94\u7684\u4e8c\u8fdb\u5236\u5305\u3002<\/p>\n<pre><code>sudo curl -L &quot;https:\/\/github.com\/docker\/compose\/releases\/latest\/download\/docker-compose-$(uname -s)-$(uname -m)&quot; -o \/usr\/local\/bin\/docker-compose\n\nsudo chmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n<h1>\u5176\u4ed6\u65b9\u5f0f\u5b89\u88c5<\/h1>\n<blockquote>\n<p>\u8fd9\u91cc\u4e3b\u8981\u662fcentos\u7684\u5b89\u88c5\u65b9\u5f0f<\/p>\n<\/blockquote>\n<p>\u8bf7\u5148\u786e\u4fdd\uff0cDocker \u7684\u5b89\u88c5\u65b9\u5f0f\u662f\u6839\u636e<a href=\"https:\/\/blog.easitch.com\/25\/\">\u524d\u6587<\/a>\u63d0\u4f9b\u7684\u65b9\u6cd5\u5b89\u88c5\u7684\u3002\u8fd9\u79cd\u65b9\u5f0f\u4f1a\u4e00\u5e76\u4e0b\u8f7d\u597d Docker Compose \u7684\u4e8c\u8fdb\u5236\u5305\uff0c\u5e76\u4e14\u5df2\u7ecf\u6388\u6743\uff0c\u4f4d\u7f6e\u5728<code>\/usr\/libexec\/docker\/cli-plugins<\/code>\uff0c\u53ea\u9700\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n<pre><code>cp \/usr\/libexec\/docker\/cli-plugins\/docker-compose \/usr\/bin<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u67e5\u770b\u6240\u6709\u7684Docker Compose \u7248\u672c<\/p>\n<pre><code>yum list docker-compose-plugin --showduplicates | sort -r<\/code><\/pre>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/image.eastfond.com\/file\/1737987778101_202501272222033.webp'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/image.eastfond.com\/file\/1737987778101_202501272222033.webp\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\"\/><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5378\u8f7d \u5b89\u88c5\u4e4b\u524d\u5148\u5378\u8f7d\u3002 \u5982\u679c\u662f\u4e8c\u8fdb\u5236\u5305\u65b9\u5f0f\u5b89\u88c5\u7684\uff0c\u5220\u9664\u4e8c\u8fdb\u5236\u6587\u4ef6\u5373\u53ef\u3002 sudo rm \/usr\/local\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-docker","category-posts"],"_links":{"self":[{"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=43"}],"version-history":[{"count":10,"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":397,"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=\/wp\/v2\/posts\/43\/revisions\/397"}],"wp:attachment":[{"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.eastfond.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}