I noticed this a couple of times, but didn't open an issue yet; when using the --format option on commands, and requesting json output, the values included in the output should output the raw values, not the formatted output as is used in other formats.
For example:
$ docker ps --format '{{json .}}' | jq .
{
"Command": "\"nginx -g 'daemon of…\"",
"CreatedAt": "2017-11-07 13:30:41 +0100 CET",
"ID": "6f02a463250c",
"Image": "nginx:alpine",
"Labels": "com.docker.swarm.task=,com.docker.swarm.task.id=gwbj2pzql8r6ovcyw2s61piyy,com.docker.swarm.task.name=myservice.1.gwbj2pzql8r6ovcyw2s61piyy,maintainer=NGINX Docker Maintainers <[email protected]>,com.docker.swarm.node.id=url9rx710g8azgnhpmpr9hqfl,com.docker.swarm.service.id=2plef0c7wdya64ball1an4u2j,com.docker.swarm.service.name=myservice",
"LocalVolumes": "0",
"Mounts": "",
"Names": "myservice.1.gwbj2pzql8r6ovcyw2s61piyy",
"Networks": "one",
"Ports": "80/tcp",
"RunningFor": "3 minutes ago",
"Size": "0B",
"Status": "Up 4 minutes"
}
The RunningFor, Size, and Status output should print the "raw" information as obtained from the container, and ID should show the un-truncated ID.
Perhaps not the best example, as RunningFor is a calculated value, but opening this for discussion.
I noticed this a couple of times, but didn't open an issue yet; when using the
--formatoption on commands, and requestingjsonoutput, the values included in the output should output the raw values, not the formatted output as is used in other formats.For example:
{ "Command": "\"nginx -g 'daemon of…\"", "CreatedAt": "2017-11-07 13:30:41 +0100 CET", "ID": "6f02a463250c", "Image": "nginx:alpine", "Labels": "com.docker.swarm.task=,com.docker.swarm.task.id=gwbj2pzql8r6ovcyw2s61piyy,com.docker.swarm.task.name=myservice.1.gwbj2pzql8r6ovcyw2s61piyy,maintainer=NGINX Docker Maintainers <[email protected]>,com.docker.swarm.node.id=url9rx710g8azgnhpmpr9hqfl,com.docker.swarm.service.id=2plef0c7wdya64ball1an4u2j,com.docker.swarm.service.name=myservice", "LocalVolumes": "0", "Mounts": "", "Names": "myservice.1.gwbj2pzql8r6ovcyw2s61piyy", "Networks": "one", "Ports": "80/tcp", "RunningFor": "3 minutes ago", "Size": "0B", "Status": "Up 4 minutes" }The
RunningFor,Size, andStatusoutput should print the "raw" information as obtained from the container, andIDshould show the un-truncated ID.Perhaps not the best example, as
RunningForis a calculated value, but opening this for discussion.