'docker compose ps' not honoring 'psFormat' setting in '.docker/config.json' · Issue #13643 · docker/compose · GitHub
Skip to content

'docker compose ps' not honoring 'psFormat' setting in '.docker/config.json' #13643

Closed

Description

@FlorianFritz

Hi,

I tried to change the default output table of the docker compose ps command to match my docker ps output.

Running

docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"

creates the table I want. Setting the psFormat key in my .docker/config.json

{
  "psFormat": "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"
}

results in docker ps showing this table by default, as desired.

Using the same format argument on docker compose ps

docker compose ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"

results in the correct table.

But docker compose ps does not use this setting as its default.

When looking for the correct key for my .docker/config.json I found that in /cmd/compose/ps.go on Line 156

compose/cmd/compose/ps.go

Lines 155 to 157 in e8c2143

docker compose ps checks for the same psFormat key in the config, but it is only applied when --format is set to an empty sting:

This means

docker compose ps --format ""

results in the same output as

docker compose ps --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}"

but not

docker compose ps

Maybe the check in L155 should use the same code as the docker cli for determining the format:

format := options.format
if len(format) == 0 {
	format = task.DefaultFormat(dockerCLI.ConfigFile(), options.quiet)
}

https://github.com/docker/cli/blob/743c385f784e10c9cd29a2800fb72901bec053d4/cli/command/node/ps.go#L87-L90

Activity

  1. changed the title [-]'docker compose ps' not honorig 'psFormat' setting in '.docker/config.json'[/-] [+]'docker compose ps' not honoring 'psFormat' setting in '.docker/config.json'[/+] on Mar 18, 2026
  2. ndeloof commented on Mar 18, 2026

    @ndeloof
    Contributor

    One challenge to consider is that, doing so, compose ps will not display service name for a container

  3. added 2 commits that reference this issue on Mar 18, 2026
    7a5682b
    c5cc6e6
  4. added a commit that references this issue on Aug 12, 2026
    e2598bd
  5. added a commit that references this issue on Aug 20, 2026
    0aaa84f
  6. added a commit that references this issue on Aug 20, 2026
    3a62ae6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions