{"id":491,"date":"2019-11-04T13:33:27","date_gmt":"2019-11-04T05:33:27","guid":{"rendered":"https:\/\/www.myway5.com\/?p=491"},"modified":"2023-07-05T21:38:17","modified_gmt":"2023-07-05T13:38:17","slug":"container","status":"publish","type":"post","link":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/","title":{"rendered":"\u5bb9\u5668\u6807\u51c6\u5316"},"content":{"rendered":"<h2>\u6982\u8ff0<\/h2>\n<p>\u6211\u8ba4\u4e3a\u5bb9\u5668\u6807\u51c6\u5316\u53ef\u4ee5\u5206\u4e3a\u4e24\u4e2a\u89d2\u5ea6\u53bb\u8bb2\uff1a<\/p>\n<p>\u4e00\u4e2a\u662f\u5bb9\u5668\u7684\u4f7f\u7528\u548c\u955c\u50cf\u7684\u683c\u5f0f\u9700\u8981\u89c4\u8303\uff0c\u8fd9\u53eb\u505aOCI(open container initiative)\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e0d\u540c\u6280\u672f\u5b9e\u73b0\u7684\u5bb9\u5668\uff0c\u90fd\u53ef\u4ee5\u4f7f\u7528\u540c\u4e00\u79cd\u65b9\u5f0f\u8fd0\u884c\uff0c\u540c\u4e00\u4e2a\u955c\u50cf\u4e5f\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u5bb9\u5668\u6280\u672f\u4e0a\u8fd0\u884c\u3002<\/p>\n<p>\u53e6\u5916\u4e00\u4e2a\u5c31\u662f\u56e0\u4e3aKubernetes\u7684\u6d41\u884c\uff0cKubernetes\u63a8\u51fa\u4e86\u4e00\u4e2aCRI(container runtime interface)\u7684\u63a5\u53e3\u89c4\u8303\uff0c\u51e1\u662f\u76f4\u63a5\u6216\u95f4\u63a5\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u63a5\u53e3\u89c4\u8303\u7684\u5bb9\u5668\u90fd\u53ef\u4ee5\u4f5c\u4e3aKubernetes\u7684\u9ed8\u8ba4\u5bb9\u5668\u8fd0\u884c\u65f6\u3002<\/p>\n<p>OCI\u548cCRI\u7684\u5236\u5b9a\u4e5f\u610f\u5473\u7740\u5bb9\u5668\u6280\u672f\u8fce\u6765\u4e86\u9ad8\u901f\u53d1\u5c55\u3002<\/p>\n<h2>CRI: container runtime interface<\/h2>\n<p>CRI\u662fkubernetes\u63a8\u51fa\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\u63a5\u53e3\uff0c\u6709\u4e86CRI\uff0c\u4e0d\u8bba\u5404\u79cd\u5bb9\u5668\u5316\u6280\u672f\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff0c\u90fd\u53ef\u4ee5\u7528\u4e00\u4e2a\u5171\u540c\u7684\u63a5\u53e3\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u3002CRI\u4e2d\u5b9a\u4e49\u4e86\u5bb9\u5668\u548c\u955c\u50cf\u7684\u63a5\u53e3\u7684\u63a5\u53e3\uff0c\u57fa\u4e8e<code>gRPC<\/code>\u8c03\u7528\u3002\u5177\u4f53\u7684\u53ef\u4ee5\u67e5\u770b<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/kubernetes\/cri-api\/blob\/master\/pkg\/apis\/runtime\/v1alpha2\/api.proto\">api.proto<\/a>\u3002\u4e0b\u9762\u7b80\u5355\u7684\u5217\u4e00\u4e0b:<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ Runtime service defines the public APIs for remote container runtimes\nservice RuntimeService {\n    \/\/ Version returns the runtime name, runtime version, and runtime API version.\n    rpc Version(VersionRequest) returns (VersionResponse) {}\n\n    \/\/ RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure\n    \/\/ the sandbox is in the ready state on success.\n    rpc RunPodSandbox(RunPodSandboxRequest) returns (RunPodSandboxResponse) {}\n    \/\/ StopPodSandbox stops any running process that is part of the sandbox and\n    \/\/ reclaims network resources (e.g., IP addresses) allocated to the sandbox.\n    \/\/ If there are any running containers in the sandbox, they must be forcibly\n    \/\/ terminated.\n    \/\/ This call is idempotent, and must not return an error if all relevant\n    \/\/ resources have already been reclaimed. kubelet will call StopPodSandbox\n    \/\/ at least once before calling RemovePodSandbox. It will also attempt to\n    \/\/ reclaim resources eagerly, as soon as a sandbox is not needed. Hence,\n    \/\/ multiple StopPodSandbox calls are expected.\n    rpc StopPodSandbox(StopPodSandboxRequest) returns (StopPodSandboxResponse) {}\n    \/\/ RemovePodSandbox removes the sandbox. If there are any running containers\n    \/\/ in the sandbox, they must be forcibly terminated and removed.\n    \/\/ This call is idempotent, and must not return an error if the sandbox has\n    \/\/ already been removed.\n    rpc RemovePodSandbox(RemovePodSandboxRequest) returns (RemovePodSandboxResponse) {}\n    \/\/ PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not\n    \/\/ present, returns an error.\n    rpc PodSandboxStatus(PodSandboxStatusRequest) returns (PodSandboxStatusResponse) {}\n    \/\/ ListPodSandbox returns a list of PodSandboxes.\n    rpc ListPodSandbox(ListPodSandboxRequest) returns (ListPodSandboxResponse) {}\n\n    \/\/ CreateContainer creates a new container in specified PodSandbox\n    rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse) {}\n    \/\/ StartContainer starts the container.\n    rpc StartContainer(StartContainerRequest) returns (StartContainerResponse) {}\n    \/\/ StopContainer stops a running container with a grace period (i.e., timeout).\n    \/\/ This call is idempotent, and must not return an error if the container has\n    \/\/ already been stopped.\n    \/\/ TODO: what must the runtime do after the grace period is reached?\n    rpc StopContainer(StopContainerRequest) returns (StopContainerResponse) {}\n    \/\/ RemoveContainer removes the container. If the container is running, the\n    \/\/ container must be forcibly removed.\n    \/\/ This call is idempotent, and must not return an error if the container has\n    \/\/ already been removed.\n    rpc RemoveContainer(RemoveContainerRequest) returns (RemoveContainerResponse) {}\n    \/\/ ListContainers lists all containers by filters.\n    rpc ListContainers(ListContainersRequest) returns (ListContainersResponse) {}\n    \/\/ ContainerStatus returns status of the container. If the container is not\n    \/\/ present, returns an error.\n    rpc ContainerStatus(ContainerStatusRequest) returns (ContainerStatusResponse) {}\n    \/\/ UpdateContainerResources updates ContainerConfig of the container.\n    rpc UpdateContainerResources(UpdateContainerResourcesRequest) returns (UpdateContainerResourcesResponse) {}\n    \/\/ ReopenContainerLog asks runtime to reopen the stdout\/stderr log file\n    \/\/ for the container. This is often called after the log file has been\n    \/\/ rotated. If the container is not running, container runtime can choose\n    \/\/ to either create a new log file and return nil, or return an error.\n    \/\/ Once it returns error, new container log file MUST NOT be created.\n    rpc ReopenContainerLog(ReopenContainerLogRequest) returns (ReopenContainerLogResponse) {}\n\n    \/\/ ExecSync runs a command in a container synchronously.\n    rpc ExecSync(ExecSyncRequest) returns (ExecSyncResponse) {}\n    \/\/ Exec prepares a streaming endpoint to execute a command in the container.\n    rpc Exec(ExecRequest) returns (ExecResponse) {}\n    \/\/ Attach prepares a streaming endpoint to attach to a running container.\n    rpc Attach(AttachRequest) returns (AttachResponse) {}\n    \/\/ PortForward prepares a streaming endpoint to forward ports from a PodSandbox.\n    rpc PortForward(PortForwardRequest) returns (PortForwardResponse) {}\n\n    \/\/ ContainerStats returns stats of the container. If the container does not\n    \/\/ exist, the call returns an error.\n    rpc ContainerStats(ContainerStatsRequest) returns (ContainerStatsResponse) {}\n    \/\/ ListContainerStats returns stats of all running containers.\n    rpc ListContainerStats(ListContainerStatsRequest) returns (ListContainerStatsResponse) {}\n\n    \/\/ UpdateRuntimeConfig updates the runtime configuration based on the given request.\n    rpc UpdateRuntimeConfig(UpdateRuntimeConfigRequest) returns (UpdateRuntimeConfigResponse) {}\n\n    \/\/ Status returns the status of the runtime.\n    rpc Status(StatusRequest) returns (StatusResponse) {}\n}\n\n\/\/ ImageService defines the public APIs for managing images.\nservice ImageService {\n    \/\/ ListImages lists existing images.\n    rpc ListImages(ListImagesRequest) returns (ListImagesResponse) {}\n    \/\/ ImageStatus returns the status of the image. If the image is not\n    \/\/ present, returns a response with ImageStatusResponse.Image set to\n    \/\/ nil.\n    rpc ImageStatus(ImageStatusRequest) returns (ImageStatusResponse) {}\n    \/\/ PullImage pulls an image with authentication config.\n    rpc PullImage(PullImageRequest) returns (PullImageResponse) {}\n    \/\/ RemoveImage removes the image.\n    \/\/ This call is idempotent, and must not return an error if the image has\n    \/\/ already been removed.\n    rpc RemoveImage(RemoveImageRequest) returns (RemoveImageResponse) {}\n    \/\/ ImageFSInfo returns information of the filesystem that is used to store images.\n    rpc ImageFsInfo(ImageFsInfoRequest) returns (ImageFsInfoResponse) {}\n}\n<\/code><\/pre>\n<p>\u5171\u5305\u542b\u4e86\u4e24\u4e2a\u670d\u52a1:<br \/>\n &#8211; RuntimeService\uff1a\u5bb9\u5668\u548cSandbox\u8fd0\u884c\u65f6\u7ba1\u7406\u3002<br \/>\n &#8211; ImageService\uff1a\u63d0\u4f9b\u4e86\u4ece\u955c\u50cf\u4ed3\u5e93\u62c9\u53d6\u3001\u67e5\u770b\u3001\u548c\u79fb\u9664\u955c\u50cf\u7684RPC\u3002<\/p>\n<p>\u518d\u770b\u4e00\u4e0bCRI\u7684\u67b6\u6784\u56fe\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png\" alt=\"cri architecture\" \/><\/p>\n<p>\u5728kubernetes\u4e2d\uff0cCRI\u626e\u6f14\u4e86kubelet\u548ccontainer runtime\u7684\u901a\u4fe1\u6865\u6881\u3002\u4e5f\u56e0\u4e3aCRI\u7684\u5b58\u5728\uff0ccontainer runtime\u548ckubelet\u89e3\u8026\uff0c\u5c31\u6709\u4e86\u591a\u79cd\u9009\u62e9\uff0c\u6bd4\u5982: docker\u3001 CRI-O\u3001containerd\u3001frakti\u7b49\u7b49\u3002<\/p>\n<h2>OCI: open container initiative<\/h2>\n<p>\u8fd9\u4e2a\u662f\u7531docker\u548c\u5176\u4ed6\u7684\u516c\u53f8\u63a8\u52a8\u7684\u5bb9\u5668\u6807\u51c6\uff0c\u4e3a\u4e86\u56f4\u7ed5\u5bb9\u5668\u683c\u5f0f\u548c\u8fd0\u884c\u65f6\u5236\u5b9a\u4e00\u4e2a\u5f00\u653e\u7684\u5de5\u4e1a\u5316\u6807\u51c6\uff0c\u76ee\u524d\u4e3b\u8981\u6709\u4e24\u4e2a\u6807\u51c6\u6587\u6863\uff1a\u5bb9\u5668\u8fd0\u884c\u65f6\u6807\u51c6 \uff08runtime spec\uff09\u548c \u5bb9\u5668\u955c\u50cf\u6807\u51c6\uff08image spec\uff09\u3002\u8fd9\u4e24\u4e2a\u534f\u8bae\u901a\u8fc7 OCI runtime filesytem bundle \u7684\u6807\u51c6\u683c\u5f0f\u8fde\u63a5\u5728\u4e00\u8d77\uff0cOCI \u955c\u50cf\u53ef\u4ee5\u901a\u8fc7\u5de5\u5177\u8f6c\u6362\u6210 bundle\uff0c\u7136\u540e OCI \u5bb9\u5668\u5f15\u64ce\u80fd\u591f\u8bc6\u522b\u8fd9\u4e2a bundle \u6765\u8fd0\u884c\u5bb9\u5668<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/oci.png\" alt=\"oci\" \/><\/p>\n<p>\u4e0b\u9762\u5f15\u7528\u4e00\u4e0b\u5176\u4ed6\u535a\u5ba2\u7684\u6587\u5b57\uff08https:\/\/www.jianshu.com\/p\/62e71584d1cb\uff09\uff1a<\/p>\n<blockquote><p>\n  <strong>\u8bbe\u8ba1\u8003\u91cf<\/strong><\/p>\n<p>  \u64cd\u4f5c\u6807\u51c6\u5316\uff1a\u5bb9\u5668\u7684\u6807\u51c6\u5316\u64cd\u4f5c\u5305\u62ec\u4f7f\u7528\u6807\u51c6\u5bb9\u5668\u521b\u5efa\u3001\u542f\u52a8\u3001\u505c\u6b62\u5bb9\u5668\uff0c\u4f7f\u7528\u6807\u51c6\u6587\u4ef6\u7cfb\u7edf\u5de5\u5177\u590d\u5236\u548c\u521b\u5efa\u5bb9\u5668\u5feb\u7167\uff0c\u4f7f\u7528\u6807\u51c6\u5316\u7f51\u7edc\u5de5\u5177\u8fdb\u884c\u4e0b\u8f7d\u548c\u4e0a\u4f20\u3002<\/p>\n<p>  \u5185\u5bb9\u65e0\u5173\uff1a\u5185\u5bb9\u65e0\u5173\u6307\u4e0d\u7ba1\u9488\u5bf9\u7684\u5177\u4f53\u5bb9\u5668\u5185\u5bb9\u662f\u4ec0\u4e48\uff0c\u5bb9\u5668\u6807\u51c6\u64cd\u4f5c\u6267\u884c\u540e\u90fd\u80fd\u4ea7\u751f\u540c\u6837\u7684\u6548\u679c\u3002\u5982\u5bb9\u5668\u53ef\u4ee5\u7528\u540c\u6837\u7684\u65b9\u5f0f\u4e0a\u4f20\u3001\u542f\u52a8\uff0c\u4e0d\u7ba1\u662fPHP\u5e94\u7528\u8fd8\u662fMySQL\u6570\u636e\u5e93\u670d\u52a1\u3002<\/p>\n<p>  \u57fa\u7840\u8bbe\u65bd\u65e0\u5173\uff1a\u65e0\u8bba\u662f\u4e2a\u4eba\u7684\u7b14\u8bb0\u672c\u7535\u8111\u8fd8\u662fAWS S3\uff0c\u4ea6\u6216\u662fOpenStack\uff0c\u6216\u8005\u5176\u5b83\u57fa\u7840\u8bbe\u65bd\uff0c\u90fd\u5e94\u8be5\u5bf9\u652f\u6301\u5bb9\u5668\u7684\u5404\u9879\u64cd\u4f5c\u3002<br \/>\n  \u4e3a\u81ea\u52a8\u5316\u91cf\u8eab\u5b9a\u5236\uff1a\u5236\u5b9a\u5bb9\u5668\u7edf\u4e00\u6807\u51c6\uff0c\u662f\u7684\u64cd\u4f5c\u5185\u5bb9\u65e0\u5173\u5316\u3001\u5e73\u53f0\u65e0\u5173\u5316\u7684\u6839\u672c\u76ee\u7684\u4e4b\u4e00\uff0c\u5c31\u662f\u4e3a\u4e86\u53ef\u4ee5\u4f7f\u5bb9\u5668\u64cd\u4f5c\u5168\u5e73\u53f0\u81ea\u52a8\u5316\u3002<\/p>\n<p>  \u5de5\u4e1a\u7ea7\u4ea4\u4ed8\uff1a\u5236\u5b9a\u5bb9\u5668\u6807\u51c6\u4e00\u5927\u76ee\u6807\uff0c\u5c31\u662f\u4f7f\u8f6f\u4ef6\u5206\u53d1\u53ef\u4ee5\u8fbe\u5230\u5de5\u4e1a\u7ea7\u4ea4\u4ed8\u6210\u4e3a\u73b0\u5b9e<\/p>\n<p>  <strong>image spec\uff08\u5bb9\u5668\u6807\u51c6\u5305\uff09<\/strong><\/p>\n<p>  OCI \u5bb9\u5668\u955c\u50cf\u4e3b\u8981\u5305\u62ec\u51e0\u5757\u5185\u5bb9\uff1a<\/p>\n<p>  \u6587\u4ef6\u7cfb\u7edf\uff1a\u4ee5 layer \u4fdd\u5b58\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u6bcf\u4e2a layer \u4fdd\u5b58\u4e86\u548c\u4e0a\u5c42\u4e4b\u95f4\u53d8\u5316\u7684\u90e8\u5206\uff0clayer \u5e94\u8be5\u4fdd\u5b58\u54ea\u4e9b\u6587\u4ef6\uff0c\u600e\u4e48\u8868\u793a\u589e\u52a0\u3001\u4fee\u6539\u548c\u5220\u9664\u7684\u6587\u4ef6\u7b49<\/p>\n<p>  config \u6587\u4ef6\uff1a\u4fdd\u5b58\u4e86\u6587\u4ef6\u7cfb\u7edf\u7684\u5c42\u7ea7\u4fe1\u606f\uff08\u6bcf\u4e2a\u5c42\u7ea7\u7684 hash \u503c\uff0c\u4ee5\u53ca\u5386\u53f2\u4fe1\u606f\uff09\uff0c\u4ee5\u53ca\u5bb9\u5668\u8fd0\u884c\u65f6\u9700\u8981\u7684\u4e00\u4e9b\u4fe1\u606f\uff08\u6bd4\u5982\u73af\u5883\u53d8\u91cf\u3001\u5de5\u4f5c\u76ee\u5f55\u3001\u547d\u4ee4\u53c2\u6570\u3001mount \u5217\u8868\uff09\uff0c\u6307\u5b9a\u4e86\u955c\u50cf\u5728\u67d0\u4e2a\u7279\u5b9a\u5e73\u53f0\u548c\u7cfb\u7edf\u7684\u914d\u7f6e\u3002\u6bd4\u8f83\u63a5\u8fd1\u6211\u4eec\u4f7f\u7528 docker inspect <image_id> \u770b\u5230\u7684\u5185\u5bb9<\/p>\n<p>  manifest \u6587\u4ef6\uff1a\u955c\u50cf\u7684 config \u6587\u4ef6\u7d22\u5f15\uff0c\u6709\u54ea\u4e9b layer\uff0c\u989d\u5916\u7684 annotation \u4fe1\u606f\uff0cmanifest \u6587\u4ef6\u4e2d\u4fdd\u5b58\u4e86\u5f88\u591a\u548c\u5f53\u524d\u5e73\u53f0\u6709\u5173\u7684\u4fe1\u606f<\/p>\n<p>  index \u6587\u4ef6\uff1a\u53ef\u9009\u7684\u6587\u4ef6\uff0c\u6307\u5411\u4e0d\u540c\u5e73\u53f0\u7684 manifest \u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u80fd\u4fdd\u8bc1\u4e00\u4e2a\u955c\u50cf\u53ef\u4ee5\u8de8\u5e73\u53f0\u4f7f\u7528\uff0c\u6bcf\u4e2a\u5e73\u53f0\u62e5\u6709\u4e0d\u540c\u7684 manifest \u6587\u4ef6\uff0c\u4f7f\u7528 index \u4f5c\u4e3a\u7d22\u5f15<\/p>\n<p>  <strong>runtime spec\uff08\u5bb9\u5668\u8fd0\u884c\u65f6\u548c\u751f\u547d\u5468\u671f\uff09<\/strong><\/p>\n<p>  \u5bb9\u5668\u6807\u51c6\u683c\u5f0f\u4e5f\u8981\u6c42\u5bb9\u5668\u628a\u81ea\u8eab\u8fd0\u884c\u65f6\u7684\u72b6\u6001\u6301\u4e45\u5316\u5230\u78c1\u76d8\u4e2d\uff0c\u8fd9\u6837\u4fbf\u4e8e\u5916\u90e8\u7684\u5176\u5b83\u5de5\u5177\u5bf9\u6b64\u4fe1\u606f\u4f7f\u7528\u548c\u6f14\u7ece\u3002\u8be5\u8fd0\u884c\u65f6\u72b6\u6001\u4ee5JSON\u683c\u5f0f\u7f16\u7801\u5b58\u50a8\u3002\u63a8\u8350\u628a\u8fd0\u884c\u65f6\u72b6\u6001\u7684JSON\u6587\u4ef6\u5b58\u50a8\u5728\u4e34\u65f6\u6587\u4ef6\u7cfb\u7edf\u4e2d\u4ee5\u4fbf\u7cfb\u7edf\u91cd\u542f\u540e\u4f1a\u81ea\u52a8\u79fb\u9664\u3002<\/p>\n<p>  \u57fa\u4e8eLinux\u5185\u6838\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u8be5\u4fe1\u606f\u5e94\u8be5\u7edf\u4e00\u5730\u5b58\u50a8\u5728\/run\/opencontainer\/containers\u76ee\u5f55\uff0c\u8be5\u76ee\u5f55\u7ed3\u6784\u4e0b\u4ee5\u5bb9\u5668ID\u547d\u540d\u7684\u6587\u4ef6\u5939\uff08\/run\/opencontainer\/containers\/<containerID>\/state.json\uff09\u4e2d\u5b58\u653e\u5bb9\u5668\u7684\u72b6\u6001\u4fe1\u606f\u5e76\u5b9e\u65f6\u66f4\u65b0\u3002\u6709\u4e86\u8fd9\u6837\u9ed8\u8ba4\u7684\u5bb9\u5668\u72b6\u6001\u4fe1\u606f\u5b58\u50a8\u4f4d\u7f6e\u4ee5\u540e\uff0c\u5916\u90e8\u7684\u5e94\u7528\u7a0b\u5e8f\u5c31\u53ef\u4ee5\u5728\u7cfb\u7edf\u4e0a\u7b80\u4fbf\u5730\u627e\u5230\u6240\u6709\u8fd0\u884c\u7740\u7684\u5bb9\u5668\u4e86\u3002<\/p>\n<p>  state.json\u6587\u4ef6\u4e2d\u5305\u542b\u7684\u5177\u4f53\u4fe1\u606f\u9700\u8981\u6709\uff1a<\/p>\n<p>  \u7248\u672c\u4fe1\u606f\uff1a\u5b58\u653eOCI\u6807\u51c6\u7684\u5177\u4f53\u7248\u672c\u53f7\u3002<\/p>\n<p>  \u5bb9\u5668ID\uff1a\u901a\u5e38\u662f\u4e00\u4e2a\u54c8\u5e0c\u503c\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u6613\u8bfb\u7684\u5b57\u7b26\u4e32\u3002\u5728state.json\u6587\u4ef6\u4e2d\u52a0\u5165\u5bb9\u5668ID\u662f\u4e3a\u4e86\u4fbf\u4e8e\u4e4b\u524d\u63d0\u5230\u7684\u8fd0\u884c\u65f6hooks\u53ea\u9700\u8f7d\u5165state.json\u5c31- &#8211; \u53ef\u4ee5\u5b9a\u4f4d\u5230\u5bb9\u5668\uff0c\u7136\u540e\u68c0\u6d4bstate.json\uff0c\u53d1\u73b0\u6587\u4ef6\u4e0d\u89c1\u4e86\u5c31\u8ba4\u4e3a\u5bb9\u5668\u5173\u505c\uff0c\u518d\u6267\u884c\u76f8\u5e94\u9884\u5b9a\u4e49\u7684\u811a\u672c\u64cd\u4f5c\u3002<\/p>\n<p>  PID\uff1a\u5bb9\u5668\u4e2d\u8fd0\u884c\u7684\u9996\u4e2a\u8fdb\u7a0b\u5728\u5bbf\u4e3b\u673a\u4e0a\u7684\u8fdb\u7a0b\u53f7\u3002<\/p>\n<p>  \u5bb9\u5668\u6587\u4ef6\u76ee\u5f55\uff1a\u5b58\u653e\u5bb9\u5668rootfs\u53ca\u76f8\u5e94\u914d\u7f6e\u7684\u76ee\u5f55\u3002\u5916\u90e8\u7a0b\u5e8f\u53ea\u9700\u8bfb\u53d6state.json\u5c31\u53ef\u4ee5\u5b9a\u4f4d\u5230\u5bbf\u4e3b\u673a\u4e0a\u7684\u5bb9\u5668\u6587\u4ef6\u76ee\u5f55\u3002<\/p>\n<p>  \u5bb9\u5668\u521b\u5efa\uff1a\u521b\u5efa\u5305\u62ec\u6587\u4ef6\u7cfb\u7edf\u3001namespaces\u3001cgroups\u3001\u7528\u6237\u6743\u9650\u5728\u5185\u7684\u5404\u9879\u5185\u5bb9\u3002<\/p>\n<p>  \u5bb9\u5668\u8fdb\u7a0b\u7684\u542f\u52a8\uff1a\u8fd0\u884c\u5bb9\u5668\u8fdb\u7a0b\uff0c\u8fdb\u7a0b\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5b9a\u4e49\u5728\u7684config.json\u4e2d\uff0cargs\u9879\u3002<\/p>\n<p>  \u5bb9\u5668\u6682\u505c\uff1a\u5bb9\u5668\u5b9e\u9645\u4e0a\u4f5c\u4e3a\u8fdb\u7a0b\u53ef\u4ee5\u88ab\u5916\u90e8\u7a0b\u5e8f\u5173\u505c\uff08kill\uff09\uff0c\u7136\u540e\u5bb9\u5668\u6807\u51c6\u89c4\u8303\u5e94\u8be5\u5305\u542b\u5bf9\u5bb9\u5668\u6682\u505c\u4fe1\u53f7\u7684\u6355\u83b7\uff0c\u5e76\u505a\u76f8\u5e94\u8d44\u6e90\u56de\u6536\u7684\u5904\u7406\uff0c\u907f\u514d\u5b64\u513f\u8fdb\u7a0b\u7684\u51fa\u73b0\u3002\n<\/p><\/blockquote>\n<h2>CRI\u548cOCI\u7684\u5bf9\u6bd4<\/h2>\n<p>OCI\u662f\u5bb9\u5668\u6280\u672f\u7684\u5f00\u653e\u6027\u6807\u51c6\uff0c\u800cCRI\u662fKubernetes\u4e3a\u4e86\u66f4\u65b9\u4fbf\u7684\u652f\u6301\u4e0d\u540c\u7684\u5bb9\u5668\u6280\u672f\uff0c\u800c\u63a8\u51fa\u7684\u63a5\u53e3\u6807\u51c6\uff0c\u4e0eCRI\u7c7b\u4f3c\u7684\u8fd8\u6709CNI\u548cCSI\uff0c\u5206\u522b\u662f\u7f51\u7edc\u548c\u5b58\u50a8\u7684\u63a5\u53e3\u3002<\/p>\n<p>\u53ef\u4ee5\u770b\u4e00\u4e0b\u8fd9\u5f20\u56fe:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/kubelet-cri-runtime.png\" alt=\"kubelet cri runtime\" \/><\/p>\n<p>kubelet\u6709\u4e86CRI\u7684\u63a5\u53e3\uff0c\u53ef\u4ee5\u901a\u8fc7cri-containerd\u548ccontainerd\u901a\u4fe1\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7docker-shim\u548cdocker\u901a\u4fe1\u3002<strong>\u6ce8\u610f\u8fd9\u91cc\u7684cri-containerd\u5728containerd v1.2\u7684\u65f6\u5019\u5c31\u5df2\u7ecf\u4e0d\u518d\u4f7f\u7528\u4e86\uff0c\u56e0\u4e3acontainerd\u672c\u8eab\u5c31\u652f\u6301\u4e86CRI\u7684\u89c4\u8303\u3002<\/strong><\/p>\n<p>\u540c\u65f6kubernetes\u8fd8\u5b75\u5316\u4e86cri-o\u8fd9\u4e2a\u9879\u76ee\uff0ccri-o\u76f4\u63a5\u6253\u901a\u4e86cri\u548coci\u3002runc\u548ckata\u90fd\u662foci\u7684\u5177\u4f53\u5b9e\u73b0\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u7528\u4e00\u53e5\u8bdd\u7406\u89e3\uff1a\u5b9e\u73b0\u4e86CRI\u5c31\u53ef\u4ee5\u4fdd\u8bc1\u88abkubernetes\u4f7f\u7528\uff0c\u5b9e\u73b0\u4e86OCI\u5c31\u53ef\u4ee5\u5728\u5404\u79cd\u8bbe\u5907\u4e0a\u65e0\u5dee\u522b\u7684\u4f7f\u7528\u5404\u79cd\u955c\u50cf\u3002<\/p>\n<h2>docker\u3001containerd\u548crunc<\/h2>\n<p>containerd\u4ecedocker\u4e2d\u5206\u51fa\u6765\u7684\u4e00\u90e8\u5206\u3002containerd\u662f\u8d1f\u8d23\u7ba1\u7406\u5bb9\u5668\u751f\u547d\u5468\u671f\u7684\u5e38\u9a7b\u8fdb\u7a0b\uff0c\u800crunc\u5219\u662f\u771f\u6b63\u8d1f\u8d23\u5bb9\u5668\u8fd0\u884c\u7684\u90e8\u5206\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u7684\u56fe\u6765\u770b\u4e09\u8005\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/docker-containerd-runc.jpg\" alt=\"docker-containerd-runc\" \/><\/p>\n<p>containerd\u4f1a\u8c03\u7528\u591a\u4e2arunc\u5b9e\u4f8b\u6765\u7ba1\u7406\u591a\u4e2a\u5bb9\u5668\u3002docker engine\u5219\u662f\u63d0\u4f9b\u63a5\u53e3\u7ed9\u7528\u6237\u4f7f\u7528\u3002<\/p>\n<h2>kubernetes\u5f53\u524d\u652f\u6301\u7684CRI\u540e\u7aef<\/h2>\n<h3>containerd<\/h3>\n<p>containerd\u7684\u5730\u5740\uff1ahttps:\/\/github.com\/containerd\/containerd<\/p>\n<p>\u5148\u7528\u5b98\u7f51\u7684\u56fe\u7247\u6765\u770b\u4e00\u4e0bcontainerd\u7684\u67b6\u6784\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/containerd-architecture.png\" alt=\"containerd architecture\" \/><\/p>\n<p>containerd\u5904\u4e8eos\u548cclients\u4e4b\u95f4\uff0c\u5b83\u4f7f\u7528CRI API\u63d0\u4f9b\u7ed9Kubelet\u8c03\u7528\uff0c\u4f7f\u7528containerd API\u63d0\u4f9b\u7ed9containerd client\u8c03\u7528\uff0c\u4f7f\u7528Metrics API\u63d0\u4f9b\u7ed9Prometheus\u76d1\u63a7\u6570\u636e\u3002\u7136\u540e\u6709\u4e00\u5c42<code>containerd Service Interfaces<\/code>\u63d0\u4f9b\u7ed9\u4e0a\u5c42api\u4f7f\u7528\u3002\u6ce8\u610f\u5230\u5176\u4e2d\u8fd8\u6709\u4e00\u4e2a<code>container-shim<\/code>\u6253\u901a\u4e86<code>Runtime manager<\/code>\u548c<code>OCI runtime<\/code>\u7684\u5177\u4f53\u5b9e\u73b0\uff0c\u6bd4\u5982<code>runc<\/code>\u3001<code>runhcs<\/code>\u3001<code>kata<\/code>\u3002<\/p>\n<p>containerd\u5b9e\u73b0\u4e86\u4ee5\u4e0b\u7684\u7279\u6027\uff1a<\/p>\n<ul>\n<li>OCI Image\u89c4\u8303\u7684\u652f\u6301<\/li>\n<li>OCI Runtime\u89c4\u8303\u7684\u652f\u6301(\u901a\u8fc7runc\u7b49)<\/li>\n<li>Image\u7684\u4e0a\u4f20\u548c\u4e0b\u8f7d<\/li>\n<li>\u5bb9\u5668\u8fd0\u884c\u65f6\u548c\u751f\u547d\u5468\u671f\u7684\u652f\u6301<\/li>\n<li>\u521b\u5efa\u3001\u4fee\u6539\u548c\u5220\u9664\u7f51\u7edc<\/li>\n<li>\u7ba1\u7406\u7f51\u7edc\u547d\u540d\u7a7a\u95f4\u4ee5\u53ca\u5c06\u5bb9\u5668\u52a0\u5165\u5230\u73b0\u6709\u7684\u7f51\u7edc\u547d\u540d\u7a7a\u95f4<\/li>\n<li>\u5168\u90e8\u955c\u50cf\u7684CAS\u5b58\u50a8\u7684\u591a\u79df\u6237\u6a21\u5f0f\u652f\u6301<\/li>\n<\/ul>\n<h3>cri-o<\/h3>\n<p>\u9879\u76ee\u5730\u5740\uff1ahttps:\/\/github.com\/cri-o\/cri-o<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/11\/crio-architecture.png\" alt=\"cri-o\" \/><\/p>\n<p>cri-o\u9879\u76ee\u662fKubernetes CRI\u63a5\u53e3\u7684\u5b9e\u73b0\uff0c\u540c\u65f6\u53ef\u4ee5\u517c\u5bb9OCI\u6807\u51c6\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\u3002\u8fd9\u6837\u7684\u80fd\u529b\u5c31\u4f7f\u5f97\u5b83\u53ef\u4ee5\u4f5c\u4e3aDocker\u7684\u8f7b\u91cf\u7ea7\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u4f7f\u5f97Kubernetes\u53ef\u4ee5\u63a5\u5165\u7b26\u5408OCI\u6807\u51c6\u7684\u6240\u6709\u5bb9\u5668\u8fd0\u884c\u65f6\uff0c\u540c\u65f6\u4e5f\u51cf\u5c11\u4e86\u5bb9\u5668\u5f00\u53d1\u8005\u4eec\u7684\u989d\u5916\u5de5\u4f5c\u91cf\uff08\u53ea\u9700\u5b9e\u73b0OCI\u6807\u51c6\u5373\u53ef\uff09\u3002<\/p>\n<h3>frakti<\/h3>\n<p>\u9879\u76ee\u5730\u5740\uff1ahttps:\/\/github.com\/kubernetes\/frakti<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/11\/frakti.png\" alt=\"frakti\" \/><\/p>\n<p>frakti\u662fKubernetes\u5b98\u65b9\u63a8\u51fa\u7684\u4e00\u4e2a\u5bb9\u5668\u8fd0\u884c\u65f6\uff0c\u4f46\u662f\u4e0d\u540c\u4e8edocker\u8fd9\u6837\u7684\u5229\u4e8elinux namespace\u7684\u6280\u672f\uff0c\u5b83\u662f\u57fa\u4e8e\u865a\u62df\u5316\u6280\u672f\u7684\u5bb9\u5668\uff0c\u56e0\u6b64\u53ef\u4ee5\u5e26\u6765\u66f4\u597d\u7684\u73af\u5883\u9694\u79bb\u4ee5\u53ca\u72ec\u4eab\u7684\u5185\u6838\u3002<\/p>\n<h3>rkt<\/h3>\n<p>\u9879\u76ee\u5730\u5740\uff1ahttps:\/\/github.com\/rkt\/rkt\/<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/11\/rkt-vs-docker-process-model.png\" alt=\"rkt-vs-docker-process-model\" \/><\/p>\n<p>rkt\u662fcoreos\u63a8\u51fa\u7684\u548cDocker\u6297\u8861\u7684\u5bb9\u5668\u4ea7\u54c1\uff0c\u4e0d\u540c\u4e8e\u73b0\u5728\u7684Docker\u5f80\u66f4\u5927\u66f4\u5168\u7684\u65b9\u5411\uff0c\u4e0d\u4ec5\u4ec5\u662f\u5bb9\u5668\u529f\u80fd\uff0c\u66f4\u96c6\u6210\u4e86Swarm\u8fd9\u6837\u7684\u96c6\u7fa4\u65b9\u6848\uff0crkt\u6ce8\u91cd\u7684\u662f\u4f5c\u4e3a\u8fd0\u884c\u5728linux\u7cfb\u7edf\u4e0a\u7684\u5bb9\u5668\u7ec4\u4ef6\u3002\u4e0a\u56fe\u53ef\u4ee5\u770b\u51faDocker\u7684\u67b6\u6784\u8981\u66f4\u52a0\u7684\u590d\u6742\u3002<\/p>\n<h3>docker<\/h3>\n<p>\u5b98\u7f51\u5730\u5740: https:\/\/docker.com<\/p>\n<p>docker\u4f5c\u4e3aKubernetes\u7684\u9ed8\u8ba4\u5bb9\u5668\u8fd0\u884c\u65f6\uff0c\u5176\u672c\u8eab\u5728\u5bb9\u5668\u9886\u57df\u4e5f\u5360\u636e\u4e86\u7edd\u5bf9\u7684\u9886\u5bfc\u5730\u4f4d\u3002<\/p>\n<h2>\u5b9e\u73b0\u4e86OCI\uff0c\u53ef\u4ee5\u901a\u8fc7cri-o\u63a5\u5165kubernetes\u7684\u9879\u76ee<\/h2>\n<h3>runc<\/h3>\n<p>\u9879\u76ee\u5730\u5740: https:\/\/github.com\/opencontainers\/runc<\/p>\n<p>opencontainers\u7ec4\u7ec7\u63a8\u51fa\u4e86OCI\u7684\u89c4\u8303\uff0c\u540c\u65f6\u4e5f\u5f00\u53d1\u4e86runc\u4f5c\u4e3aOCI\u89c4\u8303\u7684\u5b9e\u73b0\u3002runc\u662fdocker\u8d21\u732e\u51fa\u6765\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\uff0crunc\u4e0d\u4ec5\u662fcontainerd\u7684\u9ed8\u8ba4\u8fd0\u884c\u65f6\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u63a5\u5165\u5230cri-o\u4e2d\u3002<\/p>\n<h3>Clear Containers<\/h3>\n<p>https:\/\/github.com\/clearcontainers\/runtime\uff0c\u9879\u76ee\u5df2\u7ecf\u4e0d\u5728\u7ef4\u62a4\uff0c\u63a8\u8350\u8fc1\u79fb\u5230Kata Containers<\/p>\n<h3>Kata Containers<\/h3>\n<p>https:\/\/github.com\/kata-containers\/runtime<\/p>\n<p>Kata Containers\u548crunc\u8fd9\u79cd\u6280\u672f\u6808\u662f\u4e0d\u540c\u7684\u3002runc\u4f7f\u7528\u7684\u662flinux namespace\u548ccgroup\u6765\u505a\u73af\u5883\u9694\u79bb\u548c\u8d44\u6e90\u9650\u5236\uff0c\u7f3a\u70b9\u5728\u4e8e\u4f7f\u7528\u7684\u4ecd\u7136\u662f\u5bbf\u4e3b\u673a\u7684\u5185\u6838\uff0c\u8fd9\u6837\u4e00\u65e6\u53d7\u5230\u4e86\u5185\u6838\u5c42\u7684\u5f71\u54cd\uff0c\u4f1a\u6269\u6563\u5230\u6240\u6709\u7684\u5bb9\u5668\u3002\u800cKata Containers\u4f7f\u7528\u7684\u662f\u865a\u62df\u5316\u7684\u6280\u672f\uff0c\u5b83\u5b9e\u9645\u4e0a\u662f\u4e00\u4e2a\u865a\u62df\u673a\uff0c\u4f46\u662f\u53ef\u4ee5\u50cf\u5bb9\u5668\u90a3\u6837\u4f7f\u7528\u3002<\/p>\n<p>Kata Containers\u662f2017\u5e7412\u6708\u542f\u52a8\u7684\u9879\u76ee\uff0c\u7ed3\u5408\u4e86Intel Clear Containers\u548c Hyper.sh RunV\u7684\u4f18\u70b9\uff0c\u652f\u6301\u4e0d\u540c\u7684\u4e3b\u6d41\u67b6\u6784\uff0c\u9664x86_64\u5916\uff0c\u8fd8\u652f\u6301AMD64, ARM, IBM p-series and IBM z-series\u3002<\/p>\n<p>\u4e0b\u56fe\u662fkata Containers\u548c\u4f20\u7edf\u5bb9\u5668\u6280\u672f\u7684\u5bf9\u6bd4:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/11\/katacontainers_traditionalvskata_diagram.jpg\" alt=\"katacontainers_traditionalvskata_diagram\" \/><\/p>\n<p>\u4e3b\u8981\u7279\u70b9\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li><strong>\u5b89\u5168\u6027<\/strong>: \u4f7f\u7528\u4e13\u7528\u5185\u6838\uff0c\u63d0\u4f9b\u4e86\u7f51\u7edc\u3001IO\u548c\u5185\u5b58\u7684\u72ec\u7acb\uff0c\u5728\u865a\u62df\u5316VT\u6269\u5c55\u7684\u57fa\u7840\u4e0a\u5229\u7528\u786c\u4ef6\u5f3a\u5236\u9694\u79bb<\/li>\n<li><strong>\u6027\u80fd<\/strong>: \u63d0\u4f9b\u4e0e\u6807\u51c6Linux\u5bb9\u5668\u4e00\u81f4\u7684\u6027\u80fd\uff1b\u63d0\u9ad8\u9694\u79bb\u5ea6\uff0c\u800c\u65e0\u9700\u589e\u52a0\u6807\u51c6\u865a\u62df\u673a\u7684\u6027\u80fd\u3002<\/li>\n<li><strong>\u517c\u5bb9\u6027<\/strong>: \u652f\u6301\u884c\u4e1a\u6807\u51c6\uff0c\u5305\u62ecOCI\u5bb9\u5668\u683c\u5f0f\uff0cKubernetes CRI\u63a5\u53e3\u4ee5\u53ca\u65e7\u7248\u865a\u62df\u5316\u6280\u672f\u3002<\/li>\n<li><strong>\u7b80\u5355<\/strong>: \u6d88\u9664\u4e86\u5728\u5b8c\u6574\u7684\u865a\u62df\u673a\u5185\u90e8\u5d4c\u5957\u5bb9\u5668\u7684\u8981\u6c42\uff1b\u6807\u51c6\u63a5\u53e3\u4f7f\u63d2\u5165\u548c\u5165\u95e8\u53d8\u5f97\u5bb9\u6613<\/li>\n<\/ul>\n<p>\u4e0b\u56fe\u662fKata Containers\u7684\u67b6\u6784:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/11\/katacontainers_architecture_diagram.jpg\" alt=\"katacontainers_architecture_diagram\" \/><\/p>\n<p>Kubernetes\u53ef\u4ee5\u901a\u8fc7Hypervisor VSOCK Socket\u548c\u5bb9\u5668\u4ea4\u4e92\u3002<\/p>\n<h3>gVisor<\/h3>\n<p>gVisor\u63d0\u4f9b\u7684\u662f\u4e00\u4e2a\u6c99\u7bb1\u5bb9\u5668\u73af\u5883\uff0c\u53ef\u4ee5\u8bf4\u662f\u4f20\u7edf\u5bb9\u5668\u6280\u672f\u548c\u865a\u62df\u673a\u5bb9\u5668\u6280\u672f\u7684\u6298\u4e2d\u3002\u5b83\u4f7f\u7528Go\u7f16\u5199\u4e86\u4e00\u4e2a\u53ef\u4ee5\u4f5c\u4e3a\u666e\u901a\u975e\u7279\u6743\u8fdb\u7a0b\u8fd0\u884c\u7684\u5185\u6838\uff0c\u8fd9\u4e2a\u5185\u6838\u5b9e\u73b0\u4e86\u5927\u591a\u6570\u7684\u7cfb\u7edf\u8c03\u7528\u3002\u6240\u4ee5\u76f8\u6bd4\u4e8enamespace\u548ccgroup\u5b9e\u73b0\u7684\u5bb9\u5668\uff0c\u5b83\u53ef\u4ee5\u5c4f\u853d\u6389\u5bb9\u5668\u5185\u5e94\u7528\u7a0b\u5e8f\u7684\u5185\u6838\u8c03\u7528\u3002\u76f8\u6bd4\u4e8e\u865a\u62df\u673a\u5b9e\u73b0\u7684\u5bb9\u5668\uff0c\u5b83\u66f4\u8f7b\u91cf\u7ea7\uff08\u4f5c\u4e3a\u7cfb\u7edf\u7684\u4e00\u4e2a\u8fdb\u7a0b\u8fd0\u884c\uff09\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/11\/gvisor.jpg\" alt=\"gvisor\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 \u6211\u8ba4\u4e3a\u5bb9\u5668\u6807\u51c6\u5316\u53ef\u4ee5\u5206\u4e3a\u4e24\u4e2a\u89d2\u5ea6\u53bb\u8bb2\uff1a \u4e00\u4e2a\u662f\u5bb9\u5668\u7684\u4f7f\u7528\u548c\u955c\u50cf\u7684\u683c\u5f0f\u9700\u8981\u89c4\u8303\uff0c\u8fd9\u53eb\u505aOCI(open c &hellip; <a href=\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u5bb9\u5668\u6807\u51c6\u5316<\/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":[89,97],"tags":[99,98],"class_list":["post-491","post","type-post","status-publish","format-standard","hentry","category-k8s","category-container","tag-cri","tag-oci"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5bb9\u5668\u6807\u51c6\u5316 - \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\/2019\/11\/04\/container\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5bb9\u5668\u6807\u51c6\u5316 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"og:description\" content=\"\u6982\u8ff0 \u6211\u8ba4\u4e3a\u5bb9\u5668\u6807\u51c6\u5316\u53ef\u4ee5\u5206\u4e3a\u4e24\u4e2a\u89d2\u5ea6\u53bb\u8bb2\uff1a \u4e00\u4e2a\u662f\u5bb9\u5668\u7684\u4f7f\u7528\u548c\u955c\u50cf\u7684\u683c\u5f0f\u9700\u8981\u89c4\u8303\uff0c\u8fd9\u53eb\u505aOCI(open c &hellip; \u7ee7\u7eed\u9605\u8bfb\u5bb9\u5668\u6807\u51c6\u5316\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/\" \/>\n<meta property=\"og:site_name\" content=\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-04T05:33:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-05T13:38:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-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=\"6 \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\/2019\/11\/04\/container\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/\"},\"author\":{\"name\":\"jiangpengfei\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"headline\":\"\u5bb9\u5668\u6807\u51c6\u5316\",\"datePublished\":\"2019-11-04T05:33:27+00:00\",\"dateModified\":\"2023-07-05T13:38:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/\"},\"wordCount\":327,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png\",\"keywords\":[\"cri\",\"oci\"],\"articleSection\":[\"k8s\",\"\u5bb9\u5668\u6280\u672f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/\",\"url\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/\",\"name\":\"\u5bb9\u5668\u6807\u51c6\u5316 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png\",\"datePublished\":\"2019-11-04T05:33:27+00:00\",\"dateModified\":\"2023-07-05T13:38:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage\",\"url\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png\",\"contentUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png\",\"width\":572,\"height\":136},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.myway5.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5bb9\u5668\u6807\u51c6\u5316\"}]},{\"@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":"\u5bb9\u5668\u6807\u51c6\u5316 - \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\/2019\/11\/04\/container\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5bb9\u5668\u6807\u51c6\u5316 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","og_description":"\u6982\u8ff0 \u6211\u8ba4\u4e3a\u5bb9\u5668\u6807\u51c6\u5316\u53ef\u4ee5\u5206\u4e3a\u4e24\u4e2a\u89d2\u5ea6\u53bb\u8bb2\uff1a \u4e00\u4e2a\u662f\u5bb9\u5668\u7684\u4f7f\u7528\u548c\u955c\u50cf\u7684\u683c\u5f0f\u9700\u8981\u89c4\u8303\uff0c\u8fd9\u53eb\u505aOCI(open c &hellip; \u7ee7\u7eed\u9605\u8bfb\u5bb9\u5668\u6807\u51c6\u5316","og_url":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/","og_site_name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","article_published_time":"2019-11-04T05:33:27+00:00","article_modified_time":"2023-07-05T13:38:17+00:00","og_image":[{"url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png","type":"","width":"","height":""}],"author":"jiangpengfei","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"jiangpengfei","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#article","isPartOf":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/"},"author":{"name":"jiangpengfei","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"headline":"\u5bb9\u5668\u6807\u51c6\u5316","datePublished":"2019-11-04T05:33:27+00:00","dateModified":"2023-07-05T13:38:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/"},"wordCount":327,"commentCount":0,"publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png","keywords":["cri","oci"],"articleSection":["k8s","\u5bb9\u5668\u6280\u672f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/","url":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/","name":"\u5bb9\u5668\u6807\u51c6\u5316 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","isPartOf":{"@id":"https:\/\/www.myway5.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png","datePublished":"2019-11-04T05:33:27+00:00","dateModified":"2023-07-05T13:38:17+00:00","breadcrumb":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#primaryimage","url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png","contentUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/10\/cri-architecture.png","width":572,"height":136},{"@type":"BreadcrumbList","@id":"https:\/\/www.myway5.com\/index.php\/2019\/11\/04\/container\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.myway5.com\/"},{"@type":"ListItem","position":2,"name":"\u5bb9\u5668\u6807\u51c6\u5316"}]},{"@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":7933,"_links":{"self":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/491","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=491"}],"version-history":[{"count":1,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/491\/revisions"}],"predecessor-version":[{"id":1568,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/491\/revisions\/1568"}],"wp:attachment":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/media?parent=491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/categories?post=491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/tags?post=491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}