-
Notifications
You must be signed in to change notification settings - Fork 676
cmd: support nerdctl manifeset inspect #4413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
25333c7
to
4d459d2
Compare
4eca9da
to
edf0eef
Compare
Example 1:
# nerdctl manifest inspect ghcr.io/stargz-containers/alpine:3.13-org
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310",
"size": 528,
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
//...more manifests
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:44f0cac18b69c3867be12e78766393adf801560a102fe0113bb4abc981acf9bf",
"size": 528,
"platform": {
"architecture": "s390x",
"os": "linux"
}
}
]
}
# nerdctl manifest inspect ghcr.io/stargz-containers/alpine:3.13-org --verbose
[
{
"Ref": "ghcr.io/stargz-containers/alpine:3.13-org@sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310",
"Descriptor": {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310",
"size": 528,
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
"Raw": "ewogICAic2NoZW1hVmVyc2lvbiI6IDIsCiAgICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRvY2tlci5kaXN0cmlidXRpb24ubWFuaWZlc3QudjIranNvbiIsCiAgICJjb25maWciOiB7CiAgICAgICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRvY2tlci5jb250YWluZXIuaW1hZ2UudjEranNvbiIsCiAgICAgICJzaXplIjogMTQ3MiwKICAgICAgImRpZ2VzdCI6ICJzaGEyNTY6NDlmMzU2ZmE0NTEzNjc2YzVlMjJlM2E4NDA0YWFkNmM3MjYyY2M3YWFlZDE1MzQxNDU4MjY1MzIwNzg2YzU4YyIKICAgfSwKICAgImxheWVycyI6IFsKICAgICAgewogICAgICAgICAibWVkaWFUeXBlIjogImFwcGxpY2F0aW9uL3ZuZC5kb2NrZXIuaW1hZ2Uucm9vdGZzLmRpZmYudGFyLmd6aXAiLAogICAgICAgICAic2l6ZSI6IDI4MTE5NDcsCiAgICAgICAgICJkaWdlc3QiOiAic2hhMjU2OmNhM2NkNDJhN2M5NTI1ZjZjZTNkNjRjMWE3MDk4MjYxM2E4MjM1ZjBjYzA1N2VjOTI0NDA1MjkyMTg1M2VmMTUiCiAgICAgIH0KICAgXQp9",
"SchemaV2Manifest": {
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"digest": "sha256:49f356fa4513676c5e22e3a8404aad6c7262cc7aaed15341458265320786c58c",
"size": 1472
},
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"digest": "sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15",
"size": 2811947
}
]
}
},
//...more manifests
]
|
Example 2:
# nerdctl manifest inspect ghcr.io/stargz-containers/alpine@sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"digest": "sha256:49f356fa4513676c5e22e3a8404aad6c7262cc7aaed15341458265320786c58c",
"size": 1472
},
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"digest": "sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15",
"size": 2811947
}
]
}
# nerdctl manifest inspect ghcr.io/stargz-containers/alpine@sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310 --verbose
{
"Ref": "ghcr.io/stargz-containers/alpine@sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310",
"Descriptor": {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310",
"size": 528,
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
"Raw": "ewogICAic2NoZW1hVmVyc2lvbiI6IDIsCiAgICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRvY2tlci5kaXN0cmlidXRpb24ubWFuaWZlc3QudjIranNvbiIsCiAgICJjb25maWciOiB7CiAgICAgICJtZWRpYVR5cGUiOiAiYXBwbGljYXRpb24vdm5kLmRvY2tlci5jb250YWluZXIuaW1hZ2UudjEranNvbiIsCiAgICAgICJzaXplIjogMTQ3MiwKICAgICAgImRpZ2VzdCI6ICJzaGEyNTY6NDlmMzU2ZmE0NTEzNjc2YzVlMjJlM2E4NDA0YWFkNmM3MjYyY2M3YWFlZDE1MzQxNDU4MjY1MzIwNzg2YzU4YyIKICAgfSwKICAgImxheWVycyI6IFsKICAgICAgewogICAgICAgICAibWVkaWFUeXBlIjogImFwcGxpY2F0aW9uL3ZuZC5kb2NrZXIuaW1hZ2Uucm9vdGZzLmRpZmYudGFyLmd6aXAiLAogICAgICAgICAic2l6ZSI6IDI4MTE5NDcsCiAgICAgICAgICJkaWdlc3QiOiAic2hhMjU2OmNhM2NkNDJhN2M5NTI1ZjZjZTNkNjRjMWE3MDk4MjYxM2E4MjM1ZjBjYzA1N2VjOTI0NDA1MjkyMTg1M2VmMTUiCiAgICAgIH0KICAgXQp9",
"SchemaV2Manifest": {
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"config": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"digest": "sha256:49f356fa4513676c5e22e3a8404aad6c7262cc7aaed15341458265320786c58c",
"size": 1472
},
"layers": [
{
"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
"digest": "sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15",
"size": 2811947
}
]
}
} |
f829fa7
to
9af688c
Compare
cc @AkihiroSuda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
b26ad20
to
43c34ee
Compare
https://github.com/containerd/nerdctl/actions/runs/16342021337/job/46172436575?pr=4413
|
I've removed the |
I've already make the code change to align the output of |
f98168c
to
52f8320
Compare
- Add nerdctl manifest inspect to display image manifest details, with optional --verbose output. - Implement manifest parsing, formatting, and related type definitions. - Integrate the new command into the CLI. Signed-off-by: ChengyuZhu6 <[email protected]>
Add tests for tag/digest references and verbose modes Signed-off-by: ChengyuZhu6 <[email protected]>
Documented the nerdctl manifest inspect command with usage, flags, and examples. Signed-off-by: ChengyuZhu6 <[email protected]>
@ChengyuZhu6 so, we need the image to be pulled locally to use eg:
^ |
@apostasie For the current implementation, yes. I think we should reuse the metadata that is already stored in the image store, instead of fetching it from the remote. If the image does not exist locally, we should then fetch the manifests from the remote source. I have created a tracking issue to monitor the progress of |
I am not sure this is desirable, as the behavior would be radically different from docker? |
Got your point. Are you worried about the potential inconsistency between the remote registry and the local image store? |
Fixes: #4414 -- part I