{"id":1308,"date":"2024-01-28T11:00:25","date_gmt":"2024-01-28T03:00:25","guid":{"rendered":"https:\/\/www.johntitorblog.com\/?p=1308"},"modified":"2024-01-31T20:14:15","modified_gmt":"2024-01-31T12:14:15","slug":"rocky-linux-9-%e4%b8%8a%e5%ae%89%e8%a3%85-docker-%e7%a4%be%e5%8c%ba%e7%89%88-docker-ce","status":"publish","type":"post","link":"https:\/\/www.johntitorblog.com\/?p=1308","title":{"rendered":"Rocky Linux 9 \u4e2d\u5b89\u88c5 Docker \u793e\u533a\u7248 (Docker CE)"},"content":{"rendered":"\n<p>\u672c\u6307\u5357\u5c06\u5e2e\u52a9\u60a8\u5728 Rocky Linux 9 \u4e0a\u5b89\u88c5 Docker \u793e\u533a\u7248 (Docker CE)\u3002\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">1. \u66f4\u65b0\u7cfb\u7edf<\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u6253\u5f00\u7ec8\u7aef\u5e76\u66f4\u65b0\u60a8\u7684\u7cfb\u7edf\u4ee5\u786e\u4fdd\u6240\u6709\u5305\u90fd\u662f\u6700\u65b0\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf update -y<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. \u5b89\u88c5\u6240\u9700\u7684\u5305<\/h2>\n\n\n\n<p>\u5b89\u88c5 <code>dnf-plugins-core<\/code> \u5305\uff0c\u4ee5\u4fbf\u4f7f\u7528 <code>config-manager<\/code> \u529f\u80fd\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y dnf-plugins-core<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u8bbe\u7f6e Docker \u4ed3\u5e93<\/h2>\n\n\n\n<p>\u6dfb\u52a0 Docker \u7684\u5b98\u65b9\u4ed3\u5e93\uff0c\u4ee5\u4fbf\u4e8e\u5b89\u88c5 Docker CE\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf config-manager --add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u5b89\u88c5 Docker CE<\/h2>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u5b89\u88c5 Docker CE \u53ca\u5176\u4f9d\u8d56\u9879\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dnf install -y docker-ce docker-ce-cli containerd.io<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u9047\u5230\u4f9d\u8d56\u95ee\u9898\uff0c\u5c1d\u8bd5\u6dfb\u52a0 <code>--nobest<\/code> \u9009\u9879\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. \u542f\u52a8 Docker \u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/h2>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u542f\u52a8 Docker \u670d\u52a1\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start docker\nsudo systemctl enable docker<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">6. \u9a8c\u8bc1\u5b89\u88c5<\/h2>\n\n\n\n<p>\u901a\u8fc7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u9a8c\u8bc1 Docker \u662f\u5426\u6b63\u786e\u5b89\u88c5\u5e76\u8fd0\u884c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker run hello-world<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u770b\u5230 Docker \u8fd0\u884c <code>hello-world<\/code> \u5bb9\u5668\u7684\u6d88\u606f\uff0c\u5219\u8868\u660e Docker \u5df2\u6210\u529f\u5b89\u88c5\u5e76\u51c6\u5907\u5c31\u7eea\u3002<\/p>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u5b89\u88c5\u6b65\u9aa4\u53ef\u80fd\u4f1a\u968f Docker \u548c Rocky Linux \u7684\u66f4\u65b0\u800c\u53d8\u5316\u3002\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u95ee\u9898\uff0c\u5efa\u8bae\u53c2\u8003 Docker \u7684\u5b98\u65b9\u6587\u6863\u6216 Rocky Linux \u793e\u533a\u8bba\u575b\u4ee5\u83b7\u53d6\u5e2e\u52a9\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u7f16\u8f91\uff1aChatGPT<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6307\u5357\u5c06\u5e2e\u52a9\u60a8\u5728 Rocky Linux 9 \u4e0a\u5b89\u88c5 Docker \u793e\u533a\u7248 (Docker CE)\u3002\u8bf7\u6309\u7167\u4ee5\u4e0b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1308","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1308"}],"version-history":[{"count":0,"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1308\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.johntitorblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}