DockerCLI/cli
Sebastiaan van Stijn 1fdbd6181e
docker ps: add State field to formatting
The State field allows printing the container state without
additional information about uptime, healthcheck, etc.

With this patch, the container's state can be printed independently:

```bash
docker ps -a --format '{{.State}}'
running
paused
exited
created
```

```bash
docker ps -a --format 'table {{.Names}}\t{{.State}}\t{{.Status}}'
NAMES                     STATE               STATUS
elastic_burnell           running             Up About a minute
pausie                    paused              Up 5 minutes (Paused)
peaceful_stonebraker      exited              Exited (0) 10 hours ago
vigilant_shaw             created             Created
```

```bash
docker ps -a --format 'raw'

container_id: 0445f73f3a71
image: docker-cli-dev
command: "ash"
created_at: 2019-07-12 11:16:11 +0000 UTC
state: running
status: Up 2 minutes
names: elastic_burnell
labels:
ports:

container_id: 1aff69a3912c
image: nginx:alpine
command: "nginx -g 'daemon of ..."
created_at: 2019-07-12 11:12:10 +0000 UTC
state: paused
status: Up 6 minutes (Paused)
names: pausie
labels: maintainer=NGINX Docker Maintainers <docker-maint@nginx.com>
ports: 80/tcp

container_id: d48acf66c318
image: alpine:3.9.3
command: "id -u"
created_at: 2019-07-12 00:52:17 +0000 UTC
state: exited
status: Exited (0) 10 hours ago
names: peaceful_stonebraker
labels:
ports:

container_id: a0733fe0dace
image: b7b28af77ffe
command: "/bin/sh -c '#(nop) ..."
created_at: 2019-07-12 00:51:29 +0000 UTC
state: created
status: Created
names: vigilant_shaw
labels:
ports:
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-07-12 13:31:16 +02:00
..
command docker ps: add State field to formatting 2019-07-12 13:31:16 +02:00
compose Detect Windows absolute paths on non-Windows CLI 2019-07-10 21:25:03 +02:00
config cli-plugins: alias an existing allowed command (only builder for now) 2019-04-19 01:26:45 +00:00
connhelper commandconn: set SysProcAttr.Setsid 2019-03-06 13:22:54 +09:00
context Fix detection of invalid context files when importing 2019-06-06 09:56:40 +02:00
debug updated vendoring 2017-09-01 19:41:06 -04:00
flags Introduce docker context store 2019-01-04 17:06:51 +01:00
manifest Fix some spelling errors 2019-01-11 15:49:02 +08:00
registry/client cli/registry: fix a Debugf statement 2018-10-11 01:13:13 -07:00
streams Extract streams helpers from command package to their own package to remove a cyclic dependency from command to internal/containerizedengine 2019-01-28 14:36:00 +01:00
trust Update tests to use gotest.tools 👼 2018-06-08 18:24:26 +02:00
version Move versioning variables to a separate package. 2019-01-29 11:26:40 +00:00
winresources Add windows resources to binary. 2017-05-15 18:03:03 -04:00
cobra.go cli-plugins: Reinstate deprecated `-h` short form of `--help`. 2019-03-28 17:18:20 +00:00
cobra_test.go Refactor plugins' vendor location on --help 2019-02-21 17:54:11 +01:00
error.go Import docker/docker/cli 2017-04-17 17:40:59 -04:00
required.go Singularize / pluralize "argument(s)" in error message 2017-08-12 18:25:38 +02:00
required_test.go Update tests to use gotest.tools 👼 2018-06-08 18:24:26 +02:00