Kevin
Kevin

Reputation: 76

Docker command options --format not working

I need docker ps output in JSON format. I've been trying:

$ docker ps --format '{{json .}}'
{}
$ docker ps --format='{{json .}}'
{}
$ docker ps --format json
json

When I try with specific parameters, it works: docker ps --format '{{json .Names}}' returns the name.

I have several machines. Sometimes it works sometimes it doesn't.

Upvotes: 0

Views: 605

Answers (1)

BMitch
BMitch

Reputation: 264306

Docker 1.12.6 is rather old and unsupported. It appears this was added in 1.13: https://github.com/moby/moby/issues/20625#issuecomment-269989174

The current release is 19.03.5 and anything before docker-ce 19.03 is out of support (unless you have an Enterprise release).

Upvotes: 3

Related Questions