docker/cli ยท error

--format is not yet supported with --tree

Error message

--format is not yet supported with --tree

What it means

--format lets users template `docker image ls` output with Go templates or select json/table output, which is driven by the formatter package over flat image rows. The tree view builds hierarchical multi-platform output outside that formatter pipeline, so custom formats cannot be applied to it; shouldUseTree rejects the combination as 'not yet supported'.

Source

Thrown at cli/command/image/list.go:170

			return false, errors.New("--quiet is not yet supported with --tree")
		}
		return false, nil
	}
	if options.noTrunc {
		if options.tree {
			return false, errors.New("--no-trunc is not yet supported with --tree")
		}
		return false, nil
	}
	if options.showDigests {
		if options.tree {
			return false, errors.New("--show-digest is not yet supported with --tree")
		}
		return false, nil
	}
	if options.format != "" {
		if options.tree {
			return false, errors.New("--format is not yet supported with --tree")
		}
		return false, nil
	}
	return true, nil
}

// isDangling is a copy of [formatter.isDangling].
func isDangling(img image.Summary) bool {
	if len(img.RepoTags) == 0 {
		return true
	}
	return len(img.RepoTags) == 1 && img.RepoTags[0] == "<none>:<none>" && len(img.RepoDigests) == 1 && img.RepoDigests[0] == "<none>@<none>"
}

// printAmbiguousHint prints an informational warning if the provided filter
// argument is ambiguous.
//
// The "docker images" top-level subcommand predates the "docker <object> <verb>"

View on GitHub (pinned to e9452d6e78)

Solutions

  1. Drop --tree when you need formatted/machine-readable output: `docker image ls --format json`.
  2. Drop --format to see the tree: `docker image ls --tree`.
  3. Check ~/.docker/config.json for an 'imagesFormat' entry if the error appears without an explicit --format flag, and remove it or override with --format table.

Example fix

# before
docker image ls --tree --format json
# after
docker image ls --format json

When it happens

Trigger: Running `docker image ls --tree --format '{{.Repository}}'` or `--tree --format json`; shouldUseTree returns the error whenever options.format is non-empty and options.tree is set. A `formatter.ImagesFormat` set in the CLI config file combined with --tree can trigger it without any --format flag on the command line, depending on how format is resolved.

Common situations: Scripts consuming `--format json` output hitting a user alias that adds --tree; users with imagesFormat configured in ~/.docker/config.json enabling tree mode; attempts to get machine-readable output of the multi-platform tree.

Related errors


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/e331ddab0ab08dea.json. Report an issue: GitHub.