Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cmd/compose/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ func runImages(ctx context.Context, dockerCli command.Cli, backend api.Service,
}
return nil
}
if opts.Format == "json" {
// Convert map to slice
var imageList []api.ImageSummary
for _, img := range images {
imageList = append(imageList, img)
}
return formatter.Print(imageList, opts.Format, dockerCli.Out(), nil)
}

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