Skip to content

Commit ea48480

Browse files
x0rwndeloof
authored andcommitted
Restore images format list format behaviour
Signed-off-by: x0rw <mahdi.svt5@gmail.com>
1 parent 8151b59 commit ea48480

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/compose/images.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ func runImages(ctx context.Context, dockerCli command.Cli, backend api.Service,
8787
}
8888
return nil
8989
}
90+
if opts.Format == "json" {
91+
// Convert map to slice
92+
var imageList []api.ImageSummary
93+
for _, img := range images {
94+
imageList = append(imageList, img)
95+
}
96+
return formatter.Print(imageList, opts.Format, dockerCli.Out(), nil)
97+
}
9098

9199
return formatter.Print(images, opts.Format, dockerCli.Out(),
92100
func(w io.Writer) {

0 commit comments

Comments
 (0)