When I issue the following command
docker ps --no-trunc --format '{"name":"{{.Names}}", "status":"{{.Status}}"}'
I get output such as:
{"name": "container1", "status": "Up 10 hours"}
{"name": "container2", "status": "Up 10 hours"}
Each of these line is a valid JSON object, but I am lazy and want the whole output to be a valid JSON which represents a list of dictionaries:
[
{"name": "container1", "status": "Up 10 hours"},
{"name": "container2", "status": "Up 10 hours"}
]
Is there a way for the docker ps command to output in that format?