Hello,
on Ubuntu 22.04.2 LTS, my docker version is: Docker version 23.0.6, build ef23cbc
The command: docker ps -q
shows exactly the same results than docker ps
but I expected it to only shows the container IDs, as explained by the --help
flag:
$ docker ps --help
Usage: docker ps [OPTIONS]
List containers
Aliases:
docker container ls, docker container list, docker container ps, docker ps
Options:
-a, --all Show all containers (default shows just running)
-f, --filter filter Filter output based on conditions provided
--format string Format output using a custom template:
'table': Print output in table format with column headers (default)
'table TEMPLATE': Print output in table format using the given Go template
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
-n, --last int Show n last created containers (includes all states) (default -1)
-l, --latest Show the latest created container (includes all states)
--no-trunc Don't truncate output
-q, --quiet Only display container IDs
-s, --size Display total file sizes
Is this a bug or did I miss something obvious?
It seems to be due to the fact that I have a custom ~/.docker/config.json
with this line in it:
"psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Status}}\\t{{.Ports}}\\t{{.Names}}"
How could I get back the correct behavior of the docker ps
flags when using a custom psFormat?
Thanks.
Warm Regards.