containerd icon indicating copy to clipboard operation
containerd copied to clipboard

ctr: image pull without progress bar

Open rgl opened this issue 1 year ago • 6 comments

What is the problem you're trying to solve

the ctr image pull output is too verbose and uses too much space in my terminal scrollback buffer. the progress should be hidden by default, and only be displayed when some argument flag is given.

Describe the solution you'd like

do not show the download progress by default while pulling images.

only show it if explicitly requested. maybe with --verbose.

Additional context

No response

rgl avatar Jan 20 '24 14:01 rgl

hello,I pushed this pr to meet this requirement.https://github.com/containerd/containerd/pull/9672

jokemanfire avatar Jan 23 '24 02:01 jokemanfire

Is the output being displayed because the following condition should only be enabled when debug mode is turned on? if so, the following condition should drop the not/! condition?

https://github.com/containerd/containerd/blob/be9336fed1a2e5570061da2998a201b111cf22c5/cmd/ctr/commands/content/fetch.go#L134-L136

rgl avatar Jan 23 '24 06:01 rgl

I think the original purpose is to avoid printing data during debugging. Maybe it is incorrect to modify this code directly.

jokemanfire avatar Jan 23 '24 07:01 jokemanfire

Please note that ctr is an unsupported development-focused tool and is not recommended as a general-purpose client.

If you wish to suppress the output, how about redirecting to /dev/null? ctr i pull $IMAGE >/dev/null

samuelkarp avatar Jan 23 '24 08:01 samuelkarp

Please note that ctr is an unsupported development-focused tool and is not recommended as a general-purpose client.

If you wish to suppress the output, how about redirecting to /dev/null? ctr i pull $IMAGE >/dev/null

thank you for your patience, I've got it . (〃'▽'〃)

jokemanfire avatar Jan 23 '24 11:01 jokemanfire

@samuelkarp Indeed. It's somewhat unsupported, I only use it to fiddle with containerd in a lab scenario. Thou, I hope that improving it a bit is something that is welcomed.

Redirecting the whole output is not what I had in mind. Only the progress is bothering me, because it uses too much space to show something that is not that useful.

rgl avatar Jan 23 '24 14:01 rgl

Have you looked at nerdctl ?

mxpv avatar Feb 21 '24 21:02 mxpv