{"id":21836,"date":"2026-12-03T14:30:11","date_gmt":"2026-12-03T06:30:11","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=21836"},"modified":"2026-12-03T18:20:56","modified_gmt":"2026-12-03T10:20:56","slug":"docker-15","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2026\/12\/03\/docker-15\/","title":{"rendered":"docker\u5347\u7ea7"},"content":{"rendered":"\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-palette-color-2-color\">\u68c0\u67e5\u539f\u6709\u5b89\u88c5\u65b9\u5f0f<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u662fDebian \/ Ubuntu\uff08apt \u4f53\u7cfb\uff09\u7cfb\u7edf\uff0c\u53ef\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u770b\u662f\u5426\u5b58\u5728 dpkg \u5305\u8bb0\u5f55\ndpkg -l | grep -E 'docker-ce|docker.io|containerd.io'<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6709\u8f93\u51fa \u2192 <strong>apt \/deb \u5305\u65b9\u5f0f\u5b89\u88c5<\/strong><\/li>\n\n\n\n<li>\u65e0\u8f93\u51fa \u2192 \u5927\u6982\u7387\u4e8c\u8fdb\u5236\u624b\u52a8\u8986\u76d6\uff1b\u4e5f\u6709\u53ef\u80fd\u662f snap \/flatpak<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># \u987a\u5e26\u68c0\u67e5 snap\nsnap list | grep docker<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u662fRHEL \/ CentOS \/ Rocky\uff08yum \/ dnf \/ rpm\uff09\u7cfb\u7edf\uff0c\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm -qa | grep -E 'docker-ce|containerd.io'<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6709\u8f93\u51fa \u2192 rpm\/yum\/dnf \u5305\u5b89\u88c5<\/li>\n\n\n\n<li>\u65e0\u8f93\u51fa \u2192 \u4e8c\u8fdb\u5236\u624b\u52a8\u90e8\u7f72<\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-palette-color-2-color\">\u4e8c\u8fdb\u5236\u65b9\u5f0f\u90e8\u7f72\u5347\u7ea7<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9002\u7528\uff1a\u5df2\u7ecf\u7528\u4e8c\u8fdb\u5236\u65b9\u5f0f\u90e8\u7f72\u7684 docker\uff1b<strong>\u4e0d\u8981\u548c apt\/snap \u7248\u672c\u6df7\u7528<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u539f\u7406\uff1aDocker \u5b98\u65b9\u4e8c\u8fdb\u5236\u662f\u9759\u6001\u6253\u5305\uff0c\u76f4\u63a5\u8986\u76d6\u66ff\u6362\u4e8c\u8fdb\u5236\u6587\u4ef6\uff0c<strong>\u955c\u50cf\u3001\u5bb9\u5668\u3001volume\u3001daemon.json \u5168\u90e8\u4fdd\u7559\uff0c\u4e0d\u4f1a\u4e22\u5931\u6570\u636e<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u524d\u7f6e\u68c0\u67e5 &amp; \u5907\u4efd\uff08\u5fc5\u505a\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u770b\u5f53\u524ddocker\u4f4d\u7f6e\nwhich docker\n# \u4e00\u822c\u662f \/usr\/bin\/docker\ndocker --version\n\n# \u5907\u4efd\u6e05\u5355\ndocker ps -a > docker_back_ps.txt\ndocker images > docker_back_img.txt\ndocker volume ls > docker_back_vol.txt\n\n# \u5907\u4efd\u539f\u6709\u4e8c\u8fdb\u5236\uff08\u65b9\u4fbf\u56de\u6eda\uff01\uff09\nsudo cp \/usr\/bin\/docker \/usr\/bin\/docker.old\nsudo cp \/usr\/bin\/dockerd \/usr\/bin\/dockerd.old\nsudo cp \/usr\/bin\/containerd \/usr\/bin\/containerd.old\nsudo cp \/usr\/bin\/runc \/usr\/bin\/runc.old<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u68c0\u67e5\u539f\u6709\u5b89\u88c5\u65b9\u5f0f \u5982\u679c\u662fDebian \/ Ubuntu\uff08apt \u4f53\u7cfb\uff09\u7cfb\u7edf\uff0c\u53ef\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u67e5\u770b\uff1a \u5982\u679c\u662fRHE [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":21837,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-21836","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/21836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=21836"}],"version-history":[{"count":4,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/21836\/revisions"}],"predecessor-version":[{"id":21844,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/21836\/revisions\/21844"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/21837"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=21836"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=21836"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=21836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}