Commit 38b0f84
committed
Add "platform" column to docker ps
With this change:
docker create armhf/hello-world
docker create hello-world
docker ps -a
CONTAINER ID IMAGE PLATFORM COMMAND CREATED STATUS PORTS NAMES
a020fcae5f4d hello-world linux/amd64 "/hello" 5 seconds ago Exited (0) 3 seconds ago vigorous_yalow
499a18874987 armhf/hello-world linux/arm64 "/hello" 58 seconds ago Exited (0) 57 seconds ago hardcore_brown
docker ps -a --format=raw
container_id: a020fcae5f4d
image: hello-world
platform: linux/amd64
command: "/hello"
created_at: 2021-07-05 07:08:19 +0000 UTC
state: exited
status: Exited (0) About an hour ago
names: vigorous_yalow
labels:
ports:
container_id: 499a18874987
image: armhf/hello-world
platform: linux/arm64
command: "/hello"
created_at: 2021-07-05 07:07:26 +0000 UTC
state: exited
status: Exited (0) About an hour ago
names: hardcore_brown
labels:
ports:
docker ps -a --format '{{json .}}' | jq .
{
"Command": "\"/hello\"",
"CreatedAt": "2021-07-05 07:08:19 +0000 UTC",
"ID": "a020fcae5f4d",
"Image": "hello-world",
"Labels": "",
"LocalVolumes": "0",
"Mounts": "",
"Names": "vigorous_yalow",
"Networks": "bridge",
"Platform": "linux/amd64",
"Ports": "",
"RunningFor": "52 seconds ago",
"Size": "0B (virtual 13.3kB)",
"State": "exited",
"Status": "Exited (0) 51 seconds ago"
}
{
"Command": "\"/hello\"",
"CreatedAt": "2021-07-05 07:07:26 +0000 UTC",
"ID": "499a18874987",
"Image": "armhf/hello-world",
"Labels": "",
"LocalVolumes": "0",
"Mounts": "",
"Names": "hardcore_brown",
"Networks": "bridge",
"Platform": "linux/arm64",
"Ports": "",
"RunningFor": "About a minute ago",
"Size": "0B (virtual 1.64kB)",
"State": "exited",
"Status": "Exited (0) About a minute ago"
}
To be discussed: what should the presentation be of platform if an "os variant" is present?
For example (from `docker manifest inspect hello-world`);
```json
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 1125,
"digest": "sha256:90e120baffe5afa60dd5a24abcd051db49bd6aee391174da5e825ee6ee5a12a0",
"platform": {
"architecture": "amd64",
"os": "windows",
"os.version": "10.0.17763.1999"
}
}
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>1 parent 79f4224 commit 38b0f84
File tree
4 files changed
+84
-73
lines changed- cli/command/formatter
- docs/reference/commandline
- man/src/container
4 files changed
+84
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
| |||
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
0 commit comments