cmd/ctr/commands/images: support usage subcommand#8105
Merged
AkihiroSuda merged 1 commit intocontainerd:mainfrom Feb 15, 2023
Merged
cmd/ctr/commands/images: support usage subcommand#8105AkihiroSuda merged 1 commit intocontainerd:mainfrom
AkihiroSuda merged 1 commit intocontainerd:mainfrom
Conversation
The `ctr image usage` can display the usage of snapshots with a given image ref. It's easy for user to get chain snapshot IDs and unpack usage. And according to the [discuss][1], this subcommand can be used to ensure if snapshot's pagecache has been discarded in a unexpected reboot. How to use it: ```bash $ bin/ctr image usage --snapshotter native docker.io/library/golang:1.19.3 ctr: image docker.io/library/golang:1.19.3 isn't unpacked in snapshotter native $ bin/ctr image usage --snapshotter overlayfs docker.io/library/golang:1.19.3 KEY SIZE INODES sha256:28114d8403bac6352c3e09cb23e37208138a0cd9d309edf3df38e57be8075a1d 16.0 KiB 4 sha256:f162c02ce6b9b594757cd76eda1c1dd119b88e69e882cb645bf7ad528b54f0d2 476.2 MiB 13660 sha256:a5b9faceaa495819b9ba7011b7276c4ffaffe6c7b9de0889e11abc1113f7b5ca 225.5 MiB 3683 sha256:412b2615d27d6b0090558d25b201b60a7dff2a40892a7e7ca868b80bf5e5de41 159.8 MiB 6196 sha256:dbce1593502d39c344ce089f98187999f294de5182a7106dcb6c9d04ce0c7265 19.4 MiB 502 sha256:8953bf5d24149e9b2236abc76bd0aa14b73828f1b63e816cb4b457249f6125bc 12.2 MiB 958 sha256:ccba29d6937047c719a6c048a7038d3907590fbb8556418d119469b2ad4f95bc 134.7 MiB 7245 $ bin/ctr image usage --snapshotter overlayfs docker.io/library/golang:1.19 ctr: failed to ensure if image docker.io/library/golang:1.19 exists: image "docker.io/library/golang:1.19": not found ``` [1]: <containerd#5854 (comment)> Signed-off-by: Wei Fu <[email protected]>
estesp
approved these changes
Feb 14, 2023
AkihiroSuda
approved these changes
Feb 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
ctr image usagecan display the usage of snapshots with a given image ref. It's easy for user to get chain snapshot IDs and unpack usage. And according to the discuss, this subcommand can be used to ensure if snapshot's pagecache has been discarded in a unexpected reboot.How to use it:
Signed-off-by: Wei Fu [email protected]