nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

Support `nerdctl system df` command

Open maxsxu opened this issue 11 months ago • 1 comments

What is the problem you're trying to solve

It would be great helpful if we can support nerdctl system df command to show the containerd filesystem usage, just like docker system df can show docker filesystem usage.

Describe the solution you'd like

When run nerdctl system df command, it'll show filesystem usage outputs like following:

❯ nerdctl system df
TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          17        1         18.25GB   17.26GB (94%)
Containers      3         3         169.2MB   0B (0%)
Local Volumes   4         3         798.66GB   22.62MB (0%)
Build Cache     44        0         0B        0B

Additional context

No response

maxsxu avatar Feb 27 '25 08:02 maxsxu

To implement this feature, I think we first need to be able to get the SharedSize of an image.

ref: https://github.com/containerd/nerdctl/blob/main/pkg/cmd/image/list.go#L127

yankay avatar Jun 20 '25 07:06 yankay