在docker中,我们可以使用
docker manifest inspect
查看图像清单。
对于nerdctl和ctrcrictl,没有相关的清单命令。
nerdctl image inspect只显示镜像的一些基本信息。
- 检查
nerdctl inspect
的图像sha
"Id": "sha256:221177c6082a88ea4f6240ab2450d540955ac6f4d5454f0e15751b653ebda165",
"RepoTags": [
"k8s.gcr.io/pause:3.7"
],
"RepoDigests": [
"k8s.gcr.io/pause@sha256:bb6ed397957e9ca7c65ada0db5c5d1c707c9c8afc80a94acbe69f3ae76988f0c"
],
- 检查repodigessha并删除文件
find / -name bb6ed397957e9ca7c65ada0db5c5d1c707c9c8afc80a94acbe69f3ae76988f0c
/var/lib/containerd/io.containerd.content.v1.content/blobs/sha256/bb6ed397957e9ca7c65ada0db5c5d1c707c9c8afc80a94acbe69f3ae76988f0c
[root@paco ~]# cat /var/lib/containerd/io.containerd.content.v1.content/blobs/sha256/bb6ed397957e9ca7c65ada0db5c5d1c707c9c8afc80a94acbe69f3ae76988f0c
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 526,
"digest": "sha256:f81611a21cf91214c1ea751c5b525931a0e2ebabe62b3937b6158039ff6f922d",
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 526,
"digest": "sha256:be47ea44f3699337ec9aced948758293f76336bba0900d383623d85c4a88e2d4",
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v7"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 526,
"digest": "sha256:daff8f62d8a9446b88b0806d7f2bece15c5182b4bd9a327597ecde60cf19efb1",
"platform": {
"architecture": "arm64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 526,
"digest": "sha256:2524e66c23cb024134ec213032437b0af1d239de37f70ab6064e1d31be62da61",
"platform": {
"architecture": "ppc64le",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 526,
"digest": "sha256:779c511730521a030b80471064b9a2b4f531575144574882148bf25716031a0f",
"platform": {
"architecture": "s390x",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1158,
"digest": "sha256:778127f16f3d75c810f1928dc6bb474eb22b55ff6e0d703eaff251faa8ab5eec",
"platform": {
"architecture": "amd64",
"os": "windows",
"os.version": "10.0.17763.2686"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1158,
"digest": "sha256:54cd03c37f2e87826e4c7f1baf500ac6e70fa5fcebadd6254789c80f9268a2f0",
"platform": {
"architecture": "amd64",
"os": "windows",
"os.version": "10.0.19042.1586"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1158,
"digest": "sha256:85cfebc79dccc7a0e56680778a614b29a0b1c2ae98d4b1efc746764c04d5656c",
"platform": {
"architecture": "amd64",
"os": "windows",
"os.version": "10.0.20348.587"
}
}
]
}
总而言之,您可以直接转到/var/lib/containerd/io.containerd.content.v1.content/blobs/sha256/
以查找节点上的清单。