containerd 查看镜像
时间: 2023-08-14 12:19:15 浏览: 168
镜像查看工具
可以使用 `ctr` 命令来查看 `containerd` 上的镜像。具体步骤如下:
1. 首先,使用 `ctr images ls` 命令来列出所有的镜像。
```
$ sudo ctr images ls
REF TYPE DIGEST SIZE PLATFORMS
docker.io/library/nginx:latest docker.io/docker.io/library/nginx:latest sha256:2f0a200cfa5639f2d08e8c7b19b9a6e6c6a98fb4e00e0f9c69c0e5c1c08b5b3f 132.3 MB linux/amd64
```
2. 如果需要查看某个具体镜像的详细信息,可以使用 `ctr images inspect` 命令,并指定镜像的 `REF`。
```
$ sudo ctr images inspect docker.io/library/nginx:latest
{
"name": "docker.io/library/nginx:latest",
"labels": {
"maintainer": "NGINX Docker Maintainers <docker-maint@nginx.com>"
},
"target": {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 132298408,
"digest": "sha256:2f0a200cfa5639f2d08e8c7b19b9a6e6c6a98fb4e00e0f9c69c0e5c1c08b5b3f",
"length": 3,
"urls": [
"docker.io/sha256:8f95ef5d7f9111c75f8c6d0f62a8d2f0c4cd7b5f2e4e0e54f7e11f8f517a9b0e"
]
},
"history": [
{
"created": "2021-07-28T21:21:21.931610697Z",
"created_by": "/bin/sh -c #(nop) CMD [\"nginx\" \"-g\" \"daemon off;\"]",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:21:21.931610697Z",
"created_by": "/bin/sh -c #(nop) STOPSIGNAL SIGQUIT",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:21:21.931610697Z",
"created_by": "/bin/sh -c #(nop) EXPOSE 80",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:21:21.931610697Z",
"created_by": "/bin/sh -c #(nop) ENTRYPOINT [\"docker-entrypoint.sh\"]",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:21:21.931610697Z",
"created_by": "/bin/sh -c #(nop) USER nobody",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:21:21.931610697Z",
"created_by": "/bin/sh -c #(nop) CMD [\"/bin/sh\"]",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:20:57.750174824Z",
"created_by": "/bin/sh -c #(nop) COPY file:4b2aed7f4e0f0d8ee9f2934b2d1b3df7e1e1a6f8a4b1cd2a0340c2a8b76c2d3b in /",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:20:57.546135745Z",
"created_by": "/bin/sh -c #(nop) ENV NGINX_VERSION=1.21.1",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:20:57.546135745Z",
"created_by": "/bin/sh -c #(nop) ENV NJS_VERSION=0.6.2",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:20:57.546135745Z",
"created_by": "/bin/sh -c #(nop) LABEL maintainer=NGINX Docker Maintainers <docker-maint@nginx.com>",
"created_by_platform": "linux/amd64"
},
{
"created": "2021-07-28T21:20:57.546135745Z",
"created_by": "/bin/sh -c #(nop) CMD [\"bash\"]",
"created_by_platform": "linux/amd64"
}
]
}
```
这样,就可以使用 `ctr` 命令来查看 `containerd` 上的镜像了。
阅读全文