Skip to content
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

containerd integration: add container-count to image list (used for docker system df) #43853

Closed
thaJeztah opened this issue Jul 21, 2022 · 3 comments
Labels
area/images containerd-integration Issues and PRs related to containerd integration kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@thaJeztah
Copy link
Member

Description

The existing implementation allows the number of containers using an image to be included in the result if opts.ContainerCount is set

if opts.ContainerCount {
// Lazily init allContainers.
if allContainers == nil {
allContainers = i.containers.List()
}
// Get container count
var containers int64
for _, c := range allContainers {
if c.ImageID == id {
containers++
}
}
// NOTE: By default, Containers is -1, or "not set"
summary.Containers = containers
}

⚠️ When using multiple snapshotters, what should be counted? As different containers may be using different snapshotters (and thus different snapshots for the same image)

@thaJeztah thaJeztah added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/images containerd-integration Issues and PRs related to containerd integration labels Jul 21, 2022
@26tanishabanik
Copy link

@thaJeztah , can I work on this issue?

@vvoland vvoland closed this as completed Feb 27, 2024
@thaJeztah
Copy link
Member Author

Looks like some TODOs were left behind (not sure if all of them were done?) /cc @vvoland

// TODO(thaJeztah): implement opts.ContainerCount (used for docker system df); see https://github.com/moby/moby/issues/43853
// TODO(thaJeztah): verify behavior of `RepoDigests` and `RepoTags` for images without (untagged) or multiple tags; see https://github.com/moby/moby/issues/43861
// TODO(thaJeztah): verify "Size" vs "VirtualSize" in images; see https://github.com/moby/moby/issues/43862

@vvoland
Copy link
Contributor

vvoland commented Mar 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/images containerd-integration Issues and PRs related to containerd integration kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
No open projects
Development

No branches or pull requests

3 participants