{"id":242,"date":"2022-01-10T11:44:12","date_gmt":"2022-01-10T03:44:12","guid":{"rendered":"https:\/\/www.db2go.net\/?p=242"},"modified":"2022-01-10T11:45:53","modified_gmt":"2022-01-10T03:45:53","slug":"%e4%bd%bf%e7%94%a8ctr%e6%93%8d%e4%bd%9ccontainerd","status":"publish","type":"post","link":"https:\/\/www.db2go.net\/?p=242","title":{"rendered":"\u4f7f\u7528ctr\u64cd\u4f5ccontainerd"},"content":{"rendered":"<ol>\n<li>\u67e5\u770b\u7248\u672c<\/li>\n<\/ol>\n<pre><code class=\"language-shell line-numbers\">[root@k8s-image ~]# ctr version\nClient:\n  Version:  v1.5.4\n  Revision: 69107e47a62e1d690afa2b9b1d43f8ece3ff4483\n  Go version: go1.16.6\n\nServer:\n  Version:  v1.5.4\n  Revision: 69107e47a62e1d690afa2b9b1d43f8ece3ff4483\n  UUID: c1159e3c-61a7-4d75-81a7-e9773e01800b\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u521b\u5efanamespace<\/li>\n<\/ol>\n<pre><code class=\"language-sh line-numbers\">[root@k8s-image ~]# ctr ns create jwdlh\n[root@k8s-image ~]# ctr ns ls\nNAME    LABELS \ndefault        \njwdlh \n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u62c9\u955c\u50cf<\/li>\n<\/ol>\n<pre><code class=\"language-shell line-numbers\">[root@k8s-image ~]# ctr -n jwdlh i pull docker.io\/library\/nginx:latest\n[root@k8s-image ~]# ctr -n jwdlh i ls\nREF                            TYPE                                                      DIGEST                                                                  SIZE     PLATFORMS                                                                                               LABELS \ndocker.io\/library\/nginx:latest application\/vnd.docker.distribution.manifest.list.v2+json sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31 54.1 MiB linux\/386,linux\/amd64,linux\/arm\/v5,linux\/arm\/v7,linux\/arm64\/v8,linux\/mips64le,linux\/ppc64le,linux\/s390x -      \n<\/code><\/pre>\n<ol start=\"4\">\n<li>\u542f\u52a8\u5bb9\u5668\u5e76\u67e5\u770b<\/li>\n<\/ol>\n<pre><code class=\"language-shell line-numbers\">[root@k8s-image ~]# ctr -n jwdlh run -d docker.io\/library\/nginx:latest  nginx-7\n[root@k8s-image ~]# \n[root@k8s-image ~]# ctr -n jwdlh i ls\nREF                            TYPE                                                      DIGEST                                                                  SIZE     PLATFORMS                                                                                               LABELS \ndocker.io\/library\/nginx:latest application\/vnd.docker.distribution.manifest.list.v2+json sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31 54.1 MiB linux\/386,linux\/amd64,linux\/arm\/v5,linux\/arm\/v7,linux\/arm64\/v8,linux\/mips64le,linux\/ppc64le,linux\/s390x - \n[root@k8s-image ~]# \n[root@k8s-image ~]# ctr -n jwdlh c ls\nCONTAINER    IMAGE                             RUNTIME                  \nnginx-7      docker.io\/library\/nginx:latest    io.containerd.runc.v2    \n[root@k8s-image ~]# ctr -n jwdlh t ls\nTASK       PID      STATUS    \nnginx-7    27131    RUNNING\n<\/code><\/pre>\n<ol start=\"5\">\n<li>ctr run\u8fd9\u4e2a\u547d\u4ee4\u76f8\u5f53\u4e8e\u505a\u4e86\u4e24\u4e2a\u6b65\u9aa4<br \/>\n\uff081\uff09ctr c create<br \/>\n\uff082\uff09ctr t start<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u67e5\u770b\u7248\u672c [root@k8s-image ~]# ctr version Client: Version: v&hellip;<\/p>\n <a href=\"https:\/\/www.db2go.net\/?p=242\" title=\"\u4f7f\u7528ctr\u64cd\u4f5ccontainerd\" class=\"entry-more-link\"><span>Read More<\/span> <span class=\"screen-reader-text\">\u4f7f\u7528ctr\u64cd\u4f5ccontainerd<\/span><\/a>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[14],"tags":[],"class_list":["entry","author-suredandan","post-242","post","type-post","status-publish","format-standard","category-14"],"views":1385,"_links":{"self":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/242","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=242"}],"version-history":[{"count":3,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions"}],"predecessor-version":[{"id":245,"href":"https:\/\/www.db2go.net\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions\/245"}],"wp:attachment":[{"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.db2go.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}