{"id":909,"date":"2021-05-24T14:31:52","date_gmt":"2021-05-24T06:31:52","guid":{"rendered":"https:\/\/www.myway5.com\/?p=909"},"modified":"2023-07-05T10:08:59","modified_gmt":"2023-07-05T02:08:59","slug":"containerd-storage","status":"publish","type":"post","link":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/","title":{"rendered":"containerd storage\u6a21\u5757\u5206\u6790"},"content":{"rendered":"<h2>\u4e00\u3001\u6982\u8ff0<\/h2>\n<p>containerd \u7684 storage \u6a21\u5757\u8d1f\u8d23\u955c\u50cf\u7684\u5b58\u50a8\uff0c\u5bb9\u5668 rootfs \u7684\u521b\u5efa\u7b49\u5de5\u4f5c\u3002\u5176\u4e3b\u8981\u5305\u62ec\u4e09\u4e2a\u5b50\u6a21\u5757\uff1a<\/p>\n<ul>\n<li>content: content \u4f1a\u5728\u672c\u5730\u76ee\u5f55\u4e0b\u4fdd\u5b58\u955c\u50cf\u7684\u5185\u5bb9\u3002\u5305\u62ec\u955c\u50cf\u7684 manifest\uff0cconfig\uff0c\u4ee5\u53ca\u955c\u50cf\u7684\u5c42\u3002\u6bcf\u4e2a\u5c42\u90fd\u662f\u4e00\u4e2a\u6587\u4ef6\uff0c\u683c\u5f0f\u662f tar+gzip\uff0c\u540d\u79f0\u4e3a\u5c42\u7684 sha256sum \u503c\u3002content \u4e2d\u5b58\u50a8\u7684\u5c42\u90fd\u662f\u4e0d\u53ef\u53d8\u7684\u3002\u4e5f\u5c31\u662f\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u5e76\u4e0d\u4f1a\u6539\u53d8\u8fd9\u91cc\u9762\u7684\u4efb\u4f55\u6587\u4ef6\u3002<\/li>\n<li>snapshot: snapshot \u5bf9\u5bb9\u5668\u8fd0\u884c\u65f6\u7684\u5c42\u505a\u4e86\u62bd\u8c61\u3002\u5206\u4e3a\u4e09\u79cd\u7c7b\u578b\uff1aCommited\uff0cActive\uff0cView\u3002\u5176\u4e2d Active \u548c View \u7c7b\u4f3c\uff0c\u4e0d\u8fc7\u524d\u8005\u53ef\u8bfb\u5199\uff0c\u540e\u8005\u53ea\u8bfb\u3002Active \u548c View \u7c7b\u578b\u7684 snapshot \u5c31\u662f\u6211\u4eec\u89c2\u5bdf\u5230\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u4e00\u822c\u662f\u6700\u4e0a\u5c42\u3002Commited \u548c\u53e6\u5916\u4e24\u4e2a\u76f8\u53cd\uff0c\u5bf9\u7528\u6237\u4e0d\u53ef\u89c1\uff0c\u4f5c\u4e3a Active \u6216 View \u7684 parent \u4f7f\u7528\u3002<\/li>\n<li>diff: diff \u7684\u4e3b\u8981\u529f\u80fd\u6709\u4e24\u4e2a\uff1aCompare \u548c Apply\u3002Compare \u8d1f\u8d23\u8ba1\u7b97 lower \u548c upper \u6302\u8f7d\u7684\u5dee\u5f02\uff0c\u7136\u540e\u4f7f\u7528 tar \u6253\u5305\u5dee\u5f02\u751f\u6210\u65b0\u7684\u955c\u50cf\u5c42\u3002Apply \u8d1f\u8d23\u5c06\u955c\u50cf\u5c42\u6302\u8f7d\u5230\u6587\u4ef6\u7cfb\u7edf\u4e0a\uff0c\u751f\u6210\u5bb9\u5668\u8fd0\u884c\u65f6\u9700\u8981\u7684 rootfs\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png\" alt=\"\" \/><\/p>\n<h2>\u4e8c\u3001content \u5982\u4f55\u5de5\u4f5c\u7684<\/h2>\n<p>content \u901a\u8fc7 GRPC \u5bf9\u5916\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u63a5\u53e3\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ ContentServer is the server API for Content service.\ntype ContentServer interface {\n    Info(context.Context, *InfoRequest) (*InfoResponse, error)\n    Update(context.Context, *UpdateRequest) (*UpdateResponse, error)\n    List(*ListContentRequest, Content_ListServer) error\n    Delete(context.Context, *DeleteContentRequest) (*types.Empty, error)\n    Read(*ReadContentRequest, Content_ReadServer) error\n    Status(context.Context, *StatusRequest) (*StatusResponse, error)\n    ListStatuses(context.Context, *ListStatusesRequest) (*ListStatusesResponse, error)\n    Write(Content_WriteServer) error\n    Abort(context.Context, *AbortRequest) (*types.Empty, error)\n}\n<\/code><\/pre>\n<p>\u63d0\u4f9b\u4e86 local \u548c proxy \u7684\u5b9e\u73b0\uff0c\u5176\u4e2d proxy \u662f\u901a\u8fc7 GRPC \u5c06\u5177\u4f53\u5b9e\u73b0\u89e3\u8026\u5408\uff0c\u56e0\u6b64\u8fd9\u91cc\u5e76\u4e0d\u8ba8\u8bba\uff0c\u4e3b\u8981\u5173\u6ce8 local \u7684\u5b9e\u73b0\u65b9\u5f0f\u3002local \u7684\u5b9e\u73b0\u4e2d\uff0c\u5c06\u4ee5\u4e0a\u63a5\u53e3\u518d\u5206\u4e3a 4 \u4e2a\u90e8\u5206\uff1a<\/p>\n<ul>\n<li>Manager: \u63d0\u4f9b\u4e86\u5bf9 content \u7684\u67e5\u8be2\uff0c\u66f4\u65b0\u548c\u5220\u9664\u64cd\u4f5c<\/li>\n<li>Provider\uff1a\u63d0\u4f9b\u4e86\u5bf9\u6307\u5b9a content \u5185\u5bb9\u7684\u8bfb\u53d6<\/li>\n<li>IngestManager\uff1a\u63d0\u4f9b\u4e86\u5bf9 ingest \u7684\u72b6\u6001\u67e5\u8be2\u548c\u7ec8\u6b62\u64cd\u4f5c\u3002<\/li>\n<li>Ingester\uff1a\u63d0\u4f9b\u4e86\u5bf9 ingest \u7684\u5199\u5165\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n<pre><code class=\"language-go line-numbers\">\/\/ Store combines the methods of content-oriented interfaces into a set that\n\/\/ are commonly provided by complete implementations.\ntype Store interface {\n    Manager\n    Provider\n    IngestManager\n    Ingester\n}\n\n\/\/ Manager provides methods for inspecting, listing and removing content.\ntype Manager interface {\n    Info(ctx context.Context, dgst digest.Digest) (Info, error)\n    Update(ctx context.Context, info Info, fieldpaths ...string) (Info, error)\n    Walk(ctx context.Context, fn WalkFunc, filters ...string) error\n    Delete(ctx context.Context, dgst digest.Digest) error\n}\n\n\/\/ Provider provides a reader interface for specific content\ntype Provider interface {\n    ReaderAt(ctx context.Context, desc ocispec.Descriptor) (ReaderAt, error)\n}\n\n\/\/ IngestManager provides methods for managing ingests.\ntype IngestManager interface {\n    Status(ctx context.Context, ref string) (Status, error)\n    ListStatuses(ctx context.Context, filters ...string) ([]Status, error)\n    Abort(ctx context.Context, ref string) error\n}\n\n\/\/ Ingester writes content\ntype Ingester interface {\n    Writer(ctx context.Context, opts ...WriterOpt) (Writer, error)\n}\n<\/code><\/pre>\n<p>\u4e3a\u4e86\u9632\u6b62\u7406\u89e3\u4e0a\u6709\u6b67\u4e49\uff0c\u8fd9\u91cc\u5bf9\u4e00\u4e9b\u672f\u8bed\u505a\u4e00\u4e9b\u8be6\u7ec6\u7684\u89e3\u91ca<\/p>\n<ul>\n<li>content: content \u4e2d\u5b58\u50a8\u7684\u6700\u5c0f\u5355\u4f4d\u53ef\u4ee5\u662f\u955c\u50cf\u7684 manifest\uff0cconfig\uff0c\u6216\u8005\u662f\u955c\u50cf\u7684\u4e00\u5c42\uff0c\u901a\u5e38\u8fd8\u5305\u542b\u8be5\u5c42\u7684\u5927\u5c0f\uff0c\u521b\u5efa\/\u4fee\u6539\u65f6\u95f4\uff0clabels \u7b49\u7b49<\/p>\n<\/li>\n<li>\n<p>digest: \u5728 content \u6a21\u5757\uff0cdigest \u6307\u7684\u662f\u955c\u50cf\u5c42\u7684 sha256sum \u503c<\/p>\n<\/li>\n<li>ingest: \u56e0\u4e3a\u6587\u4ef6\u7cfb\u7edf\u5728\u5199\u5165\u6587\u4ef6\u65f6\uff0c\u662f\u65e0\u6cd5\u4fdd\u8bc1\u539f\u5b50\u6027\u7684\u3002\u6240\u4ee5\u4e00\u822c\u7684\u89e3\u51b3\u65b9\u6848\u662f\u662f\u5148\u5199\u5165\u4e2d\u95f4\u6587\u4ef6\uff0c\u7136\u540e\u901a\u8fc7 rename \u8c03\u7528\uff0c\u628a\u4e2d\u95f4\u6587\u4ef6\u6539\u6210\u8981\u5199\u5165\u7684\u76ee\u6807\u6587\u4ef6\u3002ingest \u5c31\u662f\u8fd9\u4e2a\u4e2d\u95f4\u6587\u4ef6\u96c6\u7684\u7edf\u79f0\uff0c\u4e00\u4e2a ingest \u5bf9\u5e94\u4e00\u4e2a content\u3002ingest \u5305\u542b\u8fd9\u51e0\u4e2a\u6587\u4ef6\uff1a\n<ul>\n<li>data: content \u7684\u6570\u636e<\/li>\n<li>ref: \u6839\u636e ref \u627e\u5230 target location<\/li>\n<li>startedat: \u5f00\u59cb\u65f6\u95f4<\/li>\n<li>updatedat: \u66f4\u65b0\u65f6\u95f4<\/li>\n<li>total: content \u7684\u603b\u5927\u5c0f<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>content \u7684\u4f7f\u7528\u5176\u5b9e\u5df2\u7ecf\u5f88\u5e95\u5c42\u4e86\uff0c\u6240\u4ee5\u8fd9\u91cc\u4e0d\u51c6\u5907\u6309\u7167 content \u63d0\u4f9b\u7684\u63a5\u53e3\u8fdb\u884c\u5206\u6790\uff0c\u800c\u662f\u901a\u8fc7 <code>ctr image pull docker.io\/library\/nginx:latest<\/code> \u6765\u8bf4\u660e content \u7684\u5de5\u4f5c\u539f\u7406\u3002\u8fd9\u6761\u547d\u4ee4\u5728 <code>cmd\/ctr\/commands\/images\/pull<\/code> \u4e0b\u3002\u4e3b\u8981\u6267\u884c\u4e86\u4ee5\u4e0b\u51e0\u884c\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">client, ctx, cancel, err := commands.NewClient(context)\nctx, done, err := client.WithLease(ctx)\nconfig, err := content.NewFetchConfig(ctx, context)\nimg, err := content.Fetch(ctx, client, ref, config)\n<\/code><\/pre>\n<p><code>commands.NewClient(context)<\/code>\u4f1a\u521d\u59cb\u5316 ctr \u5230 containerd \u7684\u8fde\u63a5\u53c2\u6570\u3002\u6bd4\u5982\uff1a<\/p>\n<ul>\n<li>timeout: ctr \u8fde\u63a5 containerd \u7684\u8d85\u65f6\u65f6\u95f4\uff0c\u9ed8\u8ba4 10s<\/li>\n<li>defaultns: containerd \u4f7f\u7528 namespace \u8fdb\u884c\u79df\u6237\u9694\u79bb\u3002\u9ed8\u8ba4\u503c\u4e3a default<\/li>\n<li>address: containerd \u7684\u5730\u5740\uff0c\u9ed8\u8ba4\u503c\u662f <code>\/run\/containerd\/containerd.sock\"<\/code><\/li>\n<li>runtime: \u9ed8\u8ba4\u662f <code>io.containerd.runc.v2<\/code><\/li>\n<li>platform: \u6307\u7684\u662f\u64cd\u4f5c\u7cfb\u7edf\uff0cCPU \u67b6\u6784 \u7b49<\/li>\n<li>\u8fd8\u8981\u4e00\u4e9b GRPC \u8fde\u63a5\u6570\u636e\u7b49\u7b49<\/li>\n<\/ul>\n<p><code>client.WithLease(ctx)<\/code>\u4f1a\u5728 metadata \u4e2d\u8bb0\u5f55\u8be5\u64cd\u4f5c\uff0c\u5f53\u8be5\u64cd\u4f5c\u7ed3\u675f\u540e\uff0c\u4e5f\u4f1a\u4ece metadata \u4e2d\u5220\u9664\u3002<\/p>\n<p><code>content.NewFetchConfig(ctx, context)<\/code> \u7528\u6765\u521d\u59cb\u5316\u8fd9\u6b21\u62c9\u53d6\u955c\u50cf\u7684\u914d\u7f6e<\/p>\n<ul>\n<li>\u5b9e\u4f8b\u5316 resolver\uff0cresolver \u8d1f\u8d23\u4ece\u8fdc\u7aef pull \u5230\u672c\u5730\u3002containerd \u4f7f\u7528\u7684\u662f <code>remotes\/docker<\/code>\uff0c\u5e94\u8be5\u662f\u4ece docker \u90a3\u90e8\u5206\u62ff\u8fc7\u6765\u7684\u4ee3\u7801\u3002<\/li>\n<li>\u914d\u7f6e platforms<\/li>\n<li>\u914d\u7f6e <code>max-concurrent-downloads<\/code>\uff0c\u8fd9\u4e2a\u53c2\u6570\u4f1a\u9650\u5236\u540c\u65f6\u4e0b\u8f7d\u7684\u5e76\u53d1<\/li>\n<\/ul>\n<p><code>content.Fetch(ctx, client, ref, config)<\/code> \u8d1f\u8d23\u8c03\u7528\u4e0a\u4e00\u6b65\u5b9e\u4f8b\u5316\u51fa\u7684 client\uff0c\u6839\u636e ref(\u955c\u50cf\u5730\u5740) \u548c fetch config \u6765\u62c9\u53d6\u8fdc\u7aef\u955c\u50cf\uff0c\u7136\u540e\u4f7f\u7528 content \u7684\u63a5\u53e3\u5b58\u50a8\u5230\u672c\u5730\u3002<\/p>\n<p>\u4e0b\u9762\u4e3b\u8981\u5c31 Fetch \u5c55\u5f00\u5206\u6790\u3002\u8fd9\u91cc\u53ef\u4ee5\u5148\u4e86\u89e3\u4e00\u4e0b\uff0cFetch \u4f1a\u505a\u4ee5\u4e0b\u7684\u5de5\u4f5c\uff1a<\/p>\n<ul>\n<li>\u8bbe\u7f6e opts(RemoteOpt \u6570\u7ec4)\uff0c<code>type RemoteOpt func(*Client, *RemoteContext) error<\/code>\n<ul>\n<li>\u5e94\u7528\u5230 image \u4e0a\u7684 labels<\/li>\n<li>\u8bbe\u7f6e\u4e0a\u9762\u5b9e\u4f8b\u5316\u7684 resolver<\/li>\n<li>\u8bbe\u7f6e BaseHandlers\uff0cBaseHandlers \u5728 dispatch \u65f6\u8c03\u7528<\/li>\n<li>\u8bbe\u7f6e AllMetadata\uff0cAllMetadata \u4f1a\u4e0b\u8f7d\u6240\u6709\u7684 manifest \u548c\u5df2\u77e5\u7684\u914d\u7f6e\u6587\u4ef6<\/li>\n<li>\u8bbe\u7f6e Platforms<\/li>\n<\/ul>\n<\/li>\n<li>\u4f7f\u7528 resolver \u6765\u5c06\u6211\u4eec\u63d0\u4f9b\u7684\u955c\u50cf\u540d(ref) \u89e3\u6790\u6210 name \u548c descriptor\n<ul>\n<li>\u5982\u679c\u955c\u50cf\u540d\u7684\u683c\u5f0f\u4e3a: <code>docker.io\/library\/nginx:latest<\/code>\uff0c\u5219\u4f1a\u53d1\u9001 Head\u8bf7\u6c42\u5230 <code>https:\/\/registry-1.docker.io\/v2\/library\/nginx\/manifests\/latest<\/code>\uff0c\u4ece\u54cd\u5e94\u5934\u4e2d\u83b7\u53d6 <code>docker-content-digest<\/code> \u7684\u503c\u3002\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u8fd8\u4f1a\u518d\u53d1\u540c\u6837\u7684\u8bf7\u6c42\uff0c\u4f7f\u7528 GET \u65b9\u6cd5\u6765\u83b7\u53d6 manifest\uff0c\u4ece manifest \u4e2d\u83b7\u53d6 digest\u3002\u6700\u7ec8\u4f1a\u83b7\u53d6 digest\uff0cmediaType \u548c size \u4e09\u4e2a\u503c\u3002<\/li>\n<li>\u5982\u679c\u955c\u50cf\u540d\u7684\u683c\u5f0f\u4e3a\uff1a<code>docker.io\/library\/nginx@sha256:df13abe416e37eb3db...<\/code>\uff0c\u5219@ \u540e\u9762\u63d0\u4f9b\u7684\u662f digest \u503c\u3002\u6b64\u65f6\u5c31\u4f7f\u7528 <code>https:\/\/registry-1.docker.io\/v2\/library\/nginx\/manifests\/sha256:df13abe416e37eb3db...<\/code>\u6765\u5b9e\u73b0<\/li>\n<\/ul>\n<\/li>\n<li>\u73b0\u5728\u5f97\u5230\u4e86 image digest\uff0c\u6b64\u65f6\u8c03\u7528 <code>images.Dispatch(ctx, handler, limiter, desc)<\/code>\u65b9\u6cd5\u3002\u8fd9\u4e2a Dispatch \u65b9\u6cd5\u662f\u4e2a\u9012\u5f52\u8c03\u7528\n<ol>\n<li>\u5148\u901a\u8fc7 image digest\uff0c\u8c03\u7528 dockerFetcher \u548c content\uff0c\u5c06 image manifests \u5217\u8868\u4fe1\u606f store \u5230 content blobs \u4e2d\u3002\u5e76\u627e\u5230\u7b26\u5408\u5f53\u524d platform \u7684 descriptor\u3002<\/p>\n<\/li>\n<li>\n<p>\u518d\u901a\u8fc7\u4e0a\u4e00\u6b65\u83b7\u53d6\u7684 digest\uff0c\u8c03\u7528 dockerFetcher \u548c content\uff0c\u83b7\u53d6\u8be5 platform \u7684 manifest\uff0c\u8fd9\u6b21\u7684\u5185\u5bb9\u4e2d\u4f1a\u5305\u542b config \u548c layers<\/p>\n<\/li>\n<li>\u6839\u636e config \u7684 digest\uff0c\u8c03\u7528 dockerFetcher \u548c content\uff0c\u83b7\u53d6 config \u7684\u5185\u5bb9\u5e76\u5b58\u50a8<\/li>\n<li>\u6839\u636e layers \u6570\u7ec4\u4e2d\u6bcf\u4e2a layer \u7684 digest\uff0c\u8c03\u7528 dockerFetcher \u548c content\uff0c\u83b7\u53d6 layer \u5185\u5bb9\u5e76\u5b58\u50a8\u3002<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u8c03\u7528 createNewImage \u5728 metadata \u4e2d\u521b\u5efa image \u8bb0\u5f55\u3002\u8bb0\u5f55\u4e2d\u5b58\u50a8\u4e86 image \u7684 digest \u548c lables\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u7b2c\u4e00\u6b65\u83b7\u53d6\u7684 manifests \u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-json line-numbers\">{\n    \"manifests\": [\n        {\n            \"digest\": \"sha256:eba373a0620f68ffdc3f217041ad25ef084475b8feb35b992574cd83698e9e3c\",\n            \"mediaType\": \"application\/vnd.docker.distribution.manifest.v2+json\",\n            \"platform\": {\n                \"architecture\": \"amd64\",\n                \"os\": \"linux\"\n            },\n            \"size\": 1570\n        }\n    ],\n    \"mediaType\": \"application\/vnd.docker.distribution.manifest.list.v2+json\",\n    \"schemaVersion\": 2\n}\n<\/code><\/pre>\n<p>\u7b2c\u4e8c\u6b65\u83b7\u53d6\u7684 manifest \u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-json line-numbers\">{\n    \"schemaVersion\": 2,\n    \"mediaType\": \"application\/vnd.docker.distribution.manifest.v2+json\",\n    \"config\": {\n        \"mediaType\": \"application\/vnd.docker.container.image.v1+json\",\n        \"size\": 7736,\n        \"digest\": \"sha256:f0b8a9a541369db503ff3b9d4fa6de561b300f7363920c2bff4577c6c24c5cf6\"\n    },\n    \"layers\": [\n        {\n            \"mediaType\": \"application\/vnd.docker.image.rootfs.diff.tar.gzip\",\n            \"size\": 27145915,\n            \"digest\": \"sha256:69692152171afee1fd341febc390747cfca2ff302f2881d8b394e786af605696\"\n        },\n        {\n            \"mediaType\": \"application\/vnd.docker.image.rootfs.diff.tar.gzip\",\n            \"size\": 26576310,\n            \"digest\": \"sha256:49f7d34d62c18a321b727d5c05120130f72d1e6b8cd0f1cec9a4cca3eee0815c\"\n        }\n    ]\n}\n<\/code><\/pre>\n<p>\u7b2c\u4e09\u6b65\u83b7\u53d6\u7684 config \u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-json line-numbers\">{\n    \"architecture\": \"amd64\",\n    \"config\": {\n        \"Hostname\": \"\",\n        \"Domainname\": \"\",\n        \"User\": \"\",\n        \"AttachStdin\": false,\n        \"AttachStdout\": false,\n        \"AttachStderr\": false,\n        \"ExposedPorts\": {\n            \"80\/tcp\": {}\n        },\n        \"Tty\": false,\n        \"OpenStdin\": false,\n        \"StdinOnce\": false,\n        \"Env\": [\n            \"PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin\",\n            \"NGINX_VERSION=1.19.10\",\n            \"NJS_VERSION=0.5.3\",\n            \"PKG_RELEASE=1~buster\"\n        ],\n        \"Cmd\": [\n            \"nginx\",\n            \"-g\",\n            \"daemon off;\"\n        ],\n        \"Image\": \"sha256:f46ebb94fdef867c7f07f0b9c458ebe0ca97191f9fd6f91fd918ef71702cd755\",\n        \"Volumes\": null,\n        \"WorkingDir\": \"\",\n        \"Entrypoint\": [\n            \"\/docker-entrypoint.sh\"\n        ],\n        \"OnBuild\": null,\n        \"Labels\": {\n            \"maintainer\": \"NGINX Docker Maintainers &lt;docker-maint@nginx.com&gt;\"\n        },\n        \"StopSignal\": \"SIGQUIT\"\n    },\n    \"container\": \"b728dbd6862a960807b78a68f3d1d6697d954ed2b53d05b1b4c440f4aa8574a3\",\n    \"container_config\": {\n      ...\n    },\n    \"created\": \"2021-05-12T08:40:31.711670345Z\",\n    \"docker_version\": \"19.03.12\",\n    \"history\": [\n        {\n            \"created\": \"2021-05-12T01:21:22.128649612Z\",\n            \"created_by\": \"\/bin\/sh -c #(nop) ADD file:7362e0e50f30ff45463ea38bb265cb8f6b7cd422eb2d09de7384efa0b59614be in \/ \"\n        }\n    ],\n    \"os\": \"linux\",\n    \"rootfs\": {\n        \"type\": \"layers\",\n        \"diff_ids\": [\n            \"sha256:02c055ef67f5904019f43a41ea5f099996d8e7633749b6e606c400526b2c4b33\",\n            \"sha256:431f409d4c5a8f79640000705665407ff22d73e043472cb1521faa6d83afc5e8\",\n            \"sha256:4b8db2d7f35aa38ac283036f2c7a453ebfdcc8d7e83a2bf3b55bf8847f8fafaf\",\n            \"sha256:c9732df61184e9e8d08f96c6966190c59f507d8f57ea057a4610f145c59e9bc4\",\n            \"sha256:eeb14ff930d4c2c04ece429112c16a536985f0cba6b13fdb52b00853107ab9c4\",\n            \"sha256:f0f30197ccf95e395bbf4efd65ec94b9219516ae5cafe989df4cf220eb1d6dfa\"\n        ]\n    }\n}\n<\/code><\/pre>\n<p>\u7b2c\u56db\u6b65\u83b7\u53d6\u7684\u5c31\u662f\u6bcf\u4e2a layer \u7684\u4e8c\u8fdb\u5236\u6570\u636e\u4e86\u3002<\/p>\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u5206\u6790\u53ef\u4ee5\u77e5\u9053\uff0ccontainerd \u672c\u8eab\u5e76\u6ca1\u6709\u5b9e\u73b0\u955c\u50cf\u7684 pull\uff0c\u4f46\u662f\u901a\u8fc7\u66b4\u9732 storage \u4e2d\u7684 content \u548c matadata \u4e2d image \u63a5\u53e3\uff0c\u53ef\u4ee5\u5728\u8c03\u7528\u65b9\u5b9e\u73b0 image pull\uff0c\u5e76\u5c06\u6570\u636e\u6309\u7167 containerd \u7684\u8981\u6c42\u8fdb\u884c\u5b58\u50a8\uff0c\u76f8\u5f53\u4e8e containerd \u53ea\u63d0\u4f9b\u4e86 image \u5b58\u50a8\u7684\u5b9e\u73b0\u3002\u603b\u7ed3\u4e00\u4e0b\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/containerd.jpg\" alt=\"containerd\" \/><\/p>\n<h2>\u4e09\u3001snapshot \u5982\u4f55\u5de5\u4f5c\u7684<\/h2>\n<p>\u5b58\u50a8\u5728 content \u4e2d\u7684\u955c\u50cf\u5c42\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u901a\u5e38\u5176\u5b58\u50a8\u683c\u5f0f\u4e5f\u662f\u6ca1\u6cd5\u76f4\u63a5\u4f7f\u7528\u7684\uff0c\u5e38\u89c1\u7684\u683c\u5f0f\u4e3a tar-gzip\u3002\u4e3a\u4e86\u4f7f\u7528 content \u4e2d\u5b58\u50a8\u7684\u955c\u50cf\u5c42\uff0ccontainerd \u62bd\u8c61\u51fa\u4e86 snapshot\uff0c\u6bcf\u4e2a\u955c\u50cf\u5c42\u90fd\u4f1a\u751f\u6210\u5bf9\u5e94\u7684 snapshot\u3002<\/p>\n<p>snapshot \u6709\u4e09\u79cd\u7c7b\u578b\uff1acommitted\uff0cactive \u548c view\u3002\u5728\u542f\u52a8\u5bb9\u5668\u524d\uff0c\u955c\u50cf\u7684\u6bcf\u4e00\u5c42\u90fd\u4f1a\u88ab\u521b\u5efa\u6210 committed snapshot\uff0ccommitted \u8868\u793a\u8be5\u955c\u50cf\u5c42\u4e0d\u53ef\u53d8\u3002\u6700\u540e\u518d\u521b\u5efa\u51fa\u4e00\u5c42 active snapshot\uff0c\u8fd9\u4e00\u5c42\u662f\u53ef\u8bfb\u5199\u7684\u3002<\/p>\n<p>\u4e0b\u65b9\u5c55\u793a\u4e86\u4e00\u4e2a nginx \u955c\u50cf\u88ab run \u8d77\u6765\u540e\u751f\u6210\u7684 snapshot\u3002snapshot \u4e4b\u95f4\u662f\u6709 parent \u5173\u7cfb\u7684\u3002\u7b2c1\u5c42\u7684 parent  \u4e3a\u7a7a\u3002<\/p>\n<pre><code class=\"language-text line-numbers\"># ctr snapshot ls\nKEY                PARENT                       KIND\nnginx              sha256:60f61ee7da08          Active\nsha256:02c055ef                                 Committed\nsha256:5c3e94c8    sha256:adda6567aeaa          Committed\nsha256:60f61ee7    sha256:affa58c5a9d1          Committed\nsha256:6b1533d4    sha256:5c3e94c8305f          Committed\nsha256:adda6567    sha256:02c055ef67f5          Committed\nsha256:affa58c5    sha256:6b1533d42f38          Committed\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/snapshots.jpg\" alt=\"snapshots_of_nginx\" \/><\/p>\n<p>\u4e0b\u9762\u9488\u5bf9\u6267\u884c <code>ctr run docker.io\/library\/nginx:latest nginx<\/code> \u6765\u8bf4\u660e\uff0c\u4e0d\u8fc7 ctr run \u8fd8\u4f1a\u6d89\u53ca\u5230\u5f88\u591a runtime \u76f8\u5173\u7684\u5185\u5bb9\uff0c\u8fd9\u91cc\u4e3a\u4e86\u7b80\u5355\u4e0d\u505a\u53d9\u8ff0\u3002<\/p>\n<p>\u5f53\u6267\u884c ctr run \u4e4b\u540e\uff0c\u4f1a\u6839\u636e\u63d0\u4f9b\u7684 image \u540d\uff0c\u521b\u5efa\u51fa\u591a\u4e2a snapshot\u3002\u4e3b\u8981\u7684\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ \u4ece metadata \u4e2d\u67e5\u8be2 image \u7684\u4fe1\u606f\ni, err := client.ImageService().Get(ctx, ref)\n\/\/ \u6839\u636e image \u4fe1\u606f\u521d\u59cb\u5316 image \u5b9e\u4f8b\nimage = containerd.NewImage(client, i)\n\/\/ \u8fd9\u4e2a image \u662f\u5426 unpacked\nunpacked, err := image.IsUnpacked(ctx, snapshotter)\nif !unpacked {\n  \/\/ unpack \u955c\u50cf\n  if err := image.Unpack(ctx, snapshotter); err != nil {\n    return nil, err\n  }\n}\n<\/code><\/pre>\n<p><code>IsUnpacked<\/code> \u7684\u5b9e\u73b0\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">func (i *image) IsUnpacked(ctx context.Context, snapshotterName string) (bool, error) {\n    \/\/ \u83b7\u53d6 snapshotter \u5b9e\u4f8b\uff0c\u9ed8\u8ba4\u662f overlayfs\n  sn, err := i.client.getSnapshotter(ctx, snapshotterName)\n    if err != nil {\n        return false, err\n    }\n  \/\/ \u83b7\u53d6 content store \u5b9e\u4f8b\n    cs := i.client.ContentStore()\n  \/\/ \u8fd9\u91cc\u662f\u901a\u8fc7\u8bfb\u53d6 image manifest\uff0c\u83b7\u53d6\u5230 image layers \u7684 digest\uff0c\u4e5f\u5c31\u662f diffs\n    diffs, err := i.i.RootFS(ctx, cs, i.platform)\n    if err != nil {\n        return false, err\n    }\n\n  \/\/ \u901a\u8fc7 diffs \u8ba1\u7b97\u51fa\u6700\u4e0a\u5c42\u7684 chainID\n    chainID := identity.ChainID(diffs)\n  \/\/ \u56e0\u4e3a snapshot \u7684\u540d\u5b57\u5c31\u662f chainID\uff0c\u8fd9\u91cc\u901a\u8fc7\u5224\u65ad\u6700\u4e0a\u5c42\u7684 snapshot \u7684 chainID \u662f\u5426\u5b58\u5728\n  \/\/ \u5c31\u53ef\u4ee5\u77e5\u9053\u8fd9\u4e2a image \u662f\u5426 unpack \u4e86\n    _, err = sn.Stat(ctx, chainID.String())\n    if err == nil {\n        return true, nil\n    } else if !errdefs.IsNotFound(err) {\n        return false, err\n    }\n\n    return false, nil\n}\n<\/code><\/pre>\n<p>chainID \u7684\u8ba1\u7b97\u65b9\u5f0f\u53c2\u8003\u4e4b\u524d\u7684\u6587\u7ae0\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.myway5.com\/index.php\/2021\/05\/18\/%e5%ae%b9%e5%99%a8%e9%95%9c%e5%83%8f%e6%98%af%e5%a6%82%e4%bd%95%e5%b7%a5%e4%bd%9c%e7%9a%84\/\">chainID \u8ba1\u7b97\u65b9\u5f0f<\/a><\/p>\n<p><code>Unpack<\/code> \u7684\u5b9e\u73b0\u5982\u4e0b\uff0c\u4e3a\u4e86\u5c55\u793a\u65b9\u4fbf\uff0c\u4ee3\u7801\u6709\u5220\u51cf\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">func (i *image) Unpack(ctx context.Context, snapshotterName string, opts ...UnpackOpt) error {\n    \/\/ \u83b7\u53d6\u955c\u50cf\u7684 manifest\n  manifest, err := i.getManifest(ctx, i.platform)\n  \/\/ \u901a\u8fc7 manifest\uff0c\u83b7\u53d6 layers\n  layers, err := i.getLayers(ctx, i.platform, manifest)\n\n  \/\/ \u9ed8\u8ba4\u662f overlayfs\n  snapshotterName, err = i.client.resolveSnapshotterName(ctx, snapshotterName)\n  \/\/ \u83b7\u53d6 snapshotter \u5b9e\u4f8b\n  sn, err := i.client.getSnapshotter(ctx, snapshotterName)\n\n  for _, layer := range layers {\n    \/\/ apply layer\uff0c\u8fd9\u91cc\u662f snapshot \u7684\u5de5\u4f5c\u91cd\u70b9\n    unpacked, err = rootfs.ApplyLayerWithOpts(ctx, layer, chain, sn, a, config.SnapshotOpts, config.ApplyOpts)\n        \/\/ chainID \u7684\u8ba1\u7b97\u9700\u8981\u4e4b\u524d\u7684 diffID\uff0c\u6240\u4ee5\u8fd9\u91cc\u62a5\u9519\u4e86\u6bcf\u4e00\u5c42\u7684 digest\u3002\n    chain = append(chain, layer.Diff.Digest)\n  }\n  \/\/ \u6700\u4e0a\u5c42\u7684 snapshot \u5c31\u662f rootfs\uff0c\u53ef\u4ee5\u63d0\u4f9b\u7ed9 runc \u4f7f\u7528\u3002\n  rootfs := identity.ChainID(chain).String()\n  return err\n}\n<\/code><\/pre>\n<p><code>Unpack<\/code> \u7684\u8fc7\u7a0b\uff0c\u5c31\u662f\u5bf9\u6bcf\u4e00\u5c42 apply layer \u7684\u8fc7\u7a0b\u3002apply \u4e00\u4e2a layer \u7684\u5b9e\u73b0\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">func applyLayers(ctx context.Context, layers []Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Applier, opts []snapshots.Opt, applyOpts []diff.ApplyOpt) error {\n    for {\n        key = fmt.Sprintf(snapshots.UnpackKeyFormat, uniquePart(), chainID)\n        \/\/ prepare \u4f1a\u521b\u5efa\u51fa\u4e00\u4e2a active snapshot\n        mounts, err = sn.Prepare(ctx, key, parent.String(), opts...)\n        break\n    }\n    \/\/ \u4f7f\u7528 diff\uff0c\u5c06\u8fd9\u4e00\u5c42\u5e94\u7528\u5230 prepare \u7684 layer \u4e0a\n    diff, err = a.Apply(ctx, layer.Blob, mounts, applyOpts...)\n    \/\/ Commit \u4f1a\u5728 metadata \u4e2d\u5c06\u8fd9\u4e2a snapshot \u6807\u8bb0\u4e3a committed\u3002\n  \/\/ \u5bf9\u4e8e device mapper \u8bbe\u5907\uff0c\u8fd8\u4f1a\u989d\u5916\u7684\u4f7f\u8fd9\u4e2a snapshot \u6302\u8f7d\u4e0d\u53ef\u89c1\u3002\n    if err = sn.Commit(ctx, chainID.String(), key, opts...); err != nil {\n        err = errors.Wrapf(err, \"failed to commit snapshot %s\", key)\n        return err\n    }\n\n    return nil\n}\n<\/code><\/pre>\n<p>\u4ee5\u4e0a\u5c31\u662f snapshotter \u901a\u8fc7 image layers \u521b\u5efa\u51fa snapshots \u7684\u8fc7\u7a0b\u3002\u4e0d\u8fc7\u8fd9\u4e0a\u9762\u521b\u5efa\u7684\u90fd\u662f committed snapshot\u3002\u6240\u4ee5\u5728\u8fd9\u4e4b\u540e\u8fd8\u4f1a\u5355\u72ec\u5728\u8fd9\u4e4b\u4e0a\u521b\u5efa\u51fa\u4e00\u4e2a active snapshot \u4f9b\u5bb9\u5668\u8bfb\u5199\u3002<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ WithNewSnapshot allocates a new snapshot to be used by the container as the\n\/\/ root filesystem in read-write mode\nfunc WithNewSnapshot(id string, i Image, opts ...snapshots.Opt) NewContainerOpts {\n    return func(ctx context.Context, client *Client, c *containers.Container) error {\n        diffIDs, err := i.RootFS(ctx)\n        if err != nil {\n            return err\n        }\n\n        parent := identity.ChainID(diffIDs).String()\n        c.Snapshotter, err = client.resolveSnapshotterName(ctx, c.Snapshotter)\n        if err != nil {\n            return err\n        }\n        s, err := client.getSnapshotter(ctx, c.Snapshotter)\n        if err != nil {\n            return err\n        }\n        if _, err := s.Prepare(ctx, id, parent, opts...); err != nil {\n            return err\n        }\n        c.SnapshotKey = id\n        c.Image = i.Name()\n        return nil\n    }\n}\n<\/code><\/pre>\n<h2>\u56db\u3001diff \u5982\u4f55\u5de5\u4f5c\u7684<\/h2>\n<p>\u5728\u4e0a\u9762\u5bf9 content \u548c snapshot \u8fdb\u884c\u4e00\u4e9b\u5206\u6790\u540e\uff0c\u5df2\u7ecf\u6e05\u695a\u4e86\u955c\u50cf\u7684\u5c42\u662f\u5982\u4f55\u5b58\u50a8\u7684\uff0c\u4ee5\u53ca\u4f7f\u7528\u955c\u50cf\u662f\u4ec0\u4e48\u6837\u7684\u4e00\u4e2a\u8fc7\u7a0b\u3002\u4f46\u8fd9\u5176\u4e2d\u8fd8\u6709\u4e24\u4e2a\u7ec6\u8282\u6ca1\u6709\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li>\u4e00\u4e2a image layer \u5982\u4f55\u88ab mount \u6210\u4e00\u4e2a snapshot\u3002<\/li>\n<li>\u4e00\u4e2a snapshot \u5982\u4f55\u88ab\u538b\u7f29\u6210\u4e00\u4e2a image layer<\/li>\n<\/ul>\n<p>\u8fd9\u91cc\u5c31\u662f diff \u5b50\u6a21\u5757\u7684\u4f5c\u7528\u4e86\u3002diff \u5bf9\u5916\u63d0\u4f9b\u4e86\u4e24\u4e2a\u63a5\u53e3\uff1a<\/p>\n<ul>\n<li>Diff: \u8d1f\u8d23\u5c06 snapshot \u6253\u5305\u6210 image layer<\/p>\n<\/li>\n<li>\n<p>Apply: \u8d1f\u8d23\u5c06 image layer \u751f\u6210 snapshot \u6302\u8f7d<\/p>\n<\/li>\n<\/ul>\n<p>\u5728\u8bf4\u660e Diff \u4e4b\u524d\uff0c\u9700\u8981\u5148\u63d0\u4e00\u4e0b OCI \u4e2d image spec \u4e2d\u7684\u4e00\u4e2a\u4f8b\u5b50\u3002\u5047\u8bbe\u73b0\u5728\u6709\u4e24\u4e2a\u6587\u4ef6\u5939 <code>rootfs-c9d-v1\/<\/code> and <code>rootfs-c9d-v1.s1\/<\/code>\u3002\u5bf9\u5176\u8fdb\u884c\u5b57\u5178\u5e8f\u7684\u9012\u5f52\u6bd4\u8f83\uff0c\u53d1\u73b0\u7684\u53d8\u52a8\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"line-numbers\">Added:      \/etc\/my-app.d\/\nAdded:      \/etc\/my-app.d\/default.cfg\nModified:   \/bin\/my-app-tools\nDeleted:    \/etc\/my-app-config\n<\/code><\/pre>\n<p>\u90a3\u4e48\u4f7f\u7528 OCI \u7684\u89c4\u8303\u6253\u5305\u51fa\u6765\u5c31\u662f\uff1a<\/p>\n<pre><code class=\"line-numbers\">.\/etc\/my-app.d\/\n.\/etc\/my-app.d\/default.cfg\n.\/bin\/my-app-tools\n.\/etc\/.wh.my-app-config\n<\/code><\/pre>\n<p>\u5220\u9664\u7684\u6587\u4ef6\u4f7f\u7528 .wh. \u524d\u7f00\u6765\u8868\u793a\u3002<\/p>\n<p>\u90a3\u4e48 Diff \u7684\u65f6\u5019\uff0c\u4e3b\u8981\u5c31\u662f\u5bf9 snapshot \u548c\u5176 parent \u505a\u6bd4\u8f83\uff0c\u6bd4\u8f83\u65f6\u4f7f\u7528\u5b57\u5178\u5e8f\u6765 walk dir\u3002\u7136\u540e\u751f\u6210\u7684 tar \u5305\u4e2d\uff0c\u5bf9 added \u548c modified \u6587\u4ef6\uff0c\u53ea\u9700\u6253\u5305\u6700\u65b0\u7684\u5373\u53ef\u3002\u5bf9 deleted \u6587\u4ef6\uff0c\u751f\u6210 .wh.* \u6765\u4ee3\u66ff\u3002<\/p>\n<p>\u5728 Apply \u7684\u65f6\u5019\uff0c\u5982\u679c\u662f .wh. \u524d\u7f00\u7684\u6587\u4ef6\uff0c\u5c31\u6839\u636e\u6240\u4f7f\u7528\u6587\u4ef6\u7cfb\u7edf\u7684\u7279\u70b9\u6765\u751f\u6210\uff0c\u6bd4\u5982 overlayfs \u4e2d\u4f7f\u7528 whiteout \u6587\u4ef6\u6765\u8868\u793a\u5220\u9664\u3002\u975e .wh. \u6587\u4ef6\u539f\u6837\u8f93\u51fa\u5373\u53ef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u6982\u8ff0 containerd \u7684 storage \u6a21\u5757\u8d1f\u8d23\u955c\u50cf\u7684\u5b58\u50a8\uff0c\u5bb9\u5668 rootfs \u7684\u521b\u5efa\u7b49\u5de5\u4f5c\u3002\u5176\u4e3b &hellip; <a href=\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">containerd storage\u6a21\u5757\u5206\u6790<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[],"class_list":["post-909","post","type-post","status-publish","format-standard","hentry","category-container"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>containerd storage\u6a21\u5757\u5206\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b<\/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.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"containerd storage\u6a21\u5757\u5206\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u6982\u8ff0 containerd \u7684 storage \u6a21\u5757\u8d1f\u8d23\u955c\u50cf\u7684\u5b58\u50a8\uff0c\u5bb9\u5668 rootfs \u7684\u521b\u5efa\u7b49\u5de5\u4f5c\u3002\u5176\u4e3b &hellip; \u7ee7\u7eed\u9605\u8bfbcontainerd storage\u6a21\u5757\u5206\u6790\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\" \/>\n<meta property=\"og:site_name\" content=\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-24T06:31:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-05T02:08:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png\" \/>\n<meta name=\"author\" content=\"jiangpengfei\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"jiangpengfei\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\"},\"author\":{\"name\":\"jiangpengfei\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"headline\":\"containerd storage\u6a21\u5757\u5206\u6790\",\"datePublished\":\"2021-05-24T06:31:52+00:00\",\"dateModified\":\"2023-07-05T02:08:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\"},\"wordCount\":278,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png\",\"articleSection\":[\"\u5bb9\u5668\u6280\u672f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\",\"url\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\",\"name\":\"containerd storage\u6a21\u5757\u5206\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png\",\"datePublished\":\"2021-05-24T06:31:52+00:00\",\"dateModified\":\"2023-07-05T02:08:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage\",\"url\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png\",\"contentUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png\",\"width\":2004,\"height\":1149},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.myway5.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"containerd storage\u6a21\u5757\u5206\u6790\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.myway5.com\/#website\",\"url\":\"https:\/\/www.myway5.com\/\",\"name\":\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"description\":\"\u60f3\u5565\u5462\",\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.myway5.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\",\"name\":\"jiangpengfei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g\",\"caption\":\"jiangpengfei\"},\"logo\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.myway5.com\/index.php\/author\/joyme\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"containerd storage\u6a21\u5757\u5206\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","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.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/","og_locale":"zh_CN","og_type":"article","og_title":"containerd storage\u6a21\u5757\u5206\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","og_description":"\u4e00\u3001\u6982\u8ff0 containerd \u7684 storage \u6a21\u5757\u8d1f\u8d23\u955c\u50cf\u7684\u5b58\u50a8\uff0c\u5bb9\u5668 rootfs \u7684\u521b\u5efa\u7b49\u5de5\u4f5c\u3002\u5176\u4e3b &hellip; \u7ee7\u7eed\u9605\u8bfbcontainerd storage\u6a21\u5757\u5206\u6790","og_url":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/","og_site_name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","article_published_time":"2021-05-24T06:31:52+00:00","article_modified_time":"2023-07-05T02:08:59+00:00","og_image":[{"url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png","type":"","width":"","height":""}],"author":"jiangpengfei","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"jiangpengfei","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#article","isPartOf":{"@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/"},"author":{"name":"jiangpengfei","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"headline":"containerd storage\u6a21\u5757\u5206\u6790","datePublished":"2021-05-24T06:31:52+00:00","dateModified":"2023-07-05T02:08:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/"},"wordCount":278,"commentCount":0,"publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png","articleSection":["\u5bb9\u5668\u6280\u672f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/","url":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/","name":"containerd storage\u6a21\u5757\u5206\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","isPartOf":{"@id":"https:\/\/www.myway5.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png","datePublished":"2021-05-24T06:31:52+00:00","dateModified":"2023-07-05T02:08:59+00:00","breadcrumb":{"@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#primaryimage","url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png","contentUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2021\/05\/architecture.png","width":2004,"height":1149},{"@type":"BreadcrumbList","@id":"https:\/\/www.myway5.com\/index.php\/2021\/05\/24\/containerd-storage\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.myway5.com\/"},{"@type":"ListItem","position":2,"name":"containerd storage\u6a21\u5757\u5206\u6790"}]},{"@type":"WebSite","@id":"https:\/\/www.myway5.com\/#website","url":"https:\/\/www.myway5.com\/","name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","description":"\u60f3\u5565\u5462","publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.myway5.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685","name":"jiangpengfei","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g","caption":"jiangpengfei"},"logo":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/image\/"},"url":"https:\/\/www.myway5.com\/index.php\/author\/joyme\/"}]}},"views":7305,"_links":{"self":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/comments?post=909"}],"version-history":[{"count":1,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/909\/revisions"}],"predecessor-version":[{"id":910,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/909\/revisions\/910"}],"wp:attachment":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/media?parent=909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/categories?post=909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/tags?post=909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}