Add progress bar to docker load
Signed-off-by: Lei Jitang <leijitang@huawei.com> Upstream-commit: fae09e25698006a190d14fe64f1576f68431fabf Component: engine
This commit is contained in:
@ -19,6 +19,7 @@ import (
|
||||
func (cli *DockerCli) CmdLoad(args ...string) error {
|
||||
cmd := Cli.Subcmd("load", nil, Cli.DockerCommands["load"].Description, true)
|
||||
infile := cmd.String([]string{"i", "-input"}, "", "Read from a tar archive file, instead of STDIN")
|
||||
quiet := cmd.Bool([]string{"q", "-quiet"}, false, "Suppress the load output")
|
||||
cmd.Require(flag.Exact, 0)
|
||||
cmd.ParseFlags(args, true)
|
||||
|
||||
@ -31,8 +32,10 @@ func (cli *DockerCli) CmdLoad(args ...string) error {
|
||||
defer file.Close()
|
||||
input = file
|
||||
}
|
||||
|
||||
response, err := cli.client.ImageLoad(context.Background(), input, true)
|
||||
if !cli.isTerminalOut {
|
||||
*quiet = true
|
||||
}
|
||||
response, err := cli.client.ImageLoad(context.Background(), input, *quiet)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user