{"id":7729,"date":"2026-05-15T11:26:20","date_gmt":"2026-05-15T03:26:20","guid":{"rendered":"https:\/\/www.5x44.cn\/?p=7729"},"modified":"2026-05-15T13:52:40","modified_gmt":"2026-05-15T05:52:40","slug":"%e8%87%aa%e5%bb%bayum%ef%bc%88%e9%93%b6%e6%b2%b3%e9%ba%92%e9%ba%9f%ef%bc%89%e6%9b%b4%e6%96%b0%e6%ba%90%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.5x44.cn\/?p=7729","title":{"rendered":"\u81ea\u5efayum\uff08\u94f6\u6cb3\u9e92\u9e9f\uff09\u66f4\u65b0\u6e90\u670d\u52a1\u5668"},"content":{"rendered":"\n<p>\u501f\u9274\uff1a<a href=\"https:\/\/www.cnblogs.com\/it-log\/p\/17188658.html\">https:\/\/www.cnblogs.com\/it-log\/p\/17188658.html<\/a><\/p>\n\n\n\n<p>\u4e00\u3001\u4e0b\u8f7d\u4e00\u4e2acentos7.9.2009\u7684docker\u955c\u50cf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker pull swr.cn-north-4.myhuaweicloud.com\/ddn-k8s\/docker.io\/library\/centos:centos7.9.2009<\/code><\/pre>\n\n\n\n<p>\u4e8c\u3001\u521b\u5efa\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u5efa\u7acbyum\u6e90\u7684\u955c\u50cf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM swr.cn-north-4.myhuaweicloud.com\/ddn-k8s\/docker.io\/library\/centos:centos7.9.2009\n\nRUN rm -rf \/etc\/yum.repos.d\/*\n\n# \u963f\u91cc\u6e90 - \u76f4\u63a5\u8986\u76d6\nRUN curl -o \/etc\/yum.repos.d\/CentOS-Base.repo https:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo\n\nRUN sed -i -e '\/mirrors.cloud.aliyuncs.com\/d' -e '\/mirrors.aliyuncs.com\/d' \/etc\/yum.repos.d\/CentOS-Base.repo\n\nRUN yum clean all &amp;&amp; yum makecache\n\nRUN yum update -y &amp;&amp; yum install -y yum-utils createrepo httpd\n\nRUN yum clean all\n\n# \u590d\u5236httpd\u914d\u7f6e\u6587\u4ef6\u5230\/etc\/http\/conf\/httpd.conf\nCOPY httpd.conf \/etc\/httpd\/conf\/httpd.conf\n\nWORKDIR \/var\/www\/html\n\nCMD &#91;\"\/usr\/sbin\/httpd\",\"-D\",\"FOREGROUND\"]<\/code><\/pre>\n\n\n\n<p>\u4e09\u3001\u4fee\u6539\u672c\u5730yum\u914d\u7f6e\u4e3a\u9e92\u9e9fyum\u6e90<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;ks10-adv-os]\nname = Kylin Linux Advanced Server 10 - Os \nbaseurl = https:\/\/update.cs2c.com.cn\/NS\/V10\/V10SP3-2403\/os\/adv\/lic\/base\/x86_64\/\ngpgcheck = 1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-kylin\nenabled = 1\n\n&#91;ks10-adv-updates]\nname = Kylin Linux Advanced Server 10 - Updates\nbaseurl = https:\/\/update.cs2c.com.cn\/NS\/V10\/V10SP3-2403\/os\/adv\/lic\/updates\/x86_64\/\ngpgcheck = 1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-kylin\nenabled = 1\n\n&#91;ks10-adv-addons]\nname = Kylin Linux Advanced Server 10 - Addons\nbaseurl = https:\/\/update.cs2c.com.cn\/NS\/V10\/V10SP3-2403\/os\/adv\/lic\/addons\/x86_64\/\ngpgcheck = 1\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-kylin\nenabled = 0\n<\/code><\/pre>\n\n\n\n<p>\u56db\u3001\u6e05\u9664\u672c\u5730\u539f\u6709\u6e90\u7f13\u5b58\u5e76\u5efa\u7acb\u4e3a\u9e92\u9e9f\u6e90\u5efa\u7acb\u7f13\u5b58\u5143\u6570\u636e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum clean all\nyum makecache<\/code><\/pre>\n\n\n\n<p>\u4e94\u3001\u540c\u6b65\u8f6f\u4ef6\u5230\u672c\u5730<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>reposync --repoid=ks10-adv-os --repoid=ks10-adv-updates  --download-metadata --newest-only --delete --download_path=\/var\/www\/html<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>--newest-only\uff1a\u53ea\u540c\u6b65\u6700\u65b0\u8f6f\u4ef6\u5305\n--delete\uff1a\u5220\u9664\u65e7\u8f6f\u4ef6\u5305<\/code><\/pre>\n\n\n\n<p>\u516d\u3001\u5206\u522b\u5230\u4ed3\u5e93\u5b50\u76ee\u5f55\u521b\u5efa\u5143\u6570\u636e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>createrepo .<\/code><\/pre>\n\n\n\n<p>\u4e03\u3001\u5b9a\u671f\u66f4\u65b0\u672c\u5730\u4ed3\u5e93\uff0c\u7136\u540e\u66f4\u65b0\u5143\u6570\u636e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>createrepo --update<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u501f\u9274\uff1ahttps:\/\/www.cnblogs.com\/it-log\/p\/17188658.html \u4e00\u3001\u4e0b\u8f7d\u4e00\u4e2acentos7.9.2009\u7684docker\u955c\u50cf &#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.5x44.cn\/?p=7729\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-7729","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/7729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7729"}],"version-history":[{"count":5,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/7729\/revisions"}],"predecessor-version":[{"id":7734,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/7729\/revisions\/7734"}],"wp:attachment":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}