mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
add image size to -tree
This commit is contained in:
parent
f1aeac361a
commit
b7d1d35c27
2 changed files with 5 additions and 4 deletions
|
@ -1231,10 +1231,11 @@ func PrintTreeNode(cli *DockerCli, noTrunc *bool, image APIImages, prefix string
|
|||
imageID = utils.TruncateID(image.ID)
|
||||
}
|
||||
|
||||
fmt.Fprintf(cli.out, "%s%s Size: %s (virtual %s)", prefix, imageID, utils.HumanSize(image.Size), utils.HumanSize(image.VirtualSize))
|
||||
if image.RepoTags[0] != "<none>:<none>" {
|
||||
fmt.Fprintf(cli.out, "%s%s Tags: %s\n", prefix, imageID, strings.Join(image.RepoTags, ","))
|
||||
fmt.Fprintf(cli.out, " Tags: %s\n", strings.Join(image.RepoTags, ","))
|
||||
} else {
|
||||
fmt.Fprintf(cli.out, "%s%s\n", prefix, imageID)
|
||||
fmt.Fprint(cli.out, "\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -778,11 +778,11 @@ func TestImagesTree(t *testing.T) {
|
|||
cmdOutput := string(cmdOutputBytes)
|
||||
|
||||
regexpStrings := []string{
|
||||
fmt.Sprintf("└─%s Tags: %s:latest", unitTestImageIDShort, unitTestImageName),
|
||||
fmt.Sprintf("└─%s Size: (\\d+.\\d+ MB) \\(virtual \\d+.\\d+ MB\\) Tags: %s:latest", unitTestImageIDShort, unitTestImageName),
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
"(?m)^ └─[0-9a-f]+",
|
||||
fmt.Sprintf(" └─%s Tags: test:latest", utils.TruncateID(image.ID)),
|
||||
fmt.Sprintf(" └─%s Size: \\d+.\\d+ kB \\(virtual \\d+.\\d+ MB\\) Tags: test:latest", utils.TruncateID(image.ID)),
|
||||
}
|
||||
|
||||
compiledRegexps := []*regexp.Regexp{}
|
||||
|
|
Loading…
Reference in a new issue