{"id":107819,"date":"2026-09-20T11:40:52","date_gmt":"2026-09-20T03:40:52","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/107819.html"},"modified":"2026-09-20T11:40:52","modified_gmt":"2026-09-20T03:40:52","slug":"docker-%e8%a2%ab-k8s-%e5%88%86%e6%89%8b%e5%90%8e%ef%bc%8c%e6%88%91%e6%89%92%e4%ba%86%e6%89%92%e6%8e%a5%e7%9b%98%e7%9a%84-containerd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/107819.html","title":{"rendered":"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd"},"content":{"rendered":"<h2>\u5bb9\u5668\u7ba1\u7406\u5de5\u5177 Containerd<\/h2>\n<h3>\u4e00\u3001Containerd \u4ecb\u7ecd<\/h3>\n<h4>1. \u524d\u8a00<\/h4>\n<p>\u65e9\u5728 2016 \u5e74 3 \u6708, Docker 1.11 \u7684 Docker Engine \u91cc\u5c31\u5305\u542b\u4e86 containerd, \u800c\u73b0\u5728\u5219\u662f\u628a containerd \u4ece Docker Engine \u91cc\u5f7b\u5e95\u5265\u79bb\u51fa\u6765, \u4f5c\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u5f00\u6e90\u9879\u76ee\u72ec\u7acb\u53d1\u5c55, \u76ee\u6807\u662f\u63d0\u4f9b\u4e00\u4e2a\u66f4\u52a0\u5f00\u653e\u3001\u7a33\u5b9a\u7684\u5bb9\u5668\u8fd0\u884c\u57fa\u7840\u8bbe\u65bd\u3002\u548c\u539f\u5148\u5305\u542b\u5728 Docker Engine \u91cc\u7684 containerd \u76f8\u6bd4, \u72ec\u7acb\u7684 containerd \u5c06\u5177\u6709\u66f4\u591a\u7684\u529f\u80fd, \u53ef\u4ee5\u6db5\u76d6\u6574\u4e2a\u5bb9\u5668\u8fd0\u884c\u65f6\u7ba1\u7406\u7684\u6240\u6709\u9700\u6c42\u3002<\/p>\n<p>containerd \u5e76\u4e0d\u662f\u76f4\u63a5\u9762\u5411\u6700\u7ec8\u7528\u6237\u7684, \u800c\u662f\u4e3b\u8981\u7528\u4e8e\u96c6\u6210\u5230\u66f4\u4e0a\u5c42\u7684\u7cfb\u7edf\u91cc, \u6bd4\u5982 Swarm\u3001Kubernetes\u3001Mesos \u7b49\u5bb9\u5668\u7f16\u6392\u7cfb\u7edf\u3002<\/p>\n<p>containerd \u4ee5 Daemon \u7684\u5f62\u5f0f\u8fd0\u884c\u5728\u7cfb\u7edf\u4e0a, \u901a\u8fc7\u66b4\u9732\u5e95\u5c42\u7684 gRPC API, \u4e0a\u5c42\u7cfb\u7edf\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e9b API \u7ba1\u7406\u673a\u5668\u4e0a\u7684\u5bb9\u5668\u3002<\/p>\n<p>\u6bcf\u4e2a containerd \u53ea\u8d1f\u8d23\u4e00\u53f0\u673a\u5668, Pull \u955c\u50cf\u3001\u5bf9\u5bb9\u5668\u7684\u64cd\u4f5c(\u542f\u52a8\u3001\u505c\u6b62\u7b49)\u3001\u7f51\u7edc\u3001\u5b58\u50a8\u90fd\u662f\u7531 containerd \u5b8c\u6210\u3002\u5177\u4f53\u8fd0\u884c\u5bb9\u5668\u7531 runC \u8d1f\u8d23, \u5b9e\u9645\u4e0a\u53ea\u8981\u662f\u7b26\u5408 OCI \u89c4\u8303\u7684\u5bb9\u5668\u90fd\u53ef\u4ee5\u652f\u6301\u3002<\/p>\n<p>\u5bf9\u4e8e\u5bb9\u5668\u7f16\u6392\u670d\u52a1\u6765\u8bf4, \u8fd0\u884c\u65f6\u53ea\u9700\u8981\u4f7f\u7528 containerd &#043; runC, \u66f4\u52a0\u8f7b\u91cf, \u5bb9\u6613\u7ba1\u7406\u3002<\/p>\n<p>\u72ec\u7acb\u4e4b\u540e containerd \u7684\u7279\u6027\u6f14\u8fdb\u53ef\u4ee5\u548c Docker Engine \u5206\u5f00, \u4e13\u6ce8\u5bb9\u5668\u8fd0\u884c\u65f6\u7ba1\u7406, \u53ef\u4ee5\u66f4\u7a33\u5b9a\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260920034050-6aaf55c25bd6e.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>2. Containerd \u524d\u4e16\u4eca\u751f<\/h4>\n<p>2013 \u5e74 docker \u516c\u53f8\u5728\u63a8\u51fa docker \u4ea7\u54c1\u540e, \u7531\u4e8e\u5176\u5bf9\u5168\u7403\u6280\u672f\u4ea7\u751f\u4e86\u4e00\u5b9a\u7684\u5f71\u54cd\u529b, Google \u516c\u53f8\u660e\u663e\u611f\u89c9\u5230\u81ea\u5df1\u516c\u53f8\u5185\u90e8\u6240\u4f7f\u7528\u7684 Borg \u7cfb\u7edf\u6c5f\u6e56\u5730\u4f4d\u53d7\u5230\u7684\u5a01\u80c1, \u5e0c\u671b Docker \u516c\u53f8\u80fd\u591f\u4e0e\u81ea\u5df1\u8054\u5408\u6253\u9020\u4e00\u6b3e\u5f00\u6e90\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\u4f5c\u4e3a Docker \u6838\u5fc3\u4f9d\u8d56, \u4f46 Docker \u516c\u53f8\u62d2\u7edd\u4e86; \u63a5\u7740 Google \u516c\u53f8\u8054\u5408 RedHat\u3001IBM \u7b49\u516c\u53f8\u8bf4\u670d Docker \u516c\u53f8\u628a\u5176\u5bb9\u5668\u6838\u5fc3\u6280\u672f libcontainer \u6350\u7ed9\u4e2d\u7acb\u793e\u533a(OCI, Open Container Initiative), \u5e76\u66f4\u540d\u4e3a runC\u3002\u4e3a\u4e86\u8fdb\u4e00\u6b65\u904f\u5236 Docker \u5728\u672a\u6765\u6280\u672f\u5e02\u573a\u5f71\u54cd\u529b, \u907f\u514d\u5728\u5bb9\u5668\u5e02\u573a\u4e0a Docker \u4e00\u5bb6\u72ec\u5927, Google \u516c\u53f8\u5e26\u9886 RedHat\u3001IBM \u7b49\u6210\u7acb\u4e86 CNCF(Cloud Native Computing Foundation)\u57fa\u91d1\u4f1a, \u5373\u4e91\u539f\u751f\u8ba1\u7b97\u57fa\u91d1\u4f1a\u3002CNCF \u7684\u76ee\u6807\u5f88\u660e\u786e, \u65e2\u7136\u5728\u5bb9\u5668\u5e94\u7528\u9886\u57df\u65e0\u6cd5\u4e0e Docker \u76f8\u6297\u8861, \u90a3\u5c31\u505a Google \u66f4\u6709\u7ecf\u9a8c\u7684\u6280\u672f\u5e02\u573a&#8212;&#8212;\u5927\u89c4\u6a21\u5bb9\u5668\u7f16\u6392\u5e94\u7528\u573a\u666f, Google \u516c\u53f8\u628a\u81ea\u5df1\u5185\u90e8\u4f7f\u7528\u7684 Borg \u7cfb\u7edf\u5f00\u6e90&#8212;&#8212;Kubernetes, \u4e5f\u5c31\u662f\u6211\u4eec\u4eca\u5929\u6240\u8bf4\u7684\u4e91\u539f\u751f\u6280\u672f\u751f\u6001\u3002<\/p>\n<p>2016 \u5e74 Docker \u516c\u53f8\u63a8\u51fa\u4e86 Docker Swarm, \u610f\u5728\u4e00\u7edf Docker \u751f\u6001, \u8ba9 Docker \u65e2\u53ef\u4ee5\u5b9e\u73b0\u5bb9\u5668\u5e94\u7528\u7ba1\u7406, \u4e5f\u53ef\u4ee5\u5b9e\u73b0\u5927\u89c4\u6a21\u5bb9\u5668\u7f16\u6392, \u7ecf\u8fc7\u8fd1 1 \u5e74\u5de6\u53f3\u65f6\u95f4\u7684\u5e02\u573a\u9a8c\u8bc1\u540e, \u53d1\u73b0\u5728\u5bb9\u5668\u7f16\u6392\u65b9\u9762\u65e0\u6cd5\u72ec\u7acb\u6297\u8861 Kubernetes, \u6240\u4ee5 Docker \u516c\u53f8\u4e8e 2017 \u5e74\u6b63\u5f0f\u5ba3\u5e03\u539f\u751f\u652f\u6301 Kubernetes, \u81f3\u6b64, Docker \u5728\u5927\u89c4\u6a21\u5bb9\u5668\u7f16\u6392\u5e94\u7528\u5e02\u573a\u8d25\u4e0b\u9635\u6765, \u4f46\u662f Docker \u4f9d\u7136\u4e0d\u7518\u5fc3\u5931\u8d25, \u628a Docker \u6838\u5fc3\u4f9d\u8d56 Containerd \u6350\u7ed9\u4e86 CNCF, \u4f9d\u6b64\u8bf4\u660e Docker \u4f9d\u65e7\u662f\u4e00\u4e2a PaaS \u5e73\u53f0\u3002<\/p>\n<p>2020 \u5e74 CNCF \u57fa\u91d1\u4f1a\u5ba3\u5e03 Kubernetes 1.20 \u7248\u672c\u5c06\u4e0d\u518d\u4ec5\u652f\u6301 Docker \u5bb9\u5668\u7ba1\u7406\u5de5\u5177, \u6b64\u4e8b\u7684\u8d77\u56e0\u4e3b\u8981\u4e5f\u4e0e Docker \u6350\u7ed9 CNCF \u57fa\u91d1\u4f1a\u7684 Containerd \u6709\u5173, \u65e9\u671f\u4e3a\u4e86\u5b9e\u73b0 Kubernetes \u80fd\u591f\u4f7f\u7528 Docker \u5b9e\u73b0\u5bb9\u5668\u7ba1\u7406, \u4e13\u95e8\u5728 Kubernetes \u7ec4\u4ef6\u4e2d\u96c6\u6210\u4e00\u4e2a shim(\u57ab\u7247)\u6280\u672f, \u7528\u6765\u5c06 Kubernetes \u5bb9\u5668\u8fd0\u884c\u65f6\u63a5\u53e3(CRI, Container Runtime Interface)\u8c03\u7528\u7ffb\u8bd1\u6210 Docker \u7684 API, \u8fd9\u6837\u5c31\u53ef\u4ee5\u5f88\u597d\u5730\u4f7f\u7528 Docker \u4e86, \u4f46\u662f\u968f\u7740 Kubernetes \u5728\u5168\u7403\u6280\u672f\u5e02\u573a\u7684\u5e7f\u6cdb\u5e94\u7528, \u6709\u66f4\u591a\u7684\u5bb9\u5668\u7ba1\u7406\u5de5\u5177\u7684\u51fa\u73b0, \u5b83\u4eec\u90fd\u60f3\u80fd\u591f\u501f\u52a9\u4e8e Kubernetes \u88ab\u7528\u6237\u6240\u4f7f\u7528, \u6240\u4ee5\u5c31\u63d0\u51fa\u6807\u51c6\u5316\u5bb9\u5668\u8fd0\u884c\u65f6\u63a5\u53e3, \u53ea\u8981\u9002\u914d\u4e86\u8fd9\u4e2a\u63a5\u53e3\u5c31\u53ef\u4ee5\u96c6\u6210\u5230 Kubernetes \u751f\u6001\u5f53\u4e2d, \u6240\u4ee5 Kubernetes \u53d6\u6d88\u4e86\u5bf9 shim \u7684\u7ef4\u62a4, \u5e76\u4e14\u7531\u4e8e Containerd \u6280\u672f\u7684\u6210\u529f, \u53ef\u4ee5\u5b9e\u73b0\u65e0\u7f1d\u5bf9\u63a5 Kubernetes, \u6240\u4ee5\u63a5\u4e0b\u6765 Kubernetes \u5bb9\u5668\u8fd0\u884c\u65f6\u7684\u4e3b\u89d2\u662f Containerd\u3002<\/p>\n<h4>3. Containerd \u67b6\u6784<\/h4>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260920034050-6aaf55c293786.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h5>3.1 \u67b6\u6784\u56fe<\/h5>\n<p>Containerd \u8bbe\u8ba1\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u5d4c\u5165\u5230 Kubernetes \u4e2d\u4f7f\u7528, \u5b83\u662f\u4e00\u4e2a\u5de5\u4e1a\u7ea7\u7684\u5bb9\u5668\u8fd0\u884c\u65f6, \u4e0d\u63d0\u4f9b\u7ed9\u5f00\u53d1\u4eba\u5458\u548c\u7ec8\u7aef\u7528\u6237\u76f4\u63a5\u4f7f\u7528, \u8fd9\u6837\u5c31\u907f\u514d\u4e86\u4e0e Docker \u4ea7\u751f\u7ade\u4e89, \u4f46\u4e8b\u5b9e\u4e0a, Containerd \u5df2\u7ecf\u5b9e\u73b0\u5927\u591a\u6570\u5bb9\u5668\u7ba1\u7406\u529f\u80fd, \u4f8b\u5982: \u5bb9\u5668\u751f\u547d\u5468\u671f\u7ba1\u7406\u3001\u5bb9\u5668\u955c\u50cf\u4f20\u8f93\u548c\u7ba1\u7406\u3001\u5bb9\u5668\u5b58\u50a8\u4e0e\u7f51\u7edc\u7ba1\u7406\u7b49\u3002<\/p>\n<p>Containerd \u91c7\u7528\u6807\u51c6\u7684 C\/S \u67b6\u6784:<\/p>\n<ul>\n<li>\u670d\u52a1\u7aef\u901a\u8fc7 GRPC \u534f\u8bae\u63d0\u4f9b\u7a33\u5b9a\u7684 API<\/li>\n<li>\u5ba2\u6237\u7aef\u901a\u8fc7\u8c03\u7528\u670d\u52a1\u7aef\u7684 API \u8fdb\u884c\u9ad8\u7ea7\u7684\u64cd\u4f5c<\/li>\n<\/ul>\n<p>\u4e3a\u4e86\u5b9e\u73b0\u89e3\u8026, Containerd \u5c06\u4e0d\u540c\u7684\u804c\u8d23\u5212\u5206\u7ed9\u4e0d\u540c\u7684\u7ec4\u4ef6, \u6bcf\u4e2a\u7ec4\u4ef6\u5c31\u76f8\u5f53\u4e8e\u4e00\u4e2a\u5b50\u7cfb\u7edf(subsystem)\u3002\u8fde\u63a5\u4e0d\u540c\u5b50\u7cfb\u7edf\u7684\u7ec4\u4ef6\u88ab\u79f0\u4e3a\u6a21\u5757\u3002<\/p>\n<p>Containerd \u4e24\u5927\u5b50\u7cfb\u7edf\u4e3a:<\/p>\n<ul>\n<li>Bundle: \u5728 Containerd \u4e2d, Bundle \u5305\u542b\u4e86\u914d\u7f6e\u3001\u5143\u6570\u636e\u548c\u6839\u6587\u4ef6\u7cfb\u7edf\u6570\u636e, \u4f60\u53ef\u4ee5\u7406\u89e3\u4e3a\u5bb9\u5668\u7684\u6587\u4ef6\u7cfb\u7edf\u3002\u800c Bundle \u5b50\u7cfb\u7edf\u5141\u8bb8\u7528\u6237\u4ece\u955c\u50cf\u4e2d\u63d0\u53d6\u548c\u6253\u5305 Bundles\u3002<\/li>\n<li>Runtime: Runtime \u5b50\u7cfb\u7edf\u7528\u6765\u6267\u884c Bundles, \u6bd4\u5982\u521b\u5efa\u5bb9\u5668\u3002<\/li>\n<\/ul>\n<p>\u5176\u4e2d, \u6bcf\u4e00\u4e2a\u5b50\u7cfb\u7edf\u7684\u884c\u4e3a\u90fd\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u6a21\u5757\u534f\u4f5c\u5b8c\u6210(\u67b6\u6784\u56fe\u4e2d\u7684 Core \u90e8\u5206)\u3002\u6bcf\u4e00\u79cd\u7c7b\u578b\u7684\u6a21\u5757\u90fd\u4ee5\u63d2\u4ef6\u7684\u5f62\u5f0f\u96c6\u6210\u5230 Containerd \u4e2d, \u800c\u4e14\u63d2\u4ef6\u4e4b\u95f4\u662f\u76f8\u4e92\u4f9d\u8d56\u7684\u3002<\/p>\n<p>\u4f8b\u5982, \u4e0a\u56fe\u4e2d\u7684\u6bcf\u4e00\u4e2a\u957f\u865a\u7ebf\u7684\u65b9\u6846\u90fd\u8868\u793a\u4e00\u79cd\u7c7b\u578b\u7684\u63d2\u4ef6, \u5305\u62ec Service Plugin\u3001Metadata Plugin\u3001GC Plugin\u3001Runtime Plugin \u7b49, \u5176\u4e2d Service Plugin \u53c8\u4f1a\u4f9d\u8d56 Metadata Plugin\u3001GC Plugin \u548c Runtime Plugin\u3002\u6bcf\u4e00\u4e2a\u5c0f\u65b9\u6846\u90fd\u8868\u793a\u4e00\u4e2a\u7ec6\u5206\u7684\u63d2\u4ef6, \u4f8b\u5982 Metadata Plugin \u4f9d\u8d56 Containers Plugin\u3001Content Plugin \u7b49\u3002<\/p>\n<h5>3.2 \u5e38\u7528\u63d2\u4ef6<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260920034050-6aaf55c2ca6ba.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<ul>\n<li>Content Plugin: \u63d0\u4f9b\u5bf9\u955c\u50cf\u4e2d\u53ef\u5bfb\u5740\u5185\u5bb9\u7684\u8bbf\u95ee, \u6240\u6709\u4e0d\u53ef\u53d8\u7684\u5185\u5bb9\u90fd\u88ab\u5b58\u50a8\u5728\u8fd9\u91cc\u3002<\/li>\n<li>Snapshot Plugin: \u7528\u6765\u7ba1\u7406\u5bb9\u5668\u955c\u50cf\u7684\u6587\u4ef6\u7cfb\u7edf\u5feb\u7167\u3002\u955c\u50cf\u4e2d\u7684\u6bcf\u4e00\u4e2a layer \u90fd\u4f1a\u88ab\u89e3\u538b\u6210\u6587\u4ef6\u7cfb\u7edf\u5feb\u7167, \u7c7b\u4f3c\u4e8e Docker \u4e2d\u7684 graphdriver\u3002<\/li>\n<li>Metrics: \u66b4\u9732\u5404\u4e2a\u7ec4\u4ef6\u7684\u76d1\u63a7\u6307\u6807\u3002<\/li>\n<\/ul>\n<h5>3.3 \u67b6\u6784\u7f29\u7565\u56fe<\/h5>\n<p>Containerd \u88ab\u5206\u4e3a\u4e09\u4e2a\u5927\u5757: Storage\u3001Metadata \u548c Runtime\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260920034051-6aaf55c306adc.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h5>3.4 \u4e0e\u5176\u5b83\u5bb9\u5668\u8fd0\u884c\u65f6\u5de5\u5177\u6027\u80fd\u5bf9\u6bd4<\/h5>\n<p>\u8fd9\u662f\u4f7f\u7528 bucketbench \u5bf9 Docker\u3001crio \u548c Containerd \u7684\u6027\u80fd\u6d4b\u8bd5\u7ed3\u679c, \u5305\u62ec\u542f\u52a8\u3001\u505c\u6b62\u548c\u5220\u9664\u5bb9\u5668, \u4ee5\u6bd4\u8f83\u5b83\u4eec\u6240\u8017\u7684\u65f6\u95f4:<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260920034051-6aaf55c33ae3b.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u7ed3\u8bba: Containerd \u5728\u5404\u4e2a\u65b9\u9762\u90fd\u8868\u73b0\u826f\u597d, \u603b\u4f53\u6027\u80fd\u4f18\u4e8e Docker \u548c crio\u3002<\/p>\n<h3>\u4e8c\u3001Containerd \u5b89\u88c5<\/h3>\n<p>\u64cd\u4f5c\u7cfb\u7edf: CentOS Stream 8<\/p>\n<h4>1. YUM \u65b9\u5f0f\u5b89\u88c5<\/h4>\n<p>\u57fa\u4e8e CentOS-Stream-8 \u6a21\u677f\u514b\u9686\u4e00\u53f0\u865a\u62df\u673a\u547d\u540d\u4e3a Containerd\u3002<\/p>\n<p>\u5b89\u88c5\u5fc5\u8981\u5de5\u5177:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y yum-utils device-mapper-persistent-data lvm2 vim<\/span><\/p>\n<p>\u5b89\u88c5 Containerd:<\/p>\n<p><span class=\"token comment\"># 1.\u83b7\u53d6\u963f\u91cc\u4e91YUM\u6e90<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum-config-manager &#8211;add-repo https:\/\/mirrors.aliyun.com\/docker-ce\/linux\/centos\/docker-ce.repo<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum makecache<\/span><\/p>\n<p><span class=\"token comment\"># 2.\u67e5\u770bYUM\u6e90\u4e2dContainerd\u8f6f\u4ef6<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum list | grep containerd<\/span><br \/>\ncontainerd.io.x86_64                <span class=\"token number\">1.6<\/span>.32-3.1.el8                docker-ce-stable<\/p>\n<p><span class=\"token comment\"># 3.\u5b89\u88c5Containerd.io\u8f6f\u4ef6, \u5373\u53ef\u5b89\u88c5Containerd<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum -y install containerd.io<\/span><\/p>\n<p><span class=\"token comment\"># 4.\u4f7f\u7528rpm -qa\u547d\u4ee4\u67e5\u770b\u662f\u5426\u5b89\u88c5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># rpm -qa | grep containerd<\/span><br \/>\ncontainerd.io-1.6.32-3.1.el8.x86_64<\/p>\n<p><span class=\"token comment\"># 5.\u8bbe\u7f6econtainerd\u670d\u52a1\u542f\u52a8\u53ca\u5f00\u673a\u81ea\u542f\u52a8<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl enable containerd &#8211;now<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl status containerd<\/span><\/p>\n<p><span class=\"token comment\"># 6.\u9a8c\u8bc1<\/span><br \/>\n<span class=\"token comment\"># \u5b89\u88c5Containerd\u65f6ctr\u547d\u4ee4\u4ea6\u53ef\u4f7f\u7528, ctr\u547d\u4ee4\u4e3b\u8981\u7528\u4e8e\u7ba1\u7406\u5bb9\u5668\u53ca\u5bb9\u5668\u955c\u50cf\u7b49\u3002<\/span><br \/>\n<span class=\"token comment\"># \u4f7f\u7528ctr\u547d\u4ee4\u67e5\u770bContainerd\u5ba2\u6237\u7aef\u53ca\u670d\u52a1\u7aef\u76f8\u5173\u4fe1\u606f<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr version<\/span><br \/>\nClient:<br \/>\n  Version:  <span class=\"token number\">1.6<\/span>.32<br \/>\n  Revision: 8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89<br \/>\n  Go version: go1.21.10<\/p>\n<p>Server:<br \/>\n  Version:  <span class=\"token number\">1.6<\/span>.32<br \/>\n  Revision: 8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89<br \/>\n  UUID: 979940af-68e0-4681-a560-189eeaefbdfc<\/p>\n<h3>\u4e09.\u5bb9\u5668\u955c\u50cf\u7ba1\u7406<\/h3>\n<h4>3.1 \u5e2e\u52a9\u547d\u4ee4<\/h4>\n<ul>\n<li>docker \u4f7f\u7528 docker images \u547d\u4ee4\u7ba1\u7406\u955c\u50cf<\/li>\n<li>\u5355\u673a containerd \u4f7f\u7528 ctr images \u547d\u4ee4\u7ba1\u7406\u955c\u50cf, containerd \u672c\u8eab\u7684 CLI<\/li>\n<li>k8s \u4e2d containerd \u4f7f\u7528 crictl images \u547d\u4ee4\u7ba1\u7406\u955c\u50cf, Kubernetes \u793e\u533a\u7684\u4e13\u7528 CLI \u5de5\u5177<\/li>\n<\/ul>\n<p><span class=\"token comment\">#\u547d\u4ee4\u5e2e\u52a9<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr &#8211;help<\/span><br \/>\nNAME:<br \/>\n   ctr &#8211;<br \/>\n        __<br \/>\n  _____\/ \/______<br \/>\n \/ ___\/ __\/ ___\/<br \/>\n\/ \/__\/ \/_\/ \/<br \/>\n<span class=\"token punctuation\">\\\\<\/span>___\/<span class=\"token punctuation\">\\\\<\/span>__\/_\/<\/p>\n<p>containerd CLI<\/p>\n<p>USAGE:<br \/>\n   ctr <span class=\"token punctuation\">[<\/span>global options<span class=\"token punctuation\">]<\/span> <span class=\"token builtin class-name\">command<\/span> <span class=\"token punctuation\">[<\/span>command options<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>arguments<span class=\"token punctuation\">..<\/span>.<span class=\"token punctuation\">]<\/span><\/p>\n<p>VERSION:<br \/>\n   v1.6.32<\/p>\n<p>DESCRIPTION:<br \/>\n   ctr is an unsupported debug and administrative client <span class=\"token keyword\">for<\/span> interacting<br \/>\n   with the containerd daemon. Because it is unsupported, the commands,<br \/>\n   options, and operations are not guaranteed to be backward compatible or<br \/>\n   stable from release to release of the containerd project.<\/p>\n<p>COMMANDS:<br \/>\n   plugins, plugin          provides information about containerd plugins<br \/>\n   version                  print the client and server versions<br \/>\n   containers, c, container manage containers<br \/>\n   content                  manage content<br \/>\n   events, event            display containerd events<br \/>\n   images, image, i         manage images<br \/>\n   leases                   manage leases<br \/>\n   namespaces, namespace, ns manage namespaces<br \/>\n   pprof                    provide golang pprof outputs <span class=\"token keyword\">for<\/span> containerd<br \/>\n   run                      run a container<br \/>\n   snapshots, snapshot      manage snapshots<br \/>\n   tasks, t, task           manage tasks<br \/>\n   <span class=\"token function\">install<\/span>                  <span class=\"token function\">install<\/span> a new package<br \/>\n   oci                      OCI tools<br \/>\n   deprecations<br \/>\n   shim                     interact with a shim directly<br \/>\n   help, h                  Shows a list of commands or <span class=\"token builtin class-name\">help<\/span> <span class=\"token keyword\">for<\/span> one <span class=\"token builtin class-name\">command<\/span><\/p>\n<p>GLOBAL OPTIONS:<br \/>\n   <span class=\"token parameter variable\">&#8211;debug<\/span>                    <span class=\"token builtin class-name\">enable<\/span> debug output <span class=\"token keyword\">in<\/span> logs<br \/>\n   <span class=\"token parameter variable\">&#8211;address<\/span> value, <span class=\"token parameter variable\">-a<\/span> value  address <span class=\"token keyword\">for<\/span> containerd&#039;s GRPC server <span class=\"token punctuation\">(<\/span>default: <span class=\"token string\">&#034;\/run\/containerd\/containerd.sock&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token variable\">$CONTAINERD_ADDRESS<\/span><span class=\"token punctuation\">]<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;timeout<\/span> value            total <span class=\"token function\">timeout<\/span> <span class=\"token keyword\">for<\/span> ctr commands <span class=\"token punctuation\">(<\/span>default: 0s<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;connect-timeout value    <span class=\"token function\">timeout<\/span> <span class=\"token keyword\">for<\/span> connecting to containerd <span class=\"token punctuation\">(<\/span>default: 0s<span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;namespace<\/span> value, <span class=\"token parameter variable\">-n<\/span> value namespace to use with commands <span class=\"token punctuation\">(<\/span>default: <span class=\"token string\">&#034;default&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token variable\">$CONTAINERD_NAMESPACE<\/span><span class=\"token punctuation\">]<\/span><br \/>\n   &#8211;help, <span class=\"token parameter variable\">-h<\/span>                 show <span class=\"token builtin class-name\">help<\/span><br \/>\n   &#8211;version, <span class=\"token parameter variable\">-v<\/span>              print the version<\/p>\n<p><span class=\"token comment\"># \u5b50\u547d\u4ee4\u5e2e\u52a9<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images &#8211;help<\/span><br \/>\nNAME:<br \/>\n   ctr images &#8211; manage images<\/p>\n<p>USAGE:<br \/>\n   ctr images <span class=\"token builtin class-name\">command<\/span> <span class=\"token punctuation\">[<\/span>command options<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>arguments<span class=\"token punctuation\">..<\/span>.<span class=\"token punctuation\">]<\/span><\/p>\n<p>COMMANDS:<br \/>\n   check                    check existing images to ensure all content is available locally<br \/>\n   <span class=\"token builtin class-name\">export<\/span>                   <span class=\"token builtin class-name\">export<\/span> images<br \/>\n   <span class=\"token function\">import<\/span>                   <span class=\"token function\">import<\/span> images<br \/>\n   list, <span class=\"token function\">ls<\/span>                 list images known to containerd<br \/>\n   <span class=\"token function\">mount<\/span>                    <span class=\"token function\">mount<\/span> an image to a target path<br \/>\n   unmount                  unmount the image from the target<br \/>\n   pull                     pull an image from a remote<br \/>\n   push                     push an image to a remote<br \/>\n   delete, del, remove, <span class=\"token function\">rm<\/span>  remove one or <span class=\"token function\">more<\/span> images by reference<br \/>\n   tag                      tag an image<br \/>\n   label                    <span class=\"token builtin class-name\">set<\/span> and <span class=\"token function\">clear<\/span> labels <span class=\"token keyword\">for<\/span> an image<br \/>\n   convert                  convert an image<\/p>\n<p>OPTIONS:<br \/>\n   &#8211;help, <span class=\"token parameter variable\">-h<\/span>  show <span class=\"token builtin class-name\">help<\/span><\/p>\n<h4>3.2 \u67e5\u770b\u955c\u50cf<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images list<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images ls<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image list<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image ls<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr i list<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr i ls<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<\/p>\n<h4>3.3 \u4e0b\u8f7d\u955c\u50cf<\/h4>\n<p>containerd \u652f\u6301 oci \u6807\u51c6\u7684\u955c\u50cf, \u6240\u4ee5\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 docker \u5b98\u65b9\u6216 dockerfile \u6784\u5efa\u7684\u955c\u50cf\u3002<\/p>\n<p><span class=\"token comment\"># \u8fd9\u91ccctr\u547d\u4ee4pull\u955c\u50cf\u65f6, \u4e0d\u80fd\u76f4\u63a5\u628a\u955c\u50cf\u540d\u5b57\u5199\u6210nginx:alpine<\/span><br \/>\n<span class=\"token comment\"># \u4e0b\u65b9\u955c\u50cf\u5730\u5740\u4e3a\u534e\u4e3a\u4e91\u955c\u50cf\u52a0\u901f\u5730\u5740, \u53d1\u535a\u5ba2\u65f6\u8bf7\u66ff\u6362\u4e3a\u81ea\u5df1\u7684\u52a0\u901f\u5730\u5740<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images pull &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest<\/span><\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u73b0\u8c61<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image ls<\/span><br \/>\nREF                                                                       TYPE                                    DIGEST       SIZE      PLATFORMS                                                                                                                       LABELS<br \/>\n<span class=\"token operator\">&lt;<\/span>\u955c\u50cf\u52a0\u901f\u5730\u5740<span class=\"token operator\">&gt;<\/span>.mirror.swr.myhuaweicloud.com\/library\/nginx:latest    application\/vnd.oci.image.index.v1&#043;json    sha256:84ec966e61a8c7846f509da7eb081c55c1d56817448728924a87ab32f12a72fb    <span class=\"token number\">68.9<\/span> MiB    linux\/386,linux\/amd64,linux\/arm\/v5,linux\/arm\/v7,linux\/arm64\/v8,linux\/mips64le,linux\/ppc64le,linux\/s390x,unknown\/unknown    &#8211;<\/p>\n<h4>3.4 \u955c\u50cf\u6302\u8f7d<\/h4>\n<p>\u65b9\u4fbf\u67e5\u770b\u955c\u50cf\u4e2d\u5305\u542b\u7684\u5185\u5bb9\u3002<\/p>\n<p><span class=\"token comment\"># \u6302\u8f7d<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images mount &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest \/mnt<\/span><br \/>\nsha256:3c1159cd77f83ede793fc21502ae30b39b04378b6b1b625451d701d555cc1cb9<br \/>\n\/mnt<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u6302\u8f7d<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ls \/mnt<\/span><br \/>\nbin  boot  dev  docker-entrypoint.d  docker-entrypoint.sh  etc  home  lib  lib64<br \/>\nmedia  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var<\/p>\n<p><span class=\"token comment\"># \u5378\u8f7d<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># umount \/mnt<\/span><\/p>\n<h4>3.5 \u955c\u50cf\u5bfc\u51fa<\/h4>\n<p><span class=\"token comment\">#&#8211;platform linux\/amd64,\u5bfc\u51fa\u6307\u5b9a\u5e73\u53f0\u955c\u50cf<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr i export &#8211;platform linux\/amd64 nginx.tar &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ls<\/span><br \/>\nnginx.tar<\/p>\n<h4>3.6 \u955c\u50cf\u5220\u9664<\/h4>\n<p><span class=\"token comment\"># ctr image rm\u5e2e\u52a9<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image rm &#8211;help<\/span><br \/>\nNAME:<br \/>\n   ctr images delete &#8211; remove one or <span class=\"token function\">more<\/span> images by reference<\/p>\n<p>USAGE:<br \/>\n   ctr images delete <span class=\"token punctuation\">[<\/span>command options<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>flags<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&lt;<\/span>ref<span class=\"token operator\">&gt;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token operator\">&lt;<\/span>ref<span class=\"token operator\">&gt;<\/span>, <span class=\"token punctuation\">..<\/span>.<span class=\"token punctuation\">]<\/span><\/p>\n<p>DESCRIPTION:<br \/>\n   remove one or <span class=\"token function\">more<\/span> images by reference<\/p>\n<p>OPTIONS:<br \/>\n   <span class=\"token parameter variable\">&#8211;sync<\/span>  Synchronously remove image and all associated resources<\/p>\n<p><span class=\"token comment\"># \u5220\u9664\u6307\u5b9a\u955c\u50cf<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image rm &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>\u955c\u50cf\u52a0\u901f\u5730\u5740<span class=\"token operator\">&gt;<\/span>.mirror.swr.myhuaweicloud.com\/library\/nginx:latest<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u73b0\u8c61<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image ls<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<\/p>\n<h4>3.7 \u955c\u50cf\u5bfc\u5165<\/h4>\n<p><span class=\"token comment\"># \u5bfc\u5165\u955c\u50cf<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images import &#8211;platform linux\/amd64 nginx.tar<\/span><br \/>\nunpacking <span class=\"token operator\">&lt;<\/span>\u955c\u50cf\u52a0\u901f\u5730\u5740<span class=\"token operator\">&gt;<\/span>.mirror.swr.myhuaweicloud.com\/library\/nginx:latest <span class=\"token punctuation\">(<\/span>sha256:84ec966e61a8c7846f509da7eb081c55c1d56817448728924a87ab32f12a72fb<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">..<\/span>.done<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u73b0\u8c61<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image ls<\/span><br \/>\nREF                                                                       TYPE                                    DIGEST       SIZE      PLATFORMS                                                                                                                       LABELS<br \/>\n<span class=\"token operator\">&lt;<\/span>\u955c\u50cf\u52a0\u901f\u5730\u5740<span class=\"token operator\">&gt;<\/span>.mirror.swr.myhuaweicloud.com\/library\/nginx:latest    application\/vnd.oci.image.index.v1&#043;json    sha256:84ec966e61a8c7846f509da7eb081c55c1d56817448728924a87ab32f12a72fb    <span class=\"token number\">68.9<\/span> MiB    linux\/386,linux\/amd64,linux\/arm\/v5,linux\/arm\/v7,linux\/arm64\/v8,linux\/mips64le,linux\/ppc64le,linux\/s390x,unknown\/unknown    &#8211;<\/p>\n<h4>3.8 \u4fee\u6539\u955c\u50cf tag<\/h4>\n<p><span class=\"token comment\"># \u628a &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest \u4fee\u6539\u4e3a nginx:latest<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images tag &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest nginx:latest<\/span><br \/>\nnginx:latest<\/p>\n<p><span class=\"token comment\"># \u9a8c\u8bc1\u73b0\u8c61<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image ls<\/span><br \/>\nREF                                                                       TYPE                                    DIGEST       SIZE      PLATFORMS                                                                                                                       LABELS<br \/>\n<span class=\"token operator\">&lt;<\/span>\u955c\u50cf\u52a0\u901f\u5730\u5740<span class=\"token operator\">&gt;<\/span>.mirror.swr.myhuaweicloud.com\/library\/nginx:latest    application\/vnd.oci.image.index.v1&#043;json    sha256:84ec966e61a8c7846f509da7eb081c55c1d56817448728924a87ab32f12a72fb    <span class=\"token number\">68.9<\/span> MiB    linux\/386,linux\/amd64,linux\/arm\/v5,linux\/arm\/v7,linux\/arm64\/v8,linux\/mips64le,linux\/ppc64le,linux\/s390x,unknown\/unknown    &#8211;<br \/>\nnginx:latest                                                              application\/vnd.oci.image.index.v1&#043;json    sha256:84ec966e61a8c7846f509da7eb081c55c1d56817448728924a87ab32f12a72fb    <span class=\"token number\">68.9<\/span> MiB    linux\/386,linux\/amd64,linux\/arm\/v5,linux\/arm\/v7,linux\/arm64\/v8,linux\/mips64le,linux\/ppc64le,linux\/s390x,unknown\/unknown    &#8211;<\/p>\n<h3>\u56db\u3001Containerd \u5bb9\u5668\u7ba1\u7406<\/h3>\n<h4>1. \u83b7\u53d6\u547d\u4ee4\u5e2e\u52a9<\/h4>\n<p>ctr &#8211;help \u8f93\u51fa\u540c\u4e0a\u6587&#034;\u4e09\u30013.1 \u5e2e\u52a9\u547d\u4ee4&#034;, \u6b64\u5904\u4e0d\u518d\u91cd\u590d\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container &#8211;help<\/span><\/p>\n<p>\u83b7\u53d6\u521b\u5efa\u9759\u6001\u5bb9\u5668\u547d\u4ee4\u5e2e\u52a9\u3002\u4f7f\u7528 ctr container create \u547d\u4ee4\u521b\u5efa\u5bb9\u5668\u540e, \u5bb9\u5668\u5e76\u6ca1\u6709\u5904\u4e8e\u8fd0\u884c\u72b6\u6001, \u5176\u53ea\u662f\u4e00\u4e2a\u9759\u6001\u7684\u5bb9\u5668\u3002\u8fd9\u4e2a container \u5bf9\u8c61\u53ea\u662f\u5305\u542b\u4e86\u8fd0\u884c\u4e00\u4e2a\u5bb9\u5668\u6240\u9700\u7684\u8d44\u6e90\u53ca\u914d\u7f6e\u7684\u6570\u636e\u7ed3\u6784, \u4f8b\u5982: namespaces\u3001rootfs \u548c\u5bb9\u5668\u7684\u914d\u7f6e\u90fd\u5df2\u7ecf\u521d\u59cb\u5316\u6210\u529f\u4e86, \u53ea\u662f\u7528\u6237\u8fdb\u7a0b(\u672c\u6848\u4f8b\u4e3a nginx)\u8fd8\u6ca1\u6709\u542f\u52a8\u3002\u9700\u8981\u4f7f\u7528 ctr tasks \u547d\u4ee4\u624d\u80fd\u83b7\u53d6\u4e00\u4e2a\u52a8\u6001\u5bb9\u5668\u3002<\/p>\n<p>NAME:<br \/>\n   ctr containers &#8211; manage containers<\/p>\n<p>USAGE:<br \/>\n   ctr containers <span class=\"token builtin class-name\">command<\/span> <span class=\"token punctuation\">[<\/span>command options<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>arguments<span class=\"token punctuation\">..<\/span>.<span class=\"token punctuation\">]<\/span><\/p>\n<p>COMMANDS:<br \/>\n   create                   create container<br \/>\n   delete, del, remove, <span class=\"token function\">rm<\/span>  delete one or <span class=\"token function\">more<\/span> existing containers<br \/>\n   info                     get info about a container<br \/>\n   list, <span class=\"token function\">ls<\/span>                 list containers<br \/>\n   label                    <span class=\"token builtin class-name\">set<\/span> and <span class=\"token function\">clear<\/span> labels <span class=\"token keyword\">for<\/span> a container<br \/>\n   checkpoint               checkpoint a container<br \/>\n   restore                  restore a container from checkpoint<\/p>\n<p>OPTIONS:<br \/>\n   &#8211;help, <span class=\"token parameter variable\">-h<\/span>  show <span class=\"token builtin class-name\">help<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr run &#8211;help    # \u4f7f\u7528ctr run\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u9759\u6001\u5bb9\u5668\u5e76\u4f7f\u5176\u8fd0\u884c\u3002\u4e00\u6b65\u5230\u4f4d\u8fd0\u884c\u5bb9\u5668\u3002<\/span><br \/>\nNAME:<br \/>\n   ctr run &#8211; run a container<\/p>\n<p>USAGE:<br \/>\n   ctr run <span class=\"token punctuation\">[<\/span>command options<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>flags<span class=\"token punctuation\">]<\/span> Image<span class=\"token operator\">|<\/span>RootFS ID <span class=\"token punctuation\">[<\/span>COMMAND<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>ARG<span class=\"token punctuation\">..<\/span>.<span class=\"token punctuation\">]<\/span><\/p>\n<p>OPTIONS:<br \/>\n   <span class=\"token parameter variable\">&#8211;rm<\/span>                    remove the container after running, cannot be used with <span class=\"token parameter variable\">&#8211;detach<\/span><br \/>\n   &#8211;null-io               send all IO to \/dev\/null<br \/>\n   &#8211;log-uri value         log uri<br \/>\n   &#8211;detach, <span class=\"token parameter variable\">-d<\/span>            detach from the task after it has started execution, cannot be used with <span class=\"token parameter variable\">&#8211;rm<\/span><br \/>\n   &#8211;fifo-dir value        directory used <span class=\"token keyword\">for<\/span> storing IO FIFOs<br \/>\n   <span class=\"token parameter variable\">&#8211;cgroup<\/span> value          cgroup path <span class=\"token punctuation\">(<\/span>To disable use of cgroup, <span class=\"token builtin class-name\">set<\/span> to <span class=\"token string\">&#034;&#034;<\/span> explicitly<span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;platform<\/span> value        run image <span class=\"token keyword\">for<\/span> specific platform<br \/>\n   <span class=\"token parameter variable\">&#8211;cni<\/span>                   <span class=\"token builtin class-name\">enable<\/span> cni networking <span class=\"token keyword\">for<\/span> the container<br \/>\n   &#8211;runc-binary value     specify runc-compatible binary<br \/>\n   &#8211;runc-root value       specify runc-compatible root<br \/>\n   &#8211;runc-systemd-cgroup   start runc with systemd cgroup manager<br \/>\n   <span class=\"token parameter variable\">&#8211;uidmap<\/span> container-uid:host-uid:length    run inside a user namespace with the specified <span class=\"token environment constant\">UID<\/span> mapping range<span class=\"token punctuation\">;<\/span> specified with the <span class=\"token function\">format<\/span> container-uid:host-uid:length<br \/>\n   <span class=\"token parameter variable\">&#8211;gidmap<\/span> container-gid:host-gid:length    run inside a user namespace with the specified GID mapping range<span class=\"token punctuation\">;<\/span> specified with the <span class=\"token function\">format<\/span> container-gid:host-gid:length<br \/>\n   &#8211;remap-labels          provide the user namespace ID remapping to the snapshotter via label options<span class=\"token punctuation\">;<\/span> requires snapshotter support<br \/>\n   <span class=\"token parameter variable\">&#8211;cpus<\/span> value            <span class=\"token builtin class-name\">set<\/span> the CFS cpu <span class=\"token function\">quota<\/span> <span class=\"token punctuation\">(<\/span>default: <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;cpu-shares value      <span class=\"token builtin class-name\">set<\/span> the cpu shares <span class=\"token punctuation\">(<\/span>default: <span class=\"token number\">1024<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;snapshotter<\/span> value     snapshotter name. Empty value stands <span class=\"token keyword\">for<\/span> the default value. <span class=\"token punctuation\">[<\/span><span class=\"token variable\">$CONTAINERD_SNAPSHOTTER<\/span><span class=\"token punctuation\">]<\/span><br \/>\n   &#8211;snapshotter-label value    labels added to the new snapshot <span class=\"token keyword\">for<\/span> this container.<br \/>\n   <span class=\"token parameter variable\">&#8211;config<\/span> value, <span class=\"token parameter variable\">-c<\/span> value     path to the runtime-specific spec config <span class=\"token function\">file<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;cwd<\/span> value             specify the working directory of the process<br \/>\n   <span class=\"token parameter variable\">&#8211;env<\/span> value             specify additional container environment variables <span class=\"token punctuation\">(<\/span>e.g. <span class=\"token assign-left variable\">FOO<\/span><span class=\"token operator\">&#061;<\/span>bar<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;env-file value        specify additional container environment variables <span class=\"token keyword\">in<\/span> a file<span class=\"token punctuation\">(<\/span>e.g. <span class=\"token assign-left variable\">FOO<\/span><span class=\"token operator\">&#061;<\/span>bar, one per line<span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;label<\/span> value           specify additional labels <span class=\"token punctuation\">(<\/span>e.g. <span class=\"token assign-left variable\">foo<\/span><span class=\"token operator\">&#061;<\/span>bar<span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;annotation<\/span> value      specify additional OCI annotations <span class=\"token punctuation\">(<\/span>e.g. <span class=\"token assign-left variable\">foo<\/span><span class=\"token operator\">&#061;<\/span>bar<span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;mount<\/span> value           specify additional container <span class=\"token function\">mount<\/span> <span class=\"token punctuation\">(<\/span>e.g. <span class=\"token assign-left variable\">type<\/span><span class=\"token operator\">&#061;<\/span>bind,src<span class=\"token operator\">&#061;<\/span>\/tmp,dst<span class=\"token operator\">&#061;<\/span>\/host,options<span class=\"token operator\">&#061;<\/span>rbind:ro<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;net-host              <span class=\"token builtin class-name\">enable<\/span> <span class=\"token function\">host<\/span> networking <span class=\"token keyword\">for<\/span> the container<br \/>\n   <span class=\"token parameter variable\">&#8211;privileged<\/span>            run privileged container<br \/>\n   &#8211;read-only             <span class=\"token builtin class-name\">set<\/span> the containers filesystem as <span class=\"token builtin class-name\">readonly<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;runtime<\/span> value         runtime name <span class=\"token punctuation\">(<\/span>default: <span class=\"token string\">&#034;io.containerd.runc.v2&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;runtime-config-path value    optional runtime config path<br \/>\n   &#8211;tty, <span class=\"token parameter variable\">-t<\/span>               allocate a TTY <span class=\"token keyword\">for<\/span> the container<br \/>\n   &#8211;with-ns value         specify existing Linux namespaces to <span class=\"token function\">join<\/span> at container runtime <span class=\"token punctuation\">(<\/span>format <span class=\"token string\">&#039;&lt;nstype&gt;:&lt;path&gt;&#039;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;pid-file value        <span class=\"token function\">file<\/span> path to <span class=\"token function\">write<\/span> the task<span class=\"token string\">&#039;s pid<br \/>\n   &#8211;gpus value            add gpus to the container<br \/>\n   &#8211;allow-new-privs       turn off OCI spec&#039;<\/span>s NoNewPrivileges feature flag<br \/>\n   &#8211;memory-limit value    memory limit <span class=\"token punctuation\">(<\/span>in bytes<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">for<\/span> the container <span class=\"token punctuation\">(<\/span>default: <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;device<\/span> value          <span class=\"token function\">file<\/span> path to a device to <span class=\"token function\">add<\/span> to the container<span class=\"token punctuation\">;<\/span> or a path to a directory tree of devices to <span class=\"token function\">add<\/span> to the container<br \/>\n   &#8211;cap-add value         <span class=\"token function\">add<\/span> Linux capabilities <span class=\"token punctuation\">(<\/span>Set capabilities with <span class=\"token string\">&#039;CAP_&#039;<\/span> prefix<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;cap-drop value        drop Linux capabilities <span class=\"token punctuation\">(<\/span>Set capabilities with <span class=\"token string\">&#039;CAP_&#039;<\/span> prefix<span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;seccomp<\/span>               <span class=\"token builtin class-name\">enable<\/span> the default seccomp profile<br \/>\n   &#8211;seccomp-profile value <span class=\"token function\">file<\/span> path to custom seccomp profile. seccomp must be <span class=\"token builtin class-name\">set<\/span> to true, before using seccomp-profile<br \/>\n   &#8211;apparmor-default-profile value    <span class=\"token builtin class-name\">enable<\/span> AppArmor with the default profile with the specified name, e.g. <span class=\"token string\">&#034;cri-containerd.apparmor.d&#034;<\/span><br \/>\n   &#8211;apparmor-profile value    <span class=\"token builtin class-name\">enable<\/span> AppArmor with an existing custom profile<br \/>\n   &#8211;rdt-class value       name of the RDT class to associate the container with. Specifies a Class of Service <span class=\"token punctuation\">(<\/span>CLOS<span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">for<\/span> cache and memory bandwidth management.<br \/>\n   <span class=\"token parameter variable\">&#8211;rootfs<\/span>                use custom rootfs that is not managed by containerd snapshotter<br \/>\n   &#8211;no-pivot              disable use of pivot-root <span class=\"token punctuation\">(<\/span>linux only<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;cpu-quota value       Limit CPU CFS <span class=\"token function\">quota<\/span> <span class=\"token punctuation\">(<\/span>default: -1<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;cpu-period value      Limit CPU CFS period <span class=\"token punctuation\">(<\/span>default: <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;rootfs-propagation value    <span class=\"token builtin class-name\">set<\/span> the propagation of the container rootfs<\/p>\n<h4>2. \u67e5\u770b\u5bb9\u5668<\/h4>\n<p>container \u8868\u793a\u9759\u6001\u5bb9\u5668, \u53ef\u7528 c \u7f29\u5199\u4ee3\u8868 container\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container ls    # \u53ef\u4ee5\u7b80\u5199\u4e3a ctr c ls<\/span><br \/>\nCONTAINER    IMAGE    RUNTIME<\/p>\n<h4>3. \u67e5\u770b\u4efb\u52a1<\/h4>\n<p>task \u8868\u793a\u5bb9\u5668\u91cc\u8dd1\u7684\u8fdb\u7a0b, \u53ef\u7528 t \u7f29\u5199\u4ee3\u8868 task\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr task ls    # \u53ef\u4ee5\u7b80\u5199\u4e3a ctr t ls<\/span><br \/>\nTASK    PID    STATUS<\/p>\n<h4>4. \u521b\u5efa\u9759\u6001\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container create nginx:latest nginx1<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container ls<\/span><br \/>\nCONTAINER    IMAGE         RUNTIME<br \/>\nnginx1       nginx:latest  io.containerd.runc.v2<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container info nginx1<\/span><\/p>\n<h4>5. \u9759\u6001\u5bb9\u5668\u542f\u52a8\u4e3a\u52a8\u6001\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr task ls<\/span><br \/>\nTASK    PID    STATUS<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr task start -d nginx1    #\u542f\u52a8task, \u5373\u8868\u793a\u5728\u5bb9\u5668\u4e2d\u8fd0\u884c\u4e86\u8fdb\u7a0b, \u5373\u4e3a\u52a8\u6001\u5bb9\u5668 -d \u540e\u53f0<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr task ls    #\u5bb9\u5668\u662f\u4ee5\u5bbf\u4e3b\u673a\u8fdb\u7a0b\u7684\u65b9\u5f0f\u5b58\u5728\u7684<\/span><br \/>\nTASK      PID      STATUS<br \/>\nnginx1    <span class=\"token number\">22614<\/span>    RUNNING<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ps aux | grep 22614<\/span><br \/>\nroot   <span class=\"token number\">22614<\/span>  <span class=\"token number\">0.0<\/span>  <span class=\"token number\">0.0<\/span>  <span class=\"token number\">11468<\/span>  <span class=\"token number\">7196<\/span> ?        Ss   <span class=\"token number\">15<\/span>:40   <span class=\"token number\">0<\/span>:00 nginx: master process nginx <span class=\"token parameter variable\">-g<\/span> daemon off<span class=\"token punctuation\">;<\/span><br \/>\nroot   <span class=\"token number\">22969<\/span>  <span class=\"token number\">0.0<\/span>  <span class=\"token number\">0.0<\/span>  <span class=\"token number\">12216<\/span>  <span class=\"token number\">1104<\/span> pts\/0    S&#043;   <span class=\"token number\">15<\/span>:41   <span class=\"token number\">0<\/span>:00 <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">&#8211;color<\/span><span class=\"token operator\">&#061;<\/span>auto <span class=\"token number\">22614<\/span><\/p>\n<h4>6. \u8fdb\u5165\u5bb9\u5668\u64cd\u4f5c<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr task exec &#8211;exec-id $RANDOM -t nginx1 \/bin\/sh<\/span><br \/>\n<span class=\"token comment\">#\u4e3aexec\u8fdb\u7a0b\u8bbe\u5b9a\u4e00\u4e2aid, \u53ef\u4ee5\u968f\u610f\u8f93\u5165, \u53ea\u8981\u4fdd\u8bc1\u552f\u4e00\u5373\u53ef, \u4e5f\u53ef\u4f7f\u7528$RANDOM\u53d8\u91cf<\/span><\/p>\n<h4>7. \u76f4\u63a5\u8fd0\u884c\u4e00\u4e2a\u52a8\u6001\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr run -d &#8211;net-host nginx:latest nginx2<\/span><br \/>\n<span class=\"token comment\"># &#8211;net-host \u4ee3\u8868\u5bb9\u5668\u7684IP\u5c31\u662f\u5bbf\u4e3b\u673a\u7684IP(\u76f8\u5f53\u4e8edocker\u91cc\u7684host\u7c7b\u578b\u7f51\u7edc)<\/span><\/p>\n<h4>8. \u6682\u505c\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr tasks pause nginx2<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr task ls<\/span><br \/>\nTASK      PID      STATUS<br \/>\nnginx1    <span class=\"token number\">22614<\/span>    RUNNING<br \/>\nnginx2    <span class=\"token number\">25569<\/span>    PAUSED    <span class=\"token comment\">#\u72b6\u6001\u4e3aPAUSED, \u8868\u793a\u6682\u505c<\/span><\/p>\n<h4>9. \u6062\u590d\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr tasks resume nginx2<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr task ls<\/span><br \/>\nTASK      PID      STATUS<br \/>\nnginx1    <span class=\"token number\">22614<\/span>    RUNNING<br \/>\nnginx2    <span class=\"token number\">25569<\/span>    RUNNING    <span class=\"token comment\">#\u6062\u590dRUNNING<\/span><\/p>\n<h4>10. \u505c\u6b62\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr tasks kill nginx2<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr tasks ls<\/span><br \/>\nTASK      PID      STATUS<br \/>\nnginx1    <span class=\"token number\">22614<\/span>    RUNNING<br \/>\nnginx2    <span class=\"token number\">25569<\/span>    STOPPED    <span class=\"token comment\">#\u5bb9\u5668\u505c\u6b62\u540eSTATUS\u4e3aSTOPPED<\/span><\/p>\n<h4>11. \u5220\u9664\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr tasks delete nginx2    #\u5fc5\u987b\u5148\u505c\u6b62tasks\u6216\u5148\u5220\u9664task, \u518d\u5220\u9664\u5bb9\u5668<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr tasks ls<\/span><br \/>\nTASK      PID      STATUS<br \/>\nnginx1    <span class=\"token number\">22614<\/span>    RUNNING<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container ls    # \u67e5\u770b\u9759\u6001\u5bb9\u5668, \u786e\u8ba4\u5176\u8fd8\u5b58\u5728\u4e8e\u7cfb\u7edf\u4e2d<\/span><br \/>\nCONTAINER    IMAGE         RUNTIME<br \/>\nnginx1       nginx:latest  io.containerd.runc.v2<br \/>\nnginx2       nginx:latest  io.containerd.runc.v2<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container delete nginx2<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr container ls<\/span><br \/>\nCONTAINER    IMAGE         RUNTIME<br \/>\nnginx1       nginx:latest  io.containerd.runc.v2<\/p>\n<h3>\u4e94\u3001Containerd \u4f7f\u7528\u79c1\u6709\u5bb9\u5668\u955c\u50cf\u4ed3\u5e93 Harbor<\/h3>\n<p><span class=\"token comment\"># \u624b\u52a8\u5728containerd\u5bbf\u4e3b\u673a\u4e0a\u6dfb\u52a0\u6b64\u914d\u7f6e\u4fe1\u606f,\u5982\u679c\u57df\u540d\u89e3\u6790\u5df2\u5b58\u5728\u5ffd\u7565<\/span><br \/>\n<span class=\"token comment\"># \u4e0b\u65b9\u4e3a\u5b9e\u9a8c\u73af\u5883\u5185\u7f51\u5730\u5740, \u53d1\u535a\u5ba2\u65f6\u8bf7\u66ff\u6362\u4e3a\u81ea\u5df1\u7684 Harbor \u5730\u5740<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/hosts<\/span><br \/>\n<span class=\"token operator\">&lt;<\/span>Harbor\u4e3b\u673aIP<span class=\"token operator\">&gt;<\/span> my.harbor.com<\/p>\n<p><span class=\"token comment\"># harbor\u4ed3\u5e93\u9700\u8981\u63d0\u524d\u5728Harbor\u4e3b\u673a\u4e0a\u90e8\u7f72(\u53c2\u8003docker\u6559\u6848), \u955c\u50cf\u9700\u8981\u63d0\u524d\u4f20\u5230harbor\u4e0a, \u5982\u679c\u6ca1\u6709\u4f7f\u7528https\u53ef\u4ee5\u4f7f\u7528&#8211;plain-http \u6307\u5b9ahttp\u534f\u8bae<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image pull &#8211;plain-http &lt;Harbor\u4e3b\u673aIP&gt;\/cloud\/nginx:latest<\/span><\/p>\n<p><span class=\"token comment\"># \u4e0a\u4f20\u955c\u50cf\u5230Harbor<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr images tag nginx:latest my.harbor.com\/cloud\/nginx:latest<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr image push &#8211;platform linux\/amd64 &#8211;plain-http &#8211;user &#034;&lt;Harbor\u7528\u6237\u540d&gt;:&lt;Harbor\u5bc6\u7801&gt;&#034; my.harbor.com\/cloud\/nginx:latest<\/span><br \/>\nmanifest-sha256:6533ddd664582430971e93e69cf343e3bfffceadeaaa97d4379c4d7a29f21d47: <span class=\"token keyword\">done<\/span>       <span class=\"token operator\">|<\/span>&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;<span class=\"token operator\">|<\/span><br \/>\nconfig-sha256:2cd1d97f893f70cee86a38b7160c30e5750f3ed6ad86c598884ca9c6a563a501: <span class=\"token keyword\">done<\/span>       <span class=\"token operator\">|<\/span>&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;&#043;<span class=\"token operator\">|<\/span><br \/>\nelapsed: <span class=\"token number\">0.1<\/span> s<br \/>\ntotal:  <span class=\"token number\">3.3<\/span> KiB\/3.3 KiB<\/p>\n<p>\u6ce8\u610f: \u539f\u6587\u793a\u4f8b\u4e2d Harbor \u63a8\u9001\u4f7f\u7528\u4e86\u660e\u6587\u8d26\u53f7\u5bc6\u7801(images_admin:Cloud12#$), \u6574\u7406\u65f6\u5df2\u66ff\u6362\u4e3a\u5360\u4f4d\u7b26\u3002\u82e5\u4f60\u5728\u516c\u5f00\u535a\u5ba2\u4e2d\u8d34\u51fa\u771f\u5b9e\u51ed\u636e, \u8bf7\u7acb\u5373\u5230 Harbor \u63a7\u5236\u53f0\u4fee\u6539\u5bc6\u7801\u3002<\/p>\n<h3>\u516d\u3001Containerd NameSpace \u7ba1\u7406<\/h3>\n<p>containerd \u4e2d namespace \u7684\u4f5c\u7528\u4e3a\u9694\u79bb\u8fd0\u884c\u7684\u5bb9\u5668, \u53ef\u4ee5\u5b9e\u73b0\u8fd0\u884c\u591a\u4e2a\u5bb9\u5668\u3002<\/p>\n<h4>1. \u5217\u51fa\u5df2\u6709 namespace<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr namespace ls<\/span><br \/>\nNAME      LABELS<br \/>\ndefault          <span class=\"token comment\">#containerd\u9ed8\u8ba4\u5de5\u4f5c\u5728default\u547d\u540d\u7a7a\u95f4<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr namespace ls    #\u5728docker\u73af\u5883\u4e2d\u6253<\/span><br \/>\nNAME    LABELS<br \/>\nmoby           <span class=\"token comment\">#docker\u9ed8\u8ba4\u5de5\u4f5c\u5728moby\u7a7a\u95f4<\/span><\/p>\n<h4>2. \u521b\u5efa namespace<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr namespace create myns<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr namespace create testns<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr namespace ls<\/span><br \/>\nNAME      LABELS<br \/>\ndefault<br \/>\nmyns<br \/>\ntestns<\/p>\n<h4>3. \u5220\u9664 namespace<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr namespace rm testns<\/span><br \/>\ntestns<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr namespace ls<\/span><br \/>\nNAME      LABELS<br \/>\ndefault<br \/>\nmyns<\/p>\n<h4>4. \u67e5\u770b\u6307\u5b9a namespace \u4e2d\u955c\u50cf<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns images ls<\/span><br \/>\nREF    TYPE    DIGEST    SIZE    PLATFORMS    LABELS<\/p>\n<h4>5. \u67e5\u770b\u6307\u5b9a namespace \u4e2d\u662f\u5426\u6709\u7528\u6237\u8fdb\u7a0b\u5728\u8fd0\u884c<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns tasks ls<\/span><br \/>\nTASK    PID    STATUS<\/p>\n<h4>6. \u5728\u6307\u5b9a namespace \u4e2d\u4e0b\u8f7d\u5bb9\u5668\u955c\u50cf<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns images pull &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns images ls<\/span><br \/>\nREF                                                                       TYPE                                    DIGEST       SIZE      PLATFORMS                                                                                                                       LABELS<br \/>\n<span class=\"token operator\">&lt;<\/span>\u955c\u50cf\u52a0\u901f\u5730\u5740<span class=\"token operator\">&gt;<\/span>.mirror.swr.myhuaweicloud.com\/library\/nginx:latest    application\/vnd.oci.image.index.v1&#043;json    sha256:84ec966e61a8c7846f509da7eb081c55c1d56817448728924a87ab32f12a72fb    <span class=\"token number\">68.9<\/span> MiB    linux\/386,linux\/amd64,linux\/arm\/v5,linux\/arm\/v7,linux\/arm64\/v8,linux\/mips64le,linux\/ppc64le,linux\/s390x,unknown\/unknown    &#8211;<\/p>\n<h4>7. \u5728\u6307\u5b9a namespace \u4e2d\u521b\u5efa\u9759\u6001\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns container create &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest mynginx<\/span><\/p>\n<h4>8. \u67e5\u770b\u5728\u6307\u5b9a namespace \u4e2d\u521b\u5efa\u7684\u5bb9\u5668<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns container ls<\/span><br \/>\nCONTAINER    IMAGE                                                                       RUNTIME<br \/>\nmynginx      <span class=\"token operator\">&lt;<\/span>\u955c\u50cf\u52a0\u901f\u5730\u5740<span class=\"token operator\">&gt;<\/span>.mirror.swr.myhuaweicloud.com\/library\/nginx:latest    io.containerd.runc.v2<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns task start -d mynginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ctr -n myns tasks ls<\/span><br \/>\nTASK       PID     STATUS<br \/>\nmynginx    <span class=\"token number\">5873<\/span>    RUNNING<\/p>\n<h3>\u4e03\u3001nerdctl \u5b9e\u8df5<\/h3>\n<h4>nerdctl \u5b89\u88c5<\/h4>\n<p>\u6211\u4eec\u63a8\u8350\u4f7f\u7528 nerdctl \u7ba1\u7406 containerd, \u547d\u4ee4\u8bed\u6cd5\u4e0e docker \u4e00\u81f4\u3002<\/p>\n<p>\u622a\u6b62 2023-05-24 \u6700\u65b0\u7248\u672c\u662f v1.4.0\u3002<\/p>\n<p>github \u9879\u76ee\u5730\u5740: https:\/\/github.com\/containerd\/nerdctl\/releases<\/p>\n<p>cni \u63d2\u4ef6\u9879\u76ee\u5730\u5740: https:\/\/github.com\/containernetworking\/plugins\/releases<\/p>\n<p><span class=\"token comment\"># \u4e0b\u8f7d\u5e76\u5b89\u88c5<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># wget https:\/\/github.com\/containerd\/nerdctl\/releases\/download\/v1.4.0\/nerdctl-1.4.0-linux-amd64.tar.gz<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># tar -xf nerdctl-1.4.0-linux-amd64.tar.gz -C \/usr\/bin\/<\/span><\/p>\n<p><span class=\"token comment\"># \u914d\u7f6enerdctl\u547d\u4ee4\u81ea\u52a8\u8865\u5168<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl completion bash &gt; \/etc\/bash_completion.d\/nerdctl<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># source \/etc\/bash_completion.d\/nerdctl<\/span><\/p>\n<p><span class=\"token comment\"># \u4e0b\u8f7dnerdctl\u6240\u9700\u8981\u7684cni\u63d2\u4ef6<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># wget https:\/\/github.com\/containernetworking\/plugins\/releases\/download\/v1.3.0\/cni-plugins-linux-amd64-v1.3.0.tgz<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mkdir -p \/opt\/cni\/bin<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># tar -xf cni-plugins-linux-amd64-v1.3.0.tgz -C \/opt\/cni\/bin<\/span><\/p>\n<p>\u5982\u679c nerdctl \u8865\u5168\u65f6\u62a5\u9519\u4fe1\u606f\u5982\u4e0b:<\/p>\n<p>_get_comp_words_by_ref: <span class=\"token builtin class-name\">command<\/span> not found<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5: \u5b89\u88c5 bash-completion:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y bash-completion<\/span><\/p>\n<h4>\u914d\u7f6e\u955c\u50cf\u52a0\u901f<\/h4>\n<p><span class=\"token comment\">#\u7f16\u8f91containerd\u7684\u914d\u7f6e\u6587\u4ef6config.toml, \u5982\u679c\u4e0d\u5b58\u5728, \u9700\u8981\u624b\u52a8\u751f\u6210, \u65b9\u6cd5 containerd config default &gt; \/etc\/containerd\/config.toml, \u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u641c\u7d22\u5173\u952e\u5b57&#034;config_path&#034;, \u5728\u5176\u4e0b\u9762\u6dfb\u52a0\u955c\u50cf\u52a0\u901f\u53c2\u6570<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;docker ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># containerd config default &gt; \/etc\/containerd\/config.toml<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;control ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/containerd\/config.toml<\/span><br \/>\n<span class=\"token number\">146<\/span>    <span class=\"token punctuation\">[<\/span>plugins.<span class=\"token string\">&#034;io.containerd.grpc.v1.cri&#034;<\/span>.registry<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token number\">147<\/span>      config_path <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\/etc\/containerd\/certs.d&#034;<\/span>              <span class=\"token comment\">#\u914d\u7f6e\u8fd9\u91cc<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;control ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mkdir -p \/etc\/containerd\/certs.d\/docker.io<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/containerd\/certs.d\/docker.io\/hosts.toml<\/span><br \/>\nserver <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;https:\/\/&lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com&#034;<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>host.<span class=\"token string\">&#034;https:\/\/&lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n  capabilities <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;pull&#034;<\/span>, <span class=\"token string\">&#034;resolve&#034;<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token comment\">#\u91cd\u542fcontainerd\u670d\u52a1\u751f\u6548<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;control ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># systemctl restart containerd<\/span><\/p>\n<h4>nerdctl \u7ba1\u7406\u955c\u50cf<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image &lt;\u6309tab\u952e&gt;&lt;\u6309tab\u952e&gt;<\/span><br \/>\nbuild    <span class=\"token punctuation\">(<\/span>Build an image from a Dockerfile. Needs buildkitd to be running.<span class=\"token punctuation\">)<\/span><br \/>\nconvert  <span class=\"token punctuation\">(<\/span>convert an image<span class=\"token punctuation\">)<\/span><br \/>\ndecrypt  <span class=\"token punctuation\">(<\/span>decrypt an image<span class=\"token punctuation\">)<\/span><br \/>\nencrypt  <span class=\"token punctuation\">(<\/span>encrypt image layers<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token function\">history<\/span>  <span class=\"token punctuation\">(<\/span>Show the <span class=\"token function\">history<\/span> of an image<span class=\"token punctuation\">)<\/span><br \/>\ninspect  <span class=\"token punctuation\">(<\/span>Display detailed information on one or <span class=\"token function\">more<\/span> images.<span class=\"token punctuation\">)<\/span><br \/>\nload     <span class=\"token punctuation\">(<\/span>Load an image from a <span class=\"token function\">tar<\/span> archive or STDIN<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token function\">ls<\/span>       <span class=\"token punctuation\">(<\/span>List images<span class=\"token punctuation\">)<\/span><br \/>\nprune    <span class=\"token punctuation\">(<\/span>Remove unused images<span class=\"token punctuation\">)<\/span><br \/>\npull     <span class=\"token punctuation\">(<\/span>Pull an image from a registry. Optionally specify <span class=\"token string\">&#034;ipfs:\/\/&#034;<\/span> or <span class=\"token string\">&#034;ipns:\/\/&#034;<\/span> scheme to pull image from IPFS.<span class=\"token punctuation\">)<\/span><br \/>\npush     <span class=\"token punctuation\">(<\/span>Push an image or a repository to a registry. Optionally specify <span class=\"token string\">&#034;ipfs:\/\/&#034;<\/span> or <span class=\"token string\">&#034;ipns:\/\/&#034;<\/span> scheme to push image to IPFS.<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token function\">rm<\/span>       <span class=\"token punctuation\">(<\/span>Remove one or <span class=\"token function\">more<\/span> images<span class=\"token punctuation\">)<\/span><br \/>\nsave     <span class=\"token punctuation\">(<\/span>Save one or <span class=\"token function\">more<\/span> images to a <span class=\"token function\">tar<\/span> archive <span class=\"token punctuation\">(<\/span>streamed to STDOUT by default<span class=\"token punctuation\">))<\/span><br \/>\ntag      <span class=\"token punctuation\">(<\/span>Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE<span class=\"token punctuation\">)<\/span><\/p>\n<h5>ls<\/h5>\n<p>\u4f5c\u7528: \u67e5\u770b\u672c\u5730\u955c\u50cf\u6e05\u5355\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image ls<\/span><br \/>\nREPOSITORY    TAG    IMAGE ID    CREATED    PLATFORM    SIZE    BLOB SIZE<br \/>\n<span class=\"token comment\"># \u53ef\u7b80\u5199\u5982\u4e0b<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl images<\/span><\/p>\n<h5>pull<\/h5>\n<p>\u4f5c\u7528: \u4ece\u7f51\u7edc\u4e0a\u4e0b\u8f7d\u955c\u50cf\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token comment\">#\u4e0b\u8f7d\u955c\u50cfbusybox<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image pull busybox<\/span><br \/>\n<span class=\"token comment\"># \u53ef\u7b80\u5199\u5982\u4e0b\u4e0b\u8f7dhttpd<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl pull httpd<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image ls<\/span><br \/>\nREPOSITORY    TAG       IMAGE ID        CREATED            PLATFORM        SIZE        BLOB SIZE<br \/>\nbusybox       latest    f9a104fddb33    <span class=\"token number\">19<\/span> minutes ago     linux\/amd64     <span class=\"token number\">4.1<\/span> MiB     <span class=\"token number\">2.1<\/span> MiB<br \/>\nhttpd         latest    fbc12199ccad    <span class=\"token number\">44<\/span> seconds ago     linux\/amd64     <span class=\"token number\">152.4<\/span> MiB   <span class=\"token number\">55.8<\/span> MiB<\/p>\n<h5>rm<\/h5>\n<p>\u4f5c\u7528: \u5220\u9664\u672c\u5730\u4e0d\u7528\u7684\u955c\u50cf\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image rm httpd<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl rmi busybox<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl images<\/span><br \/>\nREPOSITORY    TAG       IMAGE ID        CREATED            PLATFORM        SIZE        BLOB SIZE<br \/>\nbusybox       latest    f9a104fddb33    <span class=\"token number\">19<\/span> minutes ago     linux\/amd64     <span class=\"token number\">4.1<\/span> MiB     <span class=\"token number\">2.1<\/span> MiB<\/p>\n<h5>tag<\/h5>\n<p>\u4f5c\u7528: \u7ed9\u955c\u50cf\u6253\u6807\u7b7e\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl tag busybox busybox_containerd<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl images<\/span><br \/>\nREPOSITORY            TAG       IMAGE ID        CREATED            PLATFORM        SIZE        BLOB SIZE<br \/>\nbusybox               latest    f9a104fddb33    <span class=\"token number\">34<\/span> minutes ago     linux\/amd64     <span class=\"token number\">4.1<\/span> MiB     <span class=\"token number\">2.1<\/span> MiB<br \/>\nbusybox_containerd    latest    f9a104fddb33    <span class=\"token number\">3<\/span> seconds ago      linux\/amd64     <span class=\"token number\">4.1<\/span> MiB     <span class=\"token number\">2.1<\/span> MiB<\/p>\n<h5>save<\/h5>\n<p>\u4f5c\u7528: \u5c06\u672c\u5730\u955c\u50cf\u5bfc\u51fa\u4e3a\u6587\u4ef6\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image save busybox -o busybox.tar<\/span><br \/>\n<span class=\"token comment\"># \u53ef\u7b80\u5199\u4e3a<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl save busybox -o busybox.tar<\/span><\/p>\n<p><span class=\"token comment\"># \u5220\u9664\u955c\u50cf<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image rm busybox<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl images<\/span><br \/>\nREPOSITORY            TAG       IMAGE ID        CREATED            PLATFORM        SIZE        BLOB SIZE<br \/>\nbusybox_containerd    latest    f9a104fddb33    <span class=\"token number\">57<\/span> seconds ago     linux\/amd64     <span class=\"token number\">4.1<\/span> MiB     <span class=\"token number\">2.1<\/span> MiB<\/p>\n<h5>load<\/h5>\n<p>\u4f5c\u7528: \u5bfc\u5165 tar \u6587\u4ef6\u4e2d\u955c\u50cf\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image load -i busybox.tar<\/span><br \/>\n<span class=\"token comment\"># \u53ef\u7b80\u5199\u4e3a<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl load -i busybox.tar<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl images<\/span><br \/>\nREPOSITORY            TAG       IMAGE ID        CREATED             PLATFORM        SIZE        BLOB SIZE<br \/>\nbusybox               latest    f9a104fddb33    <span class=\"token number\">7<\/span> seconds ago       linux\/amd64     <span class=\"token number\">4.1<\/span> MiB     <span class=\"token number\">2.1<\/span> MiB<br \/>\nbusybox_containerd    latest    f9a104fddb33    About a minute ago  linux\/amd64     <span class=\"token number\">4.1<\/span> MiB     <span class=\"token number\">2.1<\/span> MiB<\/p>\n<h5>history<\/h5>\n<p>\u4f5c\u7528: \u67e5\u770b\u955c\u50cf\u6784\u5efa\u65f6\u7684\u5386\u53f2\u547d\u4ee4\u5c42\u6b21\u7ed3\u6784\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image history busybox<\/span><br \/>\nSNAPSHOT                                                                  CREATED         CREATED BY                          SIZE       COMMENT<br \/>\nsha256:65014c70e84b6817fac42bb201ec5c1ea460a8da246cac0e481f5c9a9491eac0    <span class=\"token number\">10<\/span> months ago   BusyBox <span class=\"token number\">1.37<\/span>.0 <span class=\"token punctuation\">(<\/span>glibc<span class=\"token punctuation\">)<\/span>, Debian <span class=\"token number\">12<\/span>    <span class=\"token number\">4.1<\/span> MiB<\/p>\n<h5>inspect<\/h5>\n<p>\u4f5c\u7528: \u67e5\u770b\u955c\u50cf\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image inspect busybox<\/span><br \/>\n<span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#034;Id&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;sha256:6d3e4188a38af91b0c1577b9e88c53368926b2fe0e1fb985d6e8a70040520c4d&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;RepoTags&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token string\">&#034;busybox:latest&#034;<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span>,<br \/>\n        <span class=\"token string\">&#034;RepoDigests&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token string\">&#034;busybox&#064;sha256:f9a104fddb33220ec80fc45a4e606c74aadf1ef7a3832eb0b05be9e90cd61f5f&#034;<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span>,<br \/>\n        <span class=\"token string\">&#034;Comment&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Created&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;2024-09-26T21:31:42Z&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Author&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Config&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;AttachStdin&#034;<\/span><span class=\"token builtin class-name\">:<\/span> false,<br \/>\n            <span class=\"token string\">&#034;Env&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n                <span class=\"token string\">&#034;PATH&#061;\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin&#034;<\/span><br \/>\n            <span class=\"token punctuation\">]<\/span>,<br \/>\n            <span class=\"token string\">&#034;Cmd&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n                <span class=\"token string\">&#034;sh&#034;<\/span><br \/>\n            <span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span>,<br \/>\n        <span class=\"token string\">&#034;Architecture&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;amd64&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Os&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;linux&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Size&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">4337664<\/span>,<br \/>\n        <span class=\"token string\">&#034;RootFS&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;Type&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;layers&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;Layers&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n                <span class=\"token string\">&#034;sha256:65014c70e84b6817fac42bb201ec5c1ea460a8da246cac0e481f5c9a9491eac0&#034;<\/span><br \/>\n            <span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span>,<br \/>\n        <span class=\"token string\">&#034;Metadata&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;LastTagTime&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;0001-01-01T00:00:00Z&#034;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">]<\/span><\/p>\n<h5>prune<\/h5>\n<p>\u4f5c\u7528: \u5220\u9664\u6240\u6709\u672a\u4f7f\u7528\u7684\u955c\u50cf\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image prune &#8211;all &#8211;force<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl image ls<\/span><br \/>\nREPOSITORY    TAG    IMAGE ID    CREATED    PLATFORM    SIZE    BLOB SIZE<\/p>\n<h4>nerdctl \u7ba1\u7406\u5bb9\u5668<\/h4>\n<h5>\u5e2e\u52a9\u4fe1\u606f<\/h5>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container &#8211;help<\/span><br \/>\nManage containers<\/p>\n<p>Usage: nerdctl container <span class=\"token punctuation\">[<\/span>flags<span class=\"token punctuation\">]<\/span><\/p>\n<p>Commands:<br \/>\n  commit    Create a new image from a container<span class=\"token string\">&#039;s changes<br \/>\n  cp        Copy files\/folders between a running container and the local filesystem.<br \/>\n  create    Create a new container. Optionally specify &#034;ipfs:\/\/&#034; or &#034;ipns:\/\/&#034; scheme to pull image from IPFS.<br \/>\n  exec      Run a command in a running container<br \/>\n  inspect   Display detailed information on one or more containers.<br \/>\n  kill      Kill one or more running containers<br \/>\n  logs      Fetch the logs of a container. Expected to be used with &#039;<\/span>nerdctl run -d<span class=\"token string\">&#039;.<br \/>\n  ls        List containers<br \/>\n  pause     Pause all processes within one or more containers<br \/>\n  port      List port mappings or a specific mapping for the container<br \/>\n  prune     Remove all stopped containers<br \/>\n  rename    rename a container<br \/>\n  restart   Restart one or more running containers<br \/>\n  rm        Remove one or more containers<br \/>\n  run       Run a command in a new container. Optionally specify &#034;ipfs:\/\/&#034; or &#034;ipns:\/\/&#034; scheme to pull image from IPFS.<br \/>\n  start     Start one or more running containers<br \/>\n  stop      Stop one or more running containers<br \/>\n  unpause   Unpause all processes within one or more containers<br \/>\n  update    Update one or more running containers<br \/>\n  wait      Block until one or more containers stop, then print their exit codes.<\/p>\n<p>Flags:<br \/>\n  -h, &#8211;help   help for container<\/p>\n<p>See also &#039;<\/span>nerdctl &#8211;help<span class=\"token string\">&#039; for the global flags such as &#039;<\/span>&#8211;namespace<span class=\"token string\">&#039;, &#039;<\/span>&#8211;snapshotter<span class=\"token string\">&#039;, and &#039;<\/span>&#8211;cgroup-manager&#039;.<\/p>\n<h5>ls<\/h5>\n<p>\u4f5c\u7528: \u67e5\u770b\u5bb9\u5668\u6e05\u5355\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls<\/span><br \/>\nCONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES<br \/>\n<span class=\"token comment\"># \u53ef\u7b80\u5199\u4e3a<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl ps<\/span><br \/>\nCONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES<br \/>\n<span class=\"token comment\"># \u4f7f\u7528-a\u9009\u9879\u67e5\u770b\u6240\u6709\u5bb9\u5668, \u5305\u62ec\u672a\u8fd0\u884c\u7684<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls -a<\/span><br \/>\nCONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES<\/p>\n<p>\u5e38\u7528\u9009\u9879:<\/p>\n<p>-a, <span class=\"token parameter variable\">&#8211;all<\/span>             Show all containers <span class=\"token punctuation\">(<\/span>default shows just running<span class=\"token punctuation\">)<\/span><br \/>\n-f, <span class=\"token parameter variable\">&#8211;filter<\/span> strings  Filter matches containers based on given conditions<br \/>\n<span class=\"token parameter variable\">&#8211;format<\/span> string       Format the output using the given Go template, e.g, <span class=\"token string\">&#039;{{json .}}&#039;<\/span>, <span class=\"token string\">&#039;wide&#039;<\/span><\/p>\n<h5>run<\/h5>\n<p>\u4f5c\u7528: \u521b\u5efa\u5e76\u8fd0\u884c\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token comment\"># \u8bed\u6cd5:<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl run &#8211;help<\/span><br \/>\nRun a <span class=\"token builtin class-name\">command<\/span> <span class=\"token keyword\">in<\/span> a new container. Optionally specify <span class=\"token string\">&#034;ipfs:\/\/&#034;<\/span> or <span class=\"token string\">&#034;ipns:\/\/&#034;<\/span> scheme to pull image from IPFS.<\/p>\n<p>Usage: nerdctl run <span class=\"token punctuation\">[<\/span>flags<span class=\"token punctuation\">]<\/span> IMAGE <span class=\"token punctuation\">[<\/span>COMMAND<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>ARG<span class=\"token punctuation\">..<\/span>.<span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container run -it ubuntu<\/span><br \/>\nroot&#064;0da9aad32119:\/<span class=\"token comment\"># exit<\/span><br \/>\n<span class=\"token builtin class-name\">exit<\/span><br \/>\n<span class=\"token comment\"># \u53ef\u7b80\u5199\u4e3a<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl run -it ubuntu<\/span><\/p>\n<p><span class=\"token comment\"># \u5bb9\u5668\u72b6\u6001\u4e3aExited<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls<\/span><br \/>\nCONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls -a<\/span><br \/>\nCONTAINER ID    IMAGE                            COMMAND       CREATED          STATUS                        PORTS    NAMES<br \/>\n0da9aad32119    docker.io\/library\/ubuntu:latest  <span class=\"token string\">&#034;\/bin\/bash&#034;<\/span>   <span class=\"token number\">3<\/span> minutes ago    Exited <span class=\"token punctuation\">(<\/span><span class=\"token number\">130<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token number\">2<\/span> minutes ago             ubuntu-0da9a<\/p>\n<p>\u5e38\u7528\u9009\u9879:<\/p>\n<p>&#8211;cpu-shares uint     CPU shares <span class=\"token punctuation\">(<\/span>relative weight<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token parameter variable\">&#8211;cpus<\/span> float          Number of CPUs<br \/>\n-d, <span class=\"token parameter variable\">&#8211;detach<\/span>          Run container <span class=\"token keyword\">in<\/span> background and print container ID<br \/>\n<span class=\"token parameter variable\">&#8211;dns<\/span> strings         Set custom DNS servers<br \/>\n-e, <span class=\"token parameter variable\">&#8211;env<\/span> stringArray Set environment variables<br \/>\n-h, <span class=\"token parameter variable\">&#8211;hostname<\/span> string Container <span class=\"token function\">host<\/span> name<br \/>\n-i, <span class=\"token parameter variable\">&#8211;interactive<\/span>     Keep STDIN <span class=\"token function\">open<\/span> even <span class=\"token keyword\">if<\/span> not attached<br \/>\n<span class=\"token parameter variable\">&#8211;ip<\/span> string           IPv4 address to assign to the container<br \/>\n&#8211;mac-address string  MAC address to assign to the container<br \/>\n-m, <span class=\"token parameter variable\">&#8211;memory<\/span> string   Memory limit<br \/>\n<span class=\"token parameter variable\">&#8211;name<\/span> string         Assign a name to the container<br \/>\n<span class=\"token parameter variable\">&#8211;net<\/span> strings         Connect a container to a network <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;bridge&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;host&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;none&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span>default <span class=\"token punctuation\">[<\/span>bridge<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token parameter variable\">&#8211;network<\/span> strings     Connect a container to a network <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;bridge&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;host&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;none&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;container:&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span>default <span class=\"token punctuation\">[<\/span>bridge<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token parameter variable\">&#8211;privileged<\/span>          Give extended privileges to this container<br \/>\n<span class=\"token parameter variable\">&#8211;pull<\/span> string         Pull image before running <span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;always&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;missing&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;never&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span>default <span class=\"token string\">&#034;missing&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token parameter variable\">&#8211;restart<\/span> string      Restart policy to apply when a container exits <span class=\"token punctuation\">(<\/span>implemented values: <span class=\"token string\">&#034;no&#034;<\/span><span class=\"token operator\">|<\/span><span class=\"token string\">&#034;always|on-failure:n|unless-stopped&#034;<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span>default <span class=\"token string\">&#034;no&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token parameter variable\">&#8211;rm<\/span>                  Automatically remove the container when it exits<br \/>\n<span class=\"token parameter variable\">&#8211;runtime<\/span> string      Runtime to use <span class=\"token keyword\">for<\/span> this container, e.g.<br \/>\n&#8211;stop-signal string  Signal to stop a container <span class=\"token punctuation\">(<\/span>default <span class=\"token string\">&#034;SIGTERM&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n&#8211;stop-timeout        Timeout <span class=\"token punctuation\">(<\/span>in seconds<span class=\"token punctuation\">)<\/span> to stop a container<br \/>\n-t, <span class=\"token parameter variable\">&#8211;tty<\/span>             Allocate a pseudo-TTY<br \/>\n-v, <span class=\"token parameter variable\">&#8211;volume<\/span>          Bind <span class=\"token function\">mount<\/span> a volume<\/p>\n<h5>rm<\/h5>\n<p>\u4f5c\u7528: \u5220\u9664\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container rm 0da9aad32119<\/span><br \/>\n0da9aad32119<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls -a<\/span><br \/>\nCONTAINER ID    IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES<\/p>\n<h5>prune<\/h5>\n<p>\u4f5c\u7528: \u5220\u9664\u6240\u6709\u672a\u8fd0\u884c\u7684\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container run ubuntu<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container run ubuntu<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls -a<\/span><br \/>\nCONTAINER ID    IMAGE                            COMMAND       CREATED           STATUS                    PORTS    NAMES<br \/>\n3778651cfacb    docker.io\/library\/ubuntu:latest  <span class=\"token string\">&#034;\/bin\/bash&#034;<\/span>   <span class=\"token number\">5<\/span> seconds ago     Exited <span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token number\">5<\/span> seconds ago           ubuntu-37786<br \/>\n3e8221845ab4    docker.io\/library\/ubuntu:latest  <span class=\"token string\">&#034;\/bin\/bash&#034;<\/span>   <span class=\"token number\">11<\/span> seconds ago    Exited <span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token number\">11<\/span> seconds ago          ubuntu-3e822<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container prune &#8211;force<\/span><br \/>\nDeleted Containers:<br \/>\n3778651cfacba1cd489b065ff7017b272b9edddc71211e2a6e567d9d0ec8ac54<br \/>\n3e8221845ab479f18a091c04443d26632946c9ced264c21a490f6b3052bde0b2<\/p>\n<h5>rename<\/h5>\n<p>\u4f5c\u7528: \u91cd\u547d\u540d\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container run &#8211;name ubuntu-1 ubuntu<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls -a<\/span><br \/>\nCONTAINER ID    IMAGE                            COMMAND       CREATED           STATUS                     PORTS    NAMES<br \/>\n61384145427a    docker.io\/library\/ubuntu:latest  <span class=\"token string\">&#034;\/bin\/bash&#034;<\/span>   <span class=\"token number\">13<\/span> seconds ago    Exited <span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token number\">13<\/span> seconds ago           ubuntu-1<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container rename ubuntu-1 ubuntu<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls -a<\/span><br \/>\nCONTAINER ID    IMAGE                            COMMAND       CREATED           STATUS                     PORTS    NAMES<br \/>\n61384145427a    docker.io\/library\/ubuntu:latest  <span class=\"token string\">&#034;\/bin\/bash&#034;<\/span>   <span class=\"token number\">26<\/span> seconds ago    Exited <span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token number\">26<\/span> seconds ago           ubuntu<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container rm ubuntu<\/span><br \/>\nubuntu<\/p>\n<h5>stop \u548c start<\/h5>\n<p>\u4f5c\u7528: \u505c\u6b62\u548c\u542f\u52a8\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container run -d &#8211;name nginx1 nginx<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls &#8211;format &#034;{{.Names}} {{.Status}}&#034;<\/span><br \/>\nnginx1 Up<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container stop nginx1<\/span><br \/>\nnginx1<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls &#8211;format &#034;{{.Names}} {{.Status}}&#034; -a<\/span><br \/>\nnginx1 Exited <span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token number\">13<\/span> seconds ago<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container start nginx1<\/span><br \/>\nnginx1<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls &#8211;format &#034;{{.Names}} {{.Status}}&#034;<\/span><br \/>\nnginx1 Up<\/p>\n<h5>restart<\/h5>\n<p>\u4f5c\u7528: \u91cd\u542f\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container restart nginx1<\/span><br \/>\nnginx1<\/p>\n<h5>pause \u548c unpause<\/h5>\n<p>\u4f5c\u7528: \u6682\u505c\u548c\u53d6\u6d88\u6302\u8d77\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container pause nginx1<\/span><br \/>\nnginx1<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls &#8211;format &#034;{{.Names}} {{.Status}}&#034; -a<\/span><br \/>\nnginx1 Paused<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container unpause nginx1<\/span><br \/>\nnginx1<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls &#8211;format &#034;{{.Names}} {{.Status}}&#034; -a<\/span><br \/>\nnginx1 Up<\/p>\n<h5>kill<\/h5>\n<p>\u4f5c\u7528: \u7ed9\u5bb9\u5668\u53d1\u4fe1\u53f7, \u9ed8\u8ba4\u53d1 KILL \u4fe1\u53f7\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container kill nginx1<\/span><br \/>\n945c89b61aafc3475317e8801ad8526fdf337b038bfa315472e4c723bf5406f1<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls -a &#8211;format &#034;{{.Names}} {{.Status}}&#034;<\/span><br \/>\nnginx1 Exited <span class=\"token punctuation\">(<\/span><span class=\"token number\">137<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token number\">8<\/span> seconds ago<\/p>\n<h5>exec<\/h5>\n<p>\u4f5c\u7528: \u5728\u8fd0\u884c\u7684\u5bb9\u5668\u5185\u90e8\u6267\u884c\u547d\u4ee4\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container start nginx1<\/span><br \/>\nnginx1<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container exec -it nginx1 bash<\/span><br \/>\nroot&#064;945c89b61aaf:\/<span class=\"token comment\"># exit<\/span><br \/>\n<span class=\"token builtin class-name\">exit<\/span><\/p>\n<h5>cp<\/h5>\n<p>\u4f5c\u7528: \u5c06\u5bbf\u4e3b\u673a\u6587\u4ef6\u590d\u5236\u7ed9\u5bb9\u5668\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container cp \/etc\/hostname nginx1:<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container exec nginx1 ls hostname<\/span><br \/>\n<span class=\"token function\">hostname<\/span><\/p>\n<p>\u601d\u8003: \u5982\u679c\u5bb9\u5668\u4e2d\u7684\u6587\u4ef6\u62f7\u8d1d\u7ed9\u5bbf\u4e3b\u673a\u8be5\u5982\u4f55\u64cd\u4f5c?<\/p>\n<h5>inspect<\/h5>\n<p>\u4f5c\u7528: \u67e5\u770b\u5bb9\u5668\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container inspect nginx1<\/span><br \/>\n<span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#034;Id&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;945c89b61aafc3475317e8801ad8526fdf337b038bfa315472e4c723bf5406f1&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Created&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;2025-08-02T14:07:36.213384887Z&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Path&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;\/docker-entrypoint.sh&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Args&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token string\">&#034;nginx&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;-g&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;daemon off;&#034;<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span>,<br \/>\n        <span class=\"token string\">&#034;State&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;Status&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;running&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;Running&#034;<\/span><span class=\"token builtin class-name\">:<\/span> true,<br \/>\n            <span class=\"token string\">&#034;Paused&#034;<\/span><span class=\"token builtin class-name\">:<\/span> false,<br \/>\n            <span class=\"token string\">&#034;Restarting&#034;<\/span><span class=\"token builtin class-name\">:<\/span> false,<br \/>\n            <span class=\"token string\">&#034;Pid&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">49359<\/span>,<br \/>\n            <span class=\"token string\">&#034;ExitCode&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">0<\/span>,<br \/>\n            <span class=\"token string\">&#034;Error&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;FinishedAt&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;0001-01-01T00:00:00Z&#034;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span>,<br \/>\n        <span class=\"token string\">&#034;Image&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;docker.io\/library\/nginx:latest&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;ResolvConfPath&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;\/var\/lib\/nerdctl\/1935db59\/containers\/default\/945c89b61aafc3475317e8801ad8526fdf337b038bfa315472e4c723bf5406f1\/resolv.conf&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;HostnamePath&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;\/var\/lib\/nerdctl\/1935db59\/containers\/default\/945c89b61aafc3475317e8801ad8526fdf337b038bfa315472e4c723bf5406f1\/hostname&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;LogPath&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;\/var\/lib\/nerdctl\/1935db59\/containers\/default\/945c89b61aafc3475317e8801ad8526fdf337b038bfa315472e4c723bf5406f1\/945c89b61aafc3475317e8801ad8526fdf337b038bfa315472e4c723bf5406f1-json.log&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Name&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;nginx1&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;RestartCount&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">0<\/span>,<br \/>\n        <span class=\"token string\">&#034;Driver&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;overlayfs&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Platform&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;linux&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;AppArmorProfile&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Mounts&#034;<\/span><span class=\"token builtin class-name\">:<\/span> null,<br \/>\n        <span class=\"token string\">&#034;Config&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;Hostname&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;945c89b61aaf&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;AttachStdin&#034;<\/span><span class=\"token builtin class-name\">:<\/span> false,<br \/>\n            <span class=\"token string\">&#034;Labels&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token string\">&#034;containerd.io\/restart.explicitly-stopped&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;false&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;io.containerd.image.config.stop-signal&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;SIGQUIT&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/extraHosts&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;null&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/hostname&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;945c89b61aaf&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/log-uri&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;binary:\/\/\/usr\/bin\/nerdctl?_NERDCTL_INTERNAL_LOGGING&#061;%2Fvar%2Flib%2Fnerdctl%2F1935db59&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/name&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;nginx1&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/namespace&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;default&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/networks&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;[<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>bridge<span class=\"token entity\" title=\"\\\\&quot;\">\\\\&#034;<\/span>]&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/platform&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;linux\/amd64&#034;<\/span>,<br \/>\n                <span class=\"token string\">&#034;nerdctl\/state-dir&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;\/var\/lib\/nerdctl\/1935db59\/containers\/default\/945c89b61aafc3475317e8801ad8526fdf337b038bfa315472e4c723bf5406f1&#034;<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span>,<br \/>\n        <span class=\"token string\">&#034;NetworkSettings&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;GlobalIPv6Address&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;GlobalIPv6PrefixLen&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">0<\/span>,<br \/>\n            <span class=\"token string\">&#034;IPAddress&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;10.4.0.15&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;IPPrefixLen&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">24<\/span>,<br \/>\n            <span class=\"token string\">&#034;MacAddress&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;32:81:21:fb:b4:72&#034;<\/span>,<br \/>\n            <span class=\"token string\">&#034;Networks&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                <span class=\"token string\">&#034;unknown-eth0&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n                    <span class=\"token string\">&#034;IPAddress&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;10.4.0.15&#034;<\/span>,<br \/>\n                    <span class=\"token string\">&#034;IPPrefixLen&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">24<\/span>,<br \/>\n                    <span class=\"token string\">&#034;GlobalIPv6Address&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;&#034;<\/span>,<br \/>\n                    <span class=\"token string\">&#034;GlobalIPv6PrefixLen&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token number\">0<\/span>,<br \/>\n                    <span class=\"token string\">&#034;MacAddress&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;32:81:21:fb:b4:72&#034;<\/span><br \/>\n                <span class=\"token punctuation\">}<\/span><br \/>\n            <span class=\"token punctuation\">}<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">]<\/span><\/p>\n<h5>logs<\/h5>\n<p>\u4f5c\u7528: \u663e\u793a\u5bb9\u5668 console \u7ec8\u7aef\u5185\u5bb9\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container logs nginx1<\/span><br \/>\n\/docker-entrypoint.sh: \/docker-entrypoint.d\/ is not empty, will attempt to perform configuration<br \/>\n\/docker-entrypoint.sh: Looking <span class=\"token keyword\">for<\/span> shell scripts <span class=\"token keyword\">in<\/span> \/docker-entrypoint.d\/<br \/>\n\/docker-entrypoint.sh: Launching \/docker-entrypoint.d\/10-listen-on-ipv6-by-default.sh<br \/>\n<span class=\"token number\">10<\/span>-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled<br \/>\n\/docker-entrypoint.sh: Sourcing \/docker-entrypoint.d\/15-local-resolvers.envsh<br \/>\n\/docker-entrypoint.sh: Launching \/docker-entrypoint.d\/20-envsubst-on-templates.sh<br \/>\n\/docker-entrypoint.sh: Launching \/docker-entrypoint.d\/30-tune-worker-processes.sh<br \/>\n\/docker-entrypoint.sh: Configuration complete<span class=\"token punctuation\">;<\/span> ready <span class=\"token keyword\">for<\/span> start up<br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: using the &#034;epoll&#034; event method<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: nginx\/1.29.0<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: built by gcc 12.2.0 (Debian 12.2.0-14&#043;deb12u1)<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: OS: Linux 4.18.0-553.6.1.el8.x86_64<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: getrlimit(RLIMIT_NOFILE): 1024:1024<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: start worker processes<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: start worker process 22<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: start worker process 23<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: start worker process 24<\/span><br \/>\n<span class=\"token number\">2025<\/span>\/08\/02 <span class=\"token number\">14<\/span>:10:40 <span class=\"token punctuation\">[<\/span>notice<span class=\"token punctuation\">]<\/span> <span class=\"token number\">1<\/span><span class=\"token comment\">#1: start worker process 25<\/span><\/p>\n<h5>port<\/h5>\n<p>\u4f5c\u7528: \u663e\u793a\u5bbf\u4e3b\u673a\u548c\u5bb9\u5668\u4e4b\u95f4\u7aef\u53e3\u6620\u5c04\u5173\u7cfb\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container run &#8211;name nginx -d -p 8080:80 nginx<\/span><br \/>\n2d0923e9f7c816d9fc8f5fa30b1be332c90fff0e354c981b919fc67bd1f97101<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container port nginx<\/span><br \/>\n<span class=\"token number\">80<\/span>\/tcp &#8211;<span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0.0<\/span>.0.0:8080<\/p>\n<h5>commit<\/h5>\n<p>\u4f5c\u7528: \u5c06\u5bb9\u5668\u63d0\u4ea4\u4e3a\u955c\u50cf\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl commit nginx nginx_containerd<\/span><br \/>\nsha256:6e60d18c9e7f7968f49edfacae16e39df2a995d3119b0b23356fd501cd8348a6<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl images<\/span><br \/>\nREPOSITORY          TAG       IMAGE ID        CREATED            PLATFORM        SIZE         BLOB SIZE<br \/>\nnginx               latest    84ec966e61a8    <span class=\"token number\">17<\/span> minutes ago     linux\/amd64     <span class=\"token number\">194.4<\/span> MiB    <span class=\"token number\">68.9<\/span> MiB<br \/>\nnginx_containerd    latest    d59a30a56f7f    <span class=\"token number\">3<\/span> seconds ago      linux\/amd64     <span class=\"token number\">194.4<\/span> MiB    <span class=\"token number\">68.9<\/span> MiB<br \/>\nubuntu              latest    a08e551cb338    <span class=\"token number\">26<\/span> minutes ago     linux\/amd64     <span class=\"token number\">81.1<\/span> MiB     <span class=\"token number\">28.4<\/span> MiB<\/p>\n<h4>nerdctl \u7ba1\u7406\u7f51\u7edc<\/h4>\n<p>Containerd \u4e2d\u7684\u7f51\u7edc\u4e0e Docker \u7c7b\u4f3c, \u6240\u6709\u7f51\u7edc\u63a5\u53e3\u9ed8\u8ba4\u90fd\u662f\u865a\u62df\u63a5\u53e3\u3002<\/p>\n<p>\u5f53\u4f7f\u7528 nerdctl \u521b\u5efa\u5bb9\u5668\u65f6, nerdctl \u547d\u4ee4\u4f1a\u521b\u5efa\u4e00\u4e2a\u540d\u79f0\u4e3a bridge \u7684 Linux \u7f51\u6865(\u5176\u4e0a\u6709\u4e00\u4e2a nerdctl0 \u5185\u90e8\u63a5\u53e3), \u5229\u7528\u4e86 Linux \u865a\u62df\u7f51\u7edc\u6280\u672f, \u5728\u672c\u5730\u4e3b\u673a\u548c\u5bb9\u5668\u5185\u5206\u522b\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u63a5\u53e3, \u5e76\u8ba9\u5b83\u4eec\u5f7c\u6b64\u8fde\u901a(\u8fd9\u6837\u7684\u4e00\u5bf9\u63a5\u53e3\u53eb\u505a veth pair)\u3002Containerd \u9ed8\u8ba4\u6307\u5b9a\u4e86 nerdctl0 \u63a5\u53e3\u7684 IP \u5730\u5740\u548c\u5b50\u7f51\u63a9\u7801, \u8ba9\u4e3b\u673a\u548c\u5bb9\u5668\u4e4b\u95f4\u53ef\u4ee5\u901a\u8fc7\u7f51\u6865\u76f8\u4e92\u901a\u4fe1\u3002<\/p>\n<p>\u793a\u4f8b(\u4ee5\u4e0b IP \u4e3a\u5b9e\u9a8c\u73af\u5883\u53d6\u503c, \u4f60\u81ea\u5df1\u7684\u73af\u5883\u4f1a\u4e0d\u540c):<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl run -d busybox &#8212; sleep infinity<\/span><br \/>\nb721795e02103578656152662f414e88f32191e64976ccafe60c4af10a8fa8c8<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl container ls<\/span><br \/>\nCONTAINER ID    IMAGE                             COMMAND             CREATED         STATUS    PORTS    NAMES<br \/>\nb721795e0210    docker.io\/library\/busybox:latest  <span class=\"token string\">&#034;sleep infinity&#034;<\/span>    <span class=\"token number\">12<\/span> seconds ago  Up                 busybox-b7217<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl exec busybox-b7217 &#8212; ip a<\/span><br \/>\n<span class=\"token number\">1<\/span>: lo: <span class=\"token operator\">&lt;<\/span>LOOPBACK,UP,LOWER_UP<span class=\"token operator\">&gt;<\/span> mtu <span class=\"token number\">65536<\/span> qdisc noqueue qlen <span class=\"token number\">1000<\/span><br \/>\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br \/>\n    inet <span class=\"token number\">127.0<\/span>.0.1\/8 scope <span class=\"token function\">host<\/span> lo<br \/>\n       valid_lft forever preferred_lft forever<br \/>\n    inet6 ::1\/128 scope <span class=\"token function\">host<\/span><br \/>\n       valid_lft forever preferred_lft forever<br \/>\n<span class=\"token number\">2<\/span>: eth0&#064;if5: <span class=\"token operator\">&lt;<\/span>BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN<span class=\"token operator\">&gt;<\/span> mtu <span class=\"token number\">1500<\/span> qdisc noqueue<br \/>\n    link\/ether f6:fc:0b:35:5e:2c brd ff:ff:ff:ff:ff:ff<br \/>\n    inet <span class=\"token number\">10.4<\/span>.0.18\/24 brd <span class=\"token number\">10.4<\/span>.0.255 scope global eth0<br \/>\n       valid_lft forever preferred_lft forever<br \/>\n    inet6 fe80::f4fc:bff:fe35:5e2c\/64 scope <span class=\"token function\">link<\/span><br \/>\n       valid_lft forever preferred_lft forever<\/p>\n<p>\u5bb9\u5668\u5185\u770b\u5230\u7684\u7f51\u5361\u540d: 2: eth0&#064;if5, &#064;if5 \u4ee3\u8868\u5bf9\u7aef\u662f 5 \u53f7\u7f51\u5361\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ip a<\/span><br \/>\n<span class=\"token number\">1<\/span>: lo: <span class=\"token operator\">&lt;<\/span>LOOPBACK,UP,LOWER_UP<span class=\"token operator\">&gt;<\/span> mtu <span class=\"token number\">65536<\/span> qdisc noqueue state UNKNOWN group default qlen <span class=\"token number\">1000<\/span><br \/>\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00<br \/>\n    inet <span class=\"token number\">127.0<\/span>.0.1\/8 scope <span class=\"token function\">host<\/span> lo<br \/>\n       valid_lft forever preferred_lft forever<br \/>\n    inet6 ::1\/128 scope <span class=\"token function\">host<\/span><br \/>\n       valid_lft forever preferred_lft forever<br \/>\n<span class=\"token number\">2<\/span>: ens160: <span class=\"token operator\">&lt;<\/span>BROADCAST,MULTICAST,UP,LOWER_UP<span class=\"token operator\">&gt;<\/span> mtu <span class=\"token number\">1500<\/span> qdisc mq state UP group default qlen <span class=\"token number\">1000<\/span><br \/>\n    link\/ether 00:0c:29:a7:b8:a7 brd ff:ff:ff:ff:ff:ff<br \/>\n    altname enp3s0<br \/>\n    inet <span class=\"token number\">192.168<\/span>.108.30\/24 brd <span class=\"token number\">192.168<\/span>.108.255 scope global noprefixroute ens160<br \/>\n       valid_lft forever preferred_lft forever<br \/>\n    inet6 fe80::20c:29ff:fea7:b8a7\/64 scope <span class=\"token function\">link<\/span> noprefixroute<br \/>\n       valid_lft forever preferred_lft forever<br \/>\n<span class=\"token number\">3<\/span>: nerdctl0: <span class=\"token operator\">&lt;<\/span>BROADCAST,MULTICAST,UP,LOWER_UP<span class=\"token operator\">&gt;<\/span> mtu <span class=\"token number\">1500<\/span> qdisc noqueue state UP group default qlen <span class=\"token number\">1000<\/span><br \/>\n    link\/ether 3a:1a:93:b7:ea:d7 brd ff:ff:ff:ff:ff:ff<br \/>\n    inet <span class=\"token number\">10.4<\/span>.0.1\/24 brd <span class=\"token number\">10.4<\/span>.0.255 scope global nerdctl0<br \/>\n       valid_lft forever preferred_lft forever<br \/>\n    inet6 fe80::381a:93ff:feb7:ead7\/64 scope <span class=\"token function\">link<\/span><br \/>\n       valid_lft forever preferred_lft forever<br \/>\n<span class=\"token number\">5<\/span>: veth790d9140&#064;if2: <span class=\"token operator\">&lt;<\/span>BROADCAST,MULTICAST,UP,LOWER_UP<span class=\"token operator\">&gt;<\/span> mtu <span class=\"token number\">1500<\/span> qdisc noqueue master nerdctl0 state UP group default<br \/>\n    link\/ether 3a:fa:0e:fd:27:5b brd ff:ff:ff:ff:ff:ff link-netnsid <span class=\"token number\">0<\/span><br \/>\n    inet6 fe80::38fa:eff:fefd:275b\/64 scope <span class=\"token function\">link<\/span><br \/>\n       valid_lft forever preferred_lft forever<\/p>\n<p>\u5bf9\u5e94\u5bb9\u5668\u4e3b\u673a\u7684\u7f51\u5361: 5: veth790d9140&#064;if2, &#064;if2 \u4ee3\u8868\u5bf9\u7aef\u5bb9\u5668\u5185\u5bf9\u5e94 2 \u53f7\u7f51\u5361\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl network ls<\/span><br \/>\nNETWORK ID      NAME      FILE<br \/>\n17f29b073143    bridge    \/etc\/cni\/net.d\/nerdctl-bridge.conflist<br \/>\n<span class=\"token function\">host<\/span><br \/>\nnone<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl network inspect bridge<\/span><br \/>\n<span class=\"token punctuation\">[<\/span><br \/>\n    <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#034;Name&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;bridge&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;Id&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;17f29b073143d8cd97b5bbe492bdeffec1c5fee55cc1fe2112c8b9335f8b6121&#034;<\/span>,<br \/>\n        <span class=\"token string\">&#034;IPAM&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;Config&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n                <span class=\"token punctuation\">{<\/span><br \/>\n                    <span class=\"token string\">&#034;Subnet&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;10.4.0.0\/24&#034;<\/span>,<br \/>\n                    <span class=\"token string\">&#034;Gateway&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;10.4.0.1&#034;<\/span><br \/>\n                <span class=\"token punctuation\">}<\/span><br \/>\n            <span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span>,<br \/>\n        <span class=\"token string\">&#034;Labels&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n            <span class=\"token string\">&#034;nerdctl\/default-network&#034;<\/span><span class=\"token builtin class-name\">:<\/span> <span class=\"token string\">&#034;true&#034;<\/span><br \/>\n        <span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token comment\"># \u4e3b\u673a\u4e2dnerdctl0\u5c31\u662f\u5bb9\u5668\u7684\u7f51\u5173<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ip addr show nerdctl0<\/span><br \/>\n<span class=\"token number\">3<\/span>: nerdctl0: <span class=\"token operator\">&lt;<\/span>BROADCAST,MULTICAST,UP,LOWER_UP<span class=\"token operator\">&gt;<\/span> mtu <span class=\"token number\">1500<\/span> qdisc noqueue state UP group default qlen <span class=\"token number\">1000<\/span><br \/>\n    link\/ether 3a:1a:93:b7:ea:d7 brd ff:ff:ff:ff:ff:ff<br \/>\n    inet <span class=\"token number\">10.4<\/span>.0.1\/24 brd <span class=\"token number\">10.4<\/span>.0.255 scope global nerdctl0<br \/>\n       valid_lft forever preferred_lft forever<br \/>\n    inet6 fe80::381a:93ff:feb7:ead7\/64 scope <span class=\"token function\">link<\/span><br \/>\n       valid_lft forever preferred_lft forever<\/p>\n<p>\u76ee\u524d Containerd \u7f51\u6865\u662f Linux \u7f51\u6865, \u7528\u6237\u53ef\u4ee5\u4f7f\u7528 brctl show \u547d\u4ee4\u67e5\u770b\u7f51\u6865\u548c\u7aef\u53e3\u8fde\u63a5\u4fe1\u606f\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># brctl show<\/span><br \/>\nbridge name     bridge <span class=\"token function\">id<\/span>               STP enabled     interfaces<br \/>\nnerdctl0        <span class=\"token number\">8000<\/span>.3a1a93b7ead7       no              veth790d9140<\/p>\n<p>nerdctl network \u547d\u4ee4\u4f7f\u7528\u5e2e\u52a9:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl network &#8211;help<\/span><br \/>\nManage networks<\/p>\n<p>Usage: nerdctl network <span class=\"token punctuation\">[<\/span>flags<span class=\"token punctuation\">]<\/span><\/p>\n<p>Commands:<br \/>\n  create    Create a network<br \/>\n  inspect   Display detailed information on one or <span class=\"token function\">more<\/span> networks<br \/>\n  <span class=\"token function\">ls<\/span>        List networks<br \/>\n  prune     Remove all unused networks<br \/>\n  <span class=\"token function\">rm<\/span>        Remove one or <span class=\"token function\">more<\/span> networks<\/p>\n<p>Flags:<br \/>\n  -h, <span class=\"token parameter variable\">&#8211;help<\/span>   <span class=\"token builtin class-name\">help<\/span> <span class=\"token keyword\">for<\/span> network<\/p>\n<p>See also <span class=\"token string\">&#039;nerdctl &#8211;help&#039;<\/span> <span class=\"token keyword\">for<\/span> the global flags such as <span class=\"token string\">&#039;&#8211;namespace&#039;<\/span>, <span class=\"token string\">&#039;&#8211;snapshotter&#039;<\/span>, and <span class=\"token string\">&#039;&#8211;cgroup-manager&#039;<\/span><span class=\"token builtin class-name\">.<\/span><\/p>\n<h4>nerdctl \u7ba1\u7406\u5b58\u50a8<\/h4>\n<p>nerdctl volume \u547d\u4ee4\u4f7f\u7528\u5e2e\u52a9:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl volume &#8211;help<\/span><br \/>\nManage volumes<\/p>\n<p>Usage: nerdctl volume <span class=\"token punctuation\">[<\/span>flags<span class=\"token punctuation\">]<\/span><\/p>\n<p>Commands:<br \/>\n  create    Create a volume<br \/>\n  inspect   Display detailed information on one or <span class=\"token function\">more<\/span> volumes<br \/>\n  <span class=\"token function\">ls<\/span>        List volumes<br \/>\n  prune     Remove all unused <span class=\"token builtin class-name\">local<\/span> volumes<br \/>\n  <span class=\"token function\">rm<\/span>        Remove one or <span class=\"token function\">more<\/span> volumes<\/p>\n<p>Flags:<br \/>\n  -h, <span class=\"token parameter variable\">&#8211;help<\/span>   <span class=\"token builtin class-name\">help<\/span> <span class=\"token keyword\">for<\/span> volume<\/p>\n<p>See also <span class=\"token string\">&#039;nerdctl &#8211;help&#039;<\/span> <span class=\"token keyword\">for<\/span> the global flags such as <span class=\"token string\">&#039;&#8211;namespace&#039;<\/span>, <span class=\"token string\">&#039;&#8211;snapshotter&#039;<\/span>, and <span class=\"token string\">&#039;&#8211;cgroup-manager&#039;<\/span><span class=\"token builtin class-name\">.<\/span><\/p>\n<p>nerdctl \u547d\u4ee4\u521b\u5efa\u5bb9\u5668\u7684\u65f6\u5019, \u53ef\u4ee5\u4f7f\u7528 -v \u9009\u9879\u5c06\u672c\u5730\u76ee\u5f55\u6302\u8f7d\u7ed9\u5bb9\u5668\u5b9e\u73b0\u6570\u636e\u6301\u4e45\u5316\u3002<\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># mkdir \/data<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl run -d -v \/data:\/data busybox &#8212; sleep infinity<\/span><br \/>\nd00a1646169a199e3038851f86b82bff03ac2db6ffd8ea3e875789d2a6d1a000<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># touch \/data\/f1<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl exec busybox-d00a1 &#8212; ls \/data<\/span><br \/>\nf1<\/p>\n<p>nerdctl \u547d\u4ee4\u521b\u5efa\u5bb9\u5668\u7684\u65f6\u5019, \u4e5f\u53ef\u4ee5\u4f7f\u7528 -v \u9009\u9879\u6307\u5b9a volume\u3002<\/p>\n<p><span class=\"token comment\"># \u76f4\u63a5\u5199\u5bb9\u5668\u76ee\u5f55, \u4f1a\u81ea\u52a8\u751f\u6210\u76ee\u5f55<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl run -d -v \/data busybox &#8212; sleep infinity<\/span><br \/>\n29c94622886a219c93b5f6cd1c1ab190f998c66e3b4cbce75437507803b82eea<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl exec busybox-29c94 &#8212; touch \/data\/f2<\/span><br \/>\n<span class=\"token comment\">#\u5728\/var\/lib\/nerdctl\/xx\/volumes\/default\/xx\/_data\/f2<\/span><\/p>\n<p><span class=\"token comment\">#\u6307\u5b9a\u5bbf\u4e3b\u673a\u751f\u6210\u7684\u76ee\u5f55\u540d\u4e3adata<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl run -d -v data:\/data busybox &#8212; sleep infinity<\/span><br \/>\n1b1fc00e88471a5abd8787bae438ab8d5ab08f4ec4fa073805407f9fffe2fe73<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl exec busybox-1b1fc &#8212; touch \/data\/f3<\/span><\/p>\n<p><span class=\"token comment\"># \u751f\u6210data\u540d\u5b57\u7684\u5377<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl volume ls<\/span><br \/>\nVOLUME NAME                                                              DIRECTORY<br \/>\n0c70033c26bcf456d9a0dc3f7dfe723f232e48dee2c8898bf987f8aeebacc1c7         \/var\/lib\/nerdctl\/1935db59\/volumes\/default\/0c70033c26bcf456d9a0dc3f7dfe723f232e48dee2c8898bf987f8aeebacc1c7\/_data<br \/>\ndata                                                                     \/var\/lib\/nerdctl\/1935db59\/volumes\/default\/data\/_data<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ls \/var\/lib\/nerdctl\/1935db59\/volumes\/default\/0c70033c26bcf456d9a0dc3f7dfe723f232e48dee2c8898bf987f8aeebacc1c7\/_data<\/span><br \/>\nf2<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># ls \/var\/lib\/nerdctl\/1935db59\/volumes\/default\/data\/_data<\/span><br \/>\nf3<\/p>\n<h4>nerdctl \u7ba1\u7406\u547d\u540d\u7a7a\u95f4<\/h4>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl namespace<\/span><br \/>\nUnrelated to Linux namespaces and Kubernetes namespaces<\/p>\n<p>Usage: nerdctl namespace <span class=\"token punctuation\">[<\/span>flags<span class=\"token punctuation\">]<\/span><\/p>\n<p>Aliases: namespace, ns<\/p>\n<p>Commands:<br \/>\n  create    Create a new namespace<br \/>\n  inspect   Display detailed information on one or <span class=\"token function\">more<\/span> namespaces.<br \/>\n  <span class=\"token function\">ls<\/span>        List containerd namespaces<br \/>\n  remove    Remove one or <span class=\"token function\">more<\/span> namespaces<br \/>\n  update    Update labels <span class=\"token keyword\">for<\/span> a namespace<\/p>\n<p>Flags:<br \/>\n  -h, <span class=\"token parameter variable\">&#8211;help<\/span>   <span class=\"token builtin class-name\">help<\/span> <span class=\"token keyword\">for<\/span> namespace<\/p>\n<p>See also <span class=\"token string\">&#039;nerdctl &#8211;help&#039;<\/span> <span class=\"token keyword\">for<\/span> the global flags such as <span class=\"token string\">&#039;&#8211;namespace&#039;<\/span>, <span class=\"token string\">&#039;&#8211;snapshotter&#039;<\/span>, and <span class=\"token string\">&#039;&#8211;cgroup-manager&#039;<\/span><span class=\"token builtin class-name\">.<\/span><\/p>\n<p>\u793a\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># nerdctl namespace ls<\/span><br \/>\nNAME       CONTAINERS    IMAGES    VOLUMES    LABELS<br \/>\ndefault    <span class=\"token number\">10<\/span>            <span class=\"token number\">4<\/span>         <span class=\"token number\">2<\/span><\/p>\n<h3>\u516b\u3001crictl \u5b9e\u8df5<\/h3>\n<h4>crictl \u547d\u4ee4\u4ecb\u7ecd<\/h4>\n<p>crictl \u547d\u4ee4\u662f\u9075\u5faa CRI \u63a5\u53e3\u89c4\u8303\u7684\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177, \u901a\u5e38\u7528\u5b83\u6765\u68c0\u67e5\u548c\u7ba1\u7406 kubelet \u8282\u70b9\u4e0a\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\u548c\u955c\u50cf\u3002<\/p>\n<p>\u5728 kubernetes \u96c6\u7fa4\u73af\u5883\u4e2d, \u5f53\u6211\u4eec\u6267\u884c kubectl \u547d\u4ee4\u65f6, kubelet \u4ee3\u7406\u4f1a\u81ea\u52a8\u8c03\u7528 crictl \u547d\u4ee4\u7ba1\u7406\u955c\u50cf\u548c\u5bb9\u5668\u3002<\/p>\n<p>\u624b\u52a8\u6267\u884c crictl \u547d\u4ee4\u65f6, \u4e00\u822c\u7528\u4e8e\u67e5\u770b\u955c\u50cf\u548c\u5bb9\u5668\u3002<\/p>\n<h4>crictl \u547d\u4ee4\u5b89\u88c5<\/h4>\n<p>\u914d\u7f6e kubernetes \u6e90:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/yum.repos.d\/kubernetes.repo<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>kubernetes<span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token assign-left variable\">name<\/span><span class=\"token operator\">&#061;<\/span>Kubernetes<br \/>\n<span class=\"token assign-left variable\">baseurl<\/span><span class=\"token operator\">&#061;<\/span>https:\/\/mirrors.aliyun.com\/kubernetes-new\/core\/stable\/v1.30\/rpm\/<br \/>\n<span class=\"token assign-left variable\">enabled<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><br \/>\n<span class=\"token assign-left variable\">gpgcheck<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><br \/>\n<span class=\"token assign-left variable\">gpgkey<\/span><span class=\"token operator\">&#061;<\/span>https:\/\/mirrors.aliyun.com\/kubernetes-new\/core\/stable\/v1.30\/rpm\/repodata\/repomd.xml.key<\/p>\n<p>\u5b89\u88c5 CRI \u547d\u4ee4:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># yum install -y cri-tools<\/span><\/p>\n<h4>crictl \u547d\u4ee4\u914d\u7f6e<\/h4>\n<p>\u4f7f\u7528 crictl \u547d\u4ee4\u4e4b\u524d, \u9700\u8981\u5148\u914d\u7f6e \/etc\/crictl.yaml\u3002<\/p>\n<p>\u793a\u4f8b: \u914d\u7f6e crictl \u540e\u7aef\u8fd0\u884c\u65f6\u4f7f\u7528 containerd\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># vim \/etc\/crictl.yaml<\/span><br \/>\nruntime-endpoint: unix:\/\/\/run\/containerd\/containerd.sock<br \/>\nimage-endpoint: unix:\/\/\/run\/containerd\/containerd.sock<br \/>\ntimeout: <span class=\"token number\">5<\/span><br \/>\ndebug: <span class=\"token boolean\">false<\/span><\/p>\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u8fdb\u884c\u8bbe\u7f6e:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># crictl config runtime-endpoint unix:\/\/\/run\/containerd\/containerd.sock<\/span><br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># crictl config image-endpoint unix:\/\/\/run\/containerd\/containerd.sock<\/span><\/p>\n<p>\u66f4\u591a\u547d\u4ee4\u64cd\u4f5c, \u53ef\u4ee5\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u8f93\u5165\u547d\u4ee4\u67e5\u770b\u5e2e\u52a9\u3002<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># crictl config &#8211;help<\/span><br \/>\nNAME:<br \/>\n   crictl config &#8211; Get and <span class=\"token builtin class-name\">set<\/span> crictl client configuration options<\/p>\n<p>USAGE:<br \/>\n   crictl config <span class=\"token punctuation\">[<\/span>command options<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token operator\">&lt;<\/span>crictl options<span class=\"token operator\">&gt;<\/span><span class=\"token punctuation\">]<\/span><\/p>\n<p>EXAMPLE:<br \/>\n   crictl config <span class=\"token parameter variable\">&#8211;set<\/span> <span class=\"token assign-left variable\">debug<\/span><span class=\"token operator\">&#061;<\/span>true<\/p>\n<p>CRICTL OPTIONS:<br \/>\n   runtime-endpoint:      Container runtime endpoint<br \/>\n   image-endpoint:        Image endpoint<br \/>\n   timeout:               Timeout of connecting to server <span class=\"token punctuation\">(<\/span>default: 2s<span class=\"token punctuation\">)<\/span><br \/>\n   debug:                 Enable debug output <span class=\"token punctuation\">(<\/span>default: <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   pull-image-on-create:  Enable pulling image on create requests <span class=\"token punctuation\">(<\/span>default: <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   disable-pull-on-run:   Disable pulling image on run requests <span class=\"token punctuation\">(<\/span>default: <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>OPTIONS:<br \/>\n   <span class=\"token parameter variable\">&#8211;get<\/span> value                  show the option value<br \/>\n   <span class=\"token parameter variable\">&#8211;list<\/span>                       show all option value <span class=\"token punctuation\">(<\/span>default: <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;set<\/span> value <span class=\"token punctuation\">[<\/span> <span class=\"token parameter variable\">&#8211;set<\/span> value <span class=\"token punctuation\">]<\/span>  <span class=\"token builtin class-name\">set<\/span> option <span class=\"token punctuation\">(<\/span>can specify multiple or separate values with commas: <span class=\"token assign-left variable\">opt1<\/span><span class=\"token operator\">&#061;<\/span>val1,opt2<span class=\"token operator\">&#061;<\/span>val2<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;help, <span class=\"token parameter variable\">-h<\/span>                   show <span class=\"token builtin class-name\">help<\/span><\/p>\n<h4>crictl \u547d\u4ee4\u5b9e\u8df5<\/h4>\n<p>\u5e2e\u52a9\u4fe1\u606f:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># crictl<\/span><br \/>\nNAME:<br \/>\n   crictl &#8211; client <span class=\"token keyword\">for<\/span> CRI<\/p>\n<p>USAGE:<br \/>\n   crictl <span class=\"token punctuation\">[<\/span>global options<span class=\"token punctuation\">]<\/span> <span class=\"token builtin class-name\">command<\/span> <span class=\"token punctuation\">[<\/span>command options<span class=\"token punctuation\">]<\/span><\/p>\n<p>VERSION:<br \/>\n   v1.30.1<\/p>\n<p>COMMANDS:<br \/>\n   attach              Attach to a running container<br \/>\n   create              Create a new container<br \/>\n   <span class=\"token builtin class-name\">exec<\/span>                Run a <span class=\"token builtin class-name\">command<\/span> <span class=\"token keyword\">in<\/span> a running container<br \/>\n   version             Display runtime version information<br \/>\n   images, image, img  List images<br \/>\n   inspect             Display the status of one or <span class=\"token function\">more<\/span> containers<br \/>\n   inspecti            Return the status of one or <span class=\"token function\">more<\/span> images<br \/>\n   imagefsinfo         Return image filesystem info<br \/>\n   inspectp            Display the status of one or <span class=\"token function\">more<\/span> pods<br \/>\n   logs                Fetch the logs of a container<br \/>\n   port-forward        Forward <span class=\"token builtin class-name\">local<\/span> port to a pod<br \/>\n   <span class=\"token function\">ps<\/span>                  List containers<br \/>\n   pull                Pull an image from a registry<br \/>\n   run                 Run a new container inside a sandbox<br \/>\n   runp                Run a new pod<br \/>\n   <span class=\"token function\">rm<\/span>                  Remove one or <span class=\"token function\">more<\/span> containers<br \/>\n   rmi                 Remove one or <span class=\"token function\">more<\/span> images<br \/>\n   rmp                 Remove one or <span class=\"token function\">more<\/span> pods<br \/>\n   pods                List pods<br \/>\n   start               Start one or <span class=\"token function\">more<\/span> created containers<br \/>\n   info                Display information of the container runtime<br \/>\n   stop                Stop one or <span class=\"token function\">more<\/span> running containers<br \/>\n   stopp               Stop one or <span class=\"token function\">more<\/span> running pods<br \/>\n   update              Update one or <span class=\"token function\">more<\/span> running containers<br \/>\n   config              Get and <span class=\"token builtin class-name\">set<\/span> crictl client configuration options<br \/>\n   stats               List container<span class=\"token punctuation\">(<\/span>s<span class=\"token punctuation\">)<\/span> resource usage statistics<br \/>\n   statsp              List pod statistics. Stats represent a structured API that will fulfill the Kubelet<span class=\"token string\">&#039;s \/stats\/summary endpoint.<br \/>\n   metricsp            List pod metrics. Metrics are unstructured key\/value pairs gathered by CRI meant to replace cAdvisor&#039;<\/span>s \/metrics\/cadvisor endpoint.<br \/>\n   completion          Output shell completion code<br \/>\n   checkpoint          Checkpoint one or <span class=\"token function\">more<\/span> running containers<br \/>\n   runtime-config      Retrieve the container runtime configuration<br \/>\n   events, event       Stream the events of containers<br \/>\n   help, h             Shows a list of commands or <span class=\"token builtin class-name\">help<\/span> <span class=\"token keyword\">for<\/span> one <span class=\"token builtin class-name\">command<\/span><\/p>\n<p>GLOBAL OPTIONS:<br \/>\n   <span class=\"token parameter variable\">&#8211;config<\/span> value, <span class=\"token parameter variable\">-c<\/span> value    Location of the client config file. If not specified and the default does not exist, the program<span class=\"token string\">&#039;s directory is searched as well (default: &#034;\/etc\/crictl.yaml&#034;) [$CRI_CONFIG_FILE]<br \/>\n   &#8211;debug, -D                 Enable debug mode (default: false)<br \/>\n   &#8211;enable-tracing            Enable OpenTelemetry tracing. (default: false)<br \/>\n   &#8211;image-endpoint value, -i value      Endpoint of CRI image manager service (default: uses &#039;<\/span>runtime-endpoint&#039; setting<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token variable\">$IMAGE_SERVICE_ENDPOINT<\/span><span class=\"token punctuation\">]<\/span><br \/>\n   &#8211;runtime-endpoint value, <span class=\"token parameter variable\">-r<\/span> value    Endpoint of CRI container runtime <span class=\"token function\">service<\/span> <span class=\"token punctuation\">(<\/span>default: uses <span class=\"token keyword\">in<\/span> order the first successful one of <span class=\"token punctuation\">[<\/span>unix:\/\/\/run\/containerd\/containerd.sock unix:\/\/\/run\/crio\/crio.sock unix:\/\/\/var\/run\/cri-dockerd.sock<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span>. Default is now deprecated and the endpoint should be <span class=\"token builtin class-name\">set<\/span> instead. <span class=\"token punctuation\">[<\/span><span class=\"token variable\">$CONTAINER_RUNTIME_ENDPOINT<\/span><span class=\"token punctuation\">]<\/span><br \/>\n   <span class=\"token parameter variable\">&#8211;timeout<\/span> value, <span class=\"token parameter variable\">-t<\/span> value   Timeout of connecting to the server <span class=\"token keyword\">in<\/span> seconds <span class=\"token punctuation\">(<\/span>e.g. 2s, 20s.<span class=\"token punctuation\">)<\/span>. <span class=\"token number\">0<\/span> or <span class=\"token function\">less<\/span> is <span class=\"token builtin class-name\">set<\/span> to default <span class=\"token punctuation\">(<\/span>default: 2s<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;tracing-endpoint value    Address to <span class=\"token function\">which<\/span> the gRPC tracing collector will send spans to. <span class=\"token punctuation\">(<\/span>default: <span class=\"token string\">&#034;127.0.0.1:4317&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;tracing-sampling-rate-per-million value    Number of samples to collect per million OpenTelemetry spans. Set to <span class=\"token number\">1000000<\/span> to always sample. <span class=\"token punctuation\">(<\/span>default: -1<span class=\"token punctuation\">)<\/span><br \/>\n   &#8211;help, <span class=\"token parameter variable\">-h<\/span>                  show <span class=\"token builtin class-name\">help<\/span><br \/>\n   &#8211;version, <span class=\"token parameter variable\">-v<\/span>               print the version<\/p>\n<p>\u6848\u4f8b:<\/p>\n<p><span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># crictl pull &lt;\u955c\u50cf\u52a0\u901f\u5730\u5740&gt;.mirror.swr.myhuaweicloud.com\/library\/nginx:latest<\/span><br \/>\nImage is up to <span class=\"token function\">date<\/span> <span class=\"token keyword\">for<\/span> sha256:9f33606b36859ee2db3b761a893fb7c2fc8a13c0fe5f24e304b129f3caf499ad<br \/>\n<span class=\"token punctuation\">[<\/span>root&#064;localhost ~<span class=\"token punctuation\">]<\/span><span class=\"token comment\"># crictl images<\/span><br \/>\nIMAGE                      TAG        IMAGE ID           SIZE<br \/>\ndocker.io\/library\/httpd    latest     65005131d37e9      <span class=\"token number\">45<\/span>.2MB<\/p>\n<p>\u955c\u50cf\u547d\u4ee4:<\/p>\n<p>images, image, img  List images<br \/>\npull                Pull an image from a registry<br \/>\ninspecti            Return the status of one or <span class=\"token function\">more<\/span> images<br \/>\nimagefsinfo         Return image filesystem info<br \/>\nrmi                 Remove one or <span class=\"token function\">more<\/span> images<\/p>\n<p>\u5bb9\u5668\u547d\u4ee4:<\/p>\n<p><span class=\"token function\">ps<\/span>                  List containers<br \/>\ncreate              Create a new container<br \/>\nrun                 Run a new container inside a sandbox<br \/>\ninspect             Display the status of one or <span class=\"token function\">more<\/span> containers<br \/>\ninfo                Display information of the container runtime<br \/>\nattach              Attach to a running container<br \/>\n<span class=\"token builtin class-name\">exec<\/span>                Run a <span class=\"token builtin class-name\">command<\/span> <span class=\"token keyword\">in<\/span> a running container<br \/>\nlogs                Fetch the logs of a container<br \/>\nupdate              Update one or <span class=\"token function\">more<\/span> running containers<br \/>\nstats               List container<span class=\"token punctuation\">(<\/span>s<span class=\"token punctuation\">)<\/span> resource usage statistics<br \/>\ncheckpoint          Checkpoint one or <span class=\"token function\">more<\/span> running containers<br \/>\nstart               Start one or <span class=\"token function\">more<\/span> created containers<br \/>\nstop                Stop one or <span class=\"token function\">more<\/span> running containers<br \/>\n<span class=\"token function\">rm<\/span>                  Remove one or <span class=\"token function\">more<\/span> containers<\/p>\n<p>pod \u547d\u4ee4:<\/p>\n<p>pods                List pods<br \/>\nrunp                Run a new pod<br \/>\ninspectp            Display the status of one or <span class=\"token function\">more<\/span> pods<br \/>\nstatsp              List pod resource usage statistics<br \/>\nport-forward        Forward <span class=\"token builtin class-name\">local<\/span> port to a pod<br \/>\nstopp               Stop one or <span class=\"token function\">more<\/span> running pods<br \/>\nrmp                 Remove one or <span class=\"token function\">more<\/span> pods<\/p>\n<p>\u5176\u4ed6\u547d\u4ee4:<\/p>\n<p>version             Display runtime version information<br \/>\nconfig              Get and <span class=\"token builtin class-name\">set<\/span> crictl client configuration options<br \/>\ncompletion          Output shell completion code<br \/>\nhelp, h             Shows a list of commands or <span class=\"token builtin class-name\">help<\/span> <span class=\"token keyword\">for<\/span> one <span class=\"token builtin class-name\">command<\/span><\/p>\n<h4>\u547d\u4ee4\u884c\u5bf9\u7167\u8868<\/h4>\n<table>\n<tr>\u547d\u4ee4\u529f\u80fddockerpodmannerdctlctrcrictl<\/tr>\n<tbody>\n<tr>\n<td>\u67e5\u770b\u5bb9\u5668\u72b6\u6001<\/td>\n<td>docker ps<\/td>\n<td>podman ps<\/td>\n<td>nerdctl ps<\/td>\n<td>ctr task ls \/ ctr container ls<\/td>\n<td>crictl ps<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u955c\u50cf<\/td>\n<td>docker images<\/td>\n<td>podman images<\/td>\n<td>nerdctl images<\/td>\n<td>ctr image ls<\/td>\n<td>crictl images<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u5bb9\u5668\u65e5\u5fd7<\/td>\n<td>docker logs<\/td>\n<td>podman logs<\/td>\n<td>nerdctl logs<\/td>\n<td>\u65e0<\/td>\n<td>crictl logs<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u5bb9\u5668\u4fe1\u606f<\/td>\n<td>docker inspect<\/td>\n<td>podman inspect<\/td>\n<td>nerdctl inspect<\/td>\n<td>ctr container info<\/td>\n<td>crictl inspect<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u5bb9\u5668\u8d44\u6e90<\/td>\n<td>docker stats<\/td>\n<td>podman stats<\/td>\n<td>nerdctl stats<\/td>\n<td>\u65e0<\/td>\n<td>crictl stats<\/td>\n<\/tr>\n<tr>\n<td>\u8fd0\u884c\u65b0\u5bb9\u5668<\/td>\n<td>docker run<\/td>\n<td>podman run<\/td>\n<td>nerdctl run<\/td>\n<td>ctr run<\/td>\n<td>\u65e0<\/td>\n<\/tr>\n<tr>\n<td>\u4fee\u6539\u955c\u50cf\u6807\u7b7e<\/td>\n<td>docker tag<\/td>\n<td>podman tag<\/td>\n<td>nerdctl tag<\/td>\n<td>ctr image tag<\/td>\n<td>\u65e0<\/td>\n<\/tr>\n<tr>\n<td>\u521b\u5efa\u65b0\u5bb9\u5668<\/td>\n<td>docker create<\/td>\n<td>podman create<\/td>\n<td>nerdctl create<\/td>\n<td>ctr container create<\/td>\n<td>crictl create<\/td>\n<\/tr>\n<tr>\n<td>\u5bfc\u5165\u955c\u50cf<\/td>\n<td>docker load<\/td>\n<td>podman load<\/td>\n<td>nerdctl load<\/td>\n<td>ctr image import<\/td>\n<td>\u65e0<\/td>\n<\/tr>\n<tr>\n<td>\u5bfc\u51fa\u955c\u50cf<\/td>\n<td>docker save<\/td>\n<td>podman save<\/td>\n<td>nerdctl save<\/td>\n<td>ctr image export<\/td>\n<td>\u65e0<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u5bb9\u5668<\/td>\n<td>docker rm<\/td>\n<td>podman rm<\/td>\n<td>nerdctl rm<\/td>\n<td>ctr container rm<\/td>\n<td>crictl rm<\/td>\n<\/tr>\n<tr>\n<td>\u5220\u9664\u955c\u50cf<\/td>\n<td>docker rmi<\/td>\n<td>podman rmi<\/td>\n<td>nerdctl rmi<\/td>\n<td>ctr image rm<\/td>\n<td>crictl rmi<\/td>\n<\/tr>\n<tr>\n<td>\u62c9\u53d6\u955c\u50cf<\/td>\n<td>docker pull<\/td>\n<td>podman pull<\/td>\n<td>nerdctl pull<\/td>\n<td>ctr image pull<\/td>\n<td>crictl pull<\/td>\n<\/tr>\n<tr>\n<td>\u63a8\u9001\u955c\u50cf<\/td>\n<td>docker push<\/td>\n<td>podman push<\/td>\n<td>nerdctl push<\/td>\n<td>ctr image push<\/td>\n<td>\u65e0<\/td>\n<\/tr>\n<tr>\n<td>\u5728\u5bb9\u5668\u5185\u90e8\u6267\u884c\u547d\u4ee4<\/td>\n<td>docker exec<\/td>\n<td>podman exec<\/td>\n<td>nerdctl exec<\/td>\n<td>\u65e0<\/td>\n<td>crictl exec<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5982\u679c\u60a8\u8fd8\u5bf9 Docker \u6bd4\u8f83\u6000\u65e7\u7684\u8bdd, \u6267\u884c alias docker&#061;nerdctl \u8fd9\u6837\u7684\u547d\u4ee4\u540e, \u60a8\u4f9d\u7136\u53ef\u4ee5\u4f53\u9a8c\u5230\u4e0e Docker \u76f8\u4f3c\u7684\u611f\u89c9\u3002<\/p>\n<p>nerdctl \u548c crictl \u90fd\u662f\u7528\u4e8e\u7ba1\u7406\u548c\u64cd\u4f5c\u5bb9\u5668\u7684\u547d\u4ee4\u884c\u5de5\u5177, \u4f46\u662f\u5b83\u4eec\u5728\u5f00\u53d1\u8005\u3001\u8bbe\u8ba1\u76ee\u7684\u548c\u529f\u80fd\u4e0a\u6709\u6240\u4e0d\u540c\u3002<\/p>\n<li>\n<p>nerdctl:<\/p>\n<ul>\n<li>\u5f00\u53d1\u8005: \u7531 Docker \u7684\u521b\u59cb\u4eba\u4e4b\u4e00, \u4e5f\u662f containerd \u9879\u76ee\u7684\u4e3b\u8981\u8d21\u732e\u8005 Akihiro Suda \u5f00\u53d1\u3002<\/li>\n<li>\u8bbe\u8ba1\u76ee\u7684: nerdctl \u662f\u4e00\u4e2a\u517c\u5bb9 Docker CLI \u7684 containerd CLI, \u610f\u5473\u7740\u5927\u90e8\u5206 Docker \u547d\u4ee4\u53ef\u4ee5\u5728 nerdctl \u4e2d\u8fd0\u884c\u3002<\/li>\n<li>\u529f\u80fd: \u5b83\u53ef\u4ee5\u7ba1\u7406\u5bb9\u5668\u7684\u751f\u547d\u5468\u671f, \u5982\u521b\u5efa\u3001\u8fd0\u884c\u3001\u505c\u6b62\u548c\u5220\u9664\u5bb9\u5668\u3002\u6b64\u5916, \u5b83\u8fd8\u652f\u6301\u955c\u50cf\u7ba1\u7406\u3001\u7f51\u7edc\u7ba1\u7406\u3001\u5377\u7ba1\u7406\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>crictl:<\/p>\n<ul>\n<li>\u5f00\u53d1\u8005: \u7531 Kubernetes \u9879\u76ee\u793e\u533a\u5f00\u53d1\u3002<\/li>\n<li>\u8bbe\u8ba1\u76ee\u7684: crictl \u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u63a5\u53e3, \u7528\u4e8e\u4e0e\u4efb\u4f55\u5b9e\u73b0\u4e86 Kubernetes \u5bb9\u5668\u8fd0\u884c\u65f6\u63a5\u53e3(CRI)\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\u8fdb\u884c\u4ea4\u4e92, \u4f8b\u5982 containerd\u3001CRI-O \u7b49\u3002<\/li>\n<li>\u529f\u80fd: \u5b83\u4e3b\u8981\u7528\u4e8e\u8c03\u8bd5, \u53ef\u4ee5\u4ece Kubernetes API Server \u7684\u89d2\u5ea6\u68c0\u67e5\u548c\u7406\u89e3\u5bb9\u5668\u8fd0\u884c\u65f6\u7684\u884c\u4e3a\u3002\u5b83\u5141\u8bb8\u7528\u6237\u76f4\u63a5\u4e0e\u5bb9\u5668\u8fd0\u884c\u65f6\u8fdb\u884c\u4ea4\u4e92, \u5b9e\u73b0\u5bb9\u5668\u751f\u547d\u5468\u671f\u7ba1\u7406\u3001\u955c\u50cf\u7ba1\u7406\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<p>\u603b\u7684\u6765\u8bf4, \u4e8c\u8005\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u4ed6\u4eec\u7684\u4f7f\u7528\u573a\u666f\u548c\u76ee\u6807\u7528\u6237\u5e76\u4e0d\u5b8c\u5168\u76f8\u540c\u3002nerdctl \u66f4\u9002\u5408\u9700\u8981 Docker CLI \u517c\u5bb9\u6027\u7684\u7528\u6237, \u800c crictl \u5219\u66f4\u9002\u5408\u9700\u8981\u8c03\u8bd5\u548c\u7406\u89e3 Kubernetes CRI \u5bb9\u5668\u8fd0\u884c\u65f6\u884c\u4e3a\u7684\u7528\u6237\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb9\u5668\u7ba1\u7406\u5de5\u5177 Containerd<br \/>\n\u4e00\u3001Containerd \u4ecb\u7ecd<br \/>\n1. \u524d\u8a00<br \/>\n\u65e9\u5728 2016 \u5e74 3 \u6708, Docker 1.11 \u7684 Docker Engine \u91cc\u5c31\u5305\u542b\u4e86 containerd, \u800c\u73b0\u5728\u5219\u662f\u628a containerd \u4ece Docker Engine \u91cc\u5f7b\u5e95\u5265\u79bb\u51fa\u6765, \u4f5c\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u5f00\u6e90\u9879\u76ee\u72ec\u7acb\u53d1\u5c55, \u76ee\u6807\u662f\u63d0\u4f9b\u4e00\u4e2a\u66f4\u52a0\u5f00\u653e\u3001\u7a33\u5b9a\u7684\u5bb9\u5668\u8fd0\u884c\u57fa\u7840\u8bbe\u65bd\u3002\u548c\u539f\u5148\u5305\u542b\u5728 Docker Engine \u91cc\u7684 containerd \u76f8\u6bd4, \u72ec\u7acb\u7684 containerd \u5c06<\/p>\n","protected":false},"author":2,"featured_media":107814,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[27],"topic":[],"class_list":["post-107819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-docker"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd - \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\/107819.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5bb9\u5668\u7ba1\u7406\u5de5\u5177 Containerd \u4e00\u3001Containerd \u4ecb\u7ecd 1. \u524d\u8a00 \u65e9\u5728 2016 \u5e74 3 \u6708, Docker 1.11 \u7684 Docker Engine \u91cc\u5c31\u5305\u542b\u4e86 containerd, \u800c\u73b0\u5728\u5219\u662f\u628a containerd \u4ece Docker Engine \u91cc\u5f7b\u5e95\u5265\u79bb\u51fa\u6765, \u4f5c\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u5f00\u6e90\u9879\u76ee\u72ec\u7acb\u53d1\u5c55, \u76ee\u6807\u662f\u63d0\u4f9b\u4e00\u4e2a\u66f4\u52a0\u5f00\u653e\u3001\u7a33\u5b9a\u7684\u5bb9\u5668\u8fd0\u884c\u57fa\u7840\u8bbe\u65bd\u3002\u548c\u539f\u5148\u5305\u542b\u5728 Docker Engine \u91cc\u7684 containerd \u76f8\u6bd4, \u72ec\u7acb\u7684 containerd \u5c06\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/107819.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-20T03:40:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260920034050-6aaf55c25bd6e.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=\"33 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/107819.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/107819.html\",\"name\":\"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-20T03:40:52+00:00\",\"dateModified\":\"2026-09-20T03:40:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/107819.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/107819.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/107819.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd\"}]},{\"@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":"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd - \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\/107819.html","og_locale":"zh_CN","og_type":"article","og_title":"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5bb9\u5668\u7ba1\u7406\u5de5\u5177 Containerd \u4e00\u3001Containerd \u4ecb\u7ecd 1. \u524d\u8a00 \u65e9\u5728 2016 \u5e74 3 \u6708, Docker 1.11 \u7684 Docker Engine \u91cc\u5c31\u5305\u542b\u4e86 containerd, \u800c\u73b0\u5728\u5219\u662f\u628a containerd \u4ece Docker Engine \u91cc\u5f7b\u5e95\u5265\u79bb\u51fa\u6765, \u4f5c\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u5f00\u6e90\u9879\u76ee\u72ec\u7acb\u53d1\u5c55, \u76ee\u6807\u662f\u63d0\u4f9b\u4e00\u4e2a\u66f4\u52a0\u5f00\u653e\u3001\u7a33\u5b9a\u7684\u5bb9\u5668\u8fd0\u884c\u57fa\u7840\u8bbe\u65bd\u3002\u548c\u539f\u5148\u5305\u542b\u5728 Docker Engine \u91cc\u7684 containerd \u76f8\u6bd4, \u72ec\u7acb\u7684 containerd \u5c06","og_url":"https:\/\/www.wsisp.com\/helps\/107819.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-20T03:40:52+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260920034050-6aaf55c25bd6e.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"33 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/107819.html","url":"https:\/\/www.wsisp.com\/helps\/107819.html","name":"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-20T03:40:52+00:00","dateModified":"2026-09-20T03:40:52+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/107819.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/107819.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/107819.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Docker \u88ab K8s \u5206\u624b\u540e\uff0c\u6211\u6252\u4e86\u6252\u63a5\u76d8\u7684 containerd"}]},{"@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\/107819","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=107819"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/107819\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/107814"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=107819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=107819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=107819"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=107819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}