From ea48480d809a03e4abe0a81f69be66bf7b85bcd9 Mon Sep 17 00:00:00 2001 From: x0rw Date: Sat, 7 Jun 2025 17:56:41 +0100 Subject: [PATCH] Restore images format list format behaviour Signed-off-by: x0rw --- cmd/compose/images.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/compose/images.go b/cmd/compose/images.go index 458bbccd7..afc22feff 100644 --- a/cmd/compose/images.go +++ b/cmd/compose/images.go @@ -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) {