Commit Graph

45 Commits

Author SHA1 Message Date
Forest Johnson f7ab2987c3
Explain -s flag on docker ps
https://github.com/docker/docker.github.io/issues/1520#issuecomment-467971886

Signed-off-by: Forest Johnson <fjohnson@peoplenetonline.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-06 16:27:05 +02:00
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
Frieder Bluemle 45c9b9b6c1
Fix GitHub spelling
Signed-off-by: Frieder Bluemle <frieder.bluemle@gmail.com>
2017-10-05 01:14:31 +08:00
Sebastiaan van Stijn 7ac1db2f8f Merge pull request #393 from thaJeztah/add-missing-is-task-filter
Docs: update filter options for docker container ps
2017-07-31 09:51:13 +01:00
Kir Kolyshkin 6d85a4f5f8 Fix repo references in docs
Since CLI was moved to a separate repo, these references are incorrect.
Fixed with the help of sed script, verified manually.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-07-28 10:32:42 -07:00
Sebastiaan van Stijn 46064f33f4
Docs: update filter options for docker container ps
The `is-task` filter was only documented in the usage
section, but this section is not used in the documentation.

This patch adds the missing filter, synchronises the
man page source, and does some slight rephrasing
and reformatting of the filters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-27 22:10:26 +02:00
Misty Stanley-Jones 0888df3058 Reformat filtering options in ps ref
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-06-21 10:31:03 -07:00
Misty Stanley-Jones 1f531be8ab Fix markdown in references for Kramdown
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-06-02 00:10:57 +00:00
Sebastiaan van Stijn 8e7dd976f8 remove Jekyll tags from CLI reference
These Markdown files are now embedded in a YAML
file for templating in the documentation, and
these special markers are no longer needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-02 00:10:56 +00:00
allencloud 1507e86ada add expose and publish filter in swagger.yml and CLI docs for docker/master
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-06-02 00:10:54 +00:00
allencloud 4113925b25 add missing filter type and sort filter type in alphabets
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-06-02 00:10:53 +00:00
Misty Stanley-Jones ddadd3db49 Standardized formatting of CLI reference commands
Command name should be a H1

Only Description, Examples, and Related Commands should be H2

Changed 'Related information' heading to 'Related commands' since 99% it is only linking commands

Added some examples where relevant

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-06-02 00:10:53 +00:00
Yong Tang aeda99b195 Add `publish` and `expose` filter for `docker ps --filter`
This fix tries to address the enhancement proposal raised in
27178 for filtering based on published or exposed ports of
`docker ps --filter`.

In this fix, two filter options, `publish` and `expose` have
been added to take either `<port>[/<protocol>]` or `<from>-<to>[/<protocol>]`
and filtering on containers.

An integration test has been added to cover the changes.

This fix fixes 27178.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-06-02 00:10:51 +00:00
Gaetan de Villele 572c6bb89a fix frontmatter keywords value type (string, instead of []string) in /docs/reference
Signed-off-by: Gaetan de Villele <gdevillele@gmail.com>
2017-06-02 00:10:31 +00:00
Josh Horwitz dfcd777cbc Adds container health support to docker ps filter
Signed-off-by: Josh Horwitz <horwitzja@gmail.com>
2017-06-02 00:10:30 +00:00
yuexiao-wang 6af33ef099 Fix some typos
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
2017-06-02 00:10:29 +00:00
Kenfe-Mickael Laventure a7124389ed Add Networks placeholder to ps --format
Passing {{.Networks}} to the format parameter will prompt ps to
display all the networks the container is connected to.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-06-02 00:10:26 +00:00
Misty Stanley-Jones 7f36c3a1a0 Sync docker/docker refs with files mistakenly edited in docker.github.io repo
Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-06-02 00:10:26 +00:00
Misty Stanley-Jones 2845676cc2 Convert Markdown frontmatter to YAML
Some frontmatter such as the weights, menu stuff, etc is no longer used
'draft=true' becomes 'published: false'

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
2017-06-02 00:10:24 +00:00
Vincent Demeester cd547751df Add a new "is-task" ps filter
This makes it easier to list containers that are part of a task
(swarm mode) and those who are not.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-02 00:10:12 +00:00
timfeirg 280a6f9663 expose RemovalInProgress in StateString #25652
Signed-off-by: timfeirg <kkcocogogo@gmail.com>
2017-06-02 00:10:06 +00:00
Sebastiaan van Stijn 5a3c9e8c24 Restore missing ps example for killed containers
This example was added in b0b2f979c7c43e2975d5e39340c168da2da42d1d,
but got lost during splitting up the cli.md docs into separate files;
561bfb268de3c674b04d48895b7e46ae890ef795

This restores the missing example.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-02 00:10:05 +00:00
allencloud e5a1e08fa0 update go-units vendor to newest version
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-06-02 00:10:04 +00:00
Sebastiaan van Stijn 458ff79b0d docs: improve formatting and highlighting of docker ps reference
this improves the formatting, and code-highlighting
of the `docker ps` reference page, and wraps sentences
to 80 chars

also adds single quotes around the formatting
example for labels.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-02 00:10:01 +00:00
Vincent Demeester 3ebe3fe752 Updates on cli reference documentation
- Update ps with `--last` flag
- Update commands with current output
- Make sure hugo does not detect the wrong language
- Update usage for `tag` command to be more coherent with the other ones

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-02 00:07:49 +00:00
Sebastiaan van Stijn 44cc95141e add support for filtering by network ID
This adds support for filtering by network ID, to be
consistent with other filter options.

Note that only *full* matches are returned; this is
consistent with other filters (e.g. volume), that
also return full matches only.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-06-02 00:07:42 +00:00
Sainath Grandhi eef6bd0b23 Adding network filter to docker ps command
Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
2017-06-02 00:07:42 +00:00
Kai Qiang Wu(Kennan) 2422bc30f5 Add the missed volume filter
Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2017-06-02 00:07:32 +00:00
David Calavera beb7b68810 Add mounts to docker ps.
- Allow to filter containers by volume with `--filter volume=name` and `filter volume=/dest`.
- Show their names in the list with the custom format `{{ .Mounts }}`.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-06-02 00:07:30 +00:00
Tomasz Kopczynski 680de96eb6 Before and since filters documentation
Signed-off-by: Tomasz Kopczynski <tomek@kopczynski.net.pl>
2017-06-02 00:07:28 +00:00
Kareem Khazem e62e6e8b07 Added `dead` to docs for docker ps -f status=...
It is possible to invoke `docker ps -f status=dead`, but the
documentation for docker-ps does not mention `dead` as a valid option.
This commit fixes that.

Signed-off-by: Kareem Khazem <karkhaz@karkhaz.com>
2017-06-02 00:07:25 +00:00
Wen Cheng Ma 636ffcc028 Improvement for docker subcommand's help messages
Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2017-06-02 00:07:22 +00:00
Doug Davis 421578fbd4 remove =false from options that default to false in the docs
This re-aligns the docs with what the cmd line now does.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2017-06-02 00:07:21 +00:00
Wen Cheng Ma 562c2df97d Re-implement --before and --since as options for --filter
* This commit will mark --before and --since as deprecated, but leave their behavior
  unchanged until they are removed, then re-implement them as options for --filter.

* And update the related docs.

* Update the integration tests.

Fixes issue #17716

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
2017-06-02 00:07:18 +00:00
John Howard 52f5fdafc1 Windows: Add default isolation exec driver option
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-06-02 00:07:16 +00:00
John Howard b6c711690c Windows: Add isolation to ps filter
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-06-02 00:07:15 +00:00
Mary Anthony d45666f869 Fixing issues in command ordering. Adding index.md
Adjust bullets
Entering Seb's comments

Signed-off-by: Mary Anthony <mary@docker.com>
2017-06-02 00:07:11 +00:00
Antonio Murdaca cbd33a2b27 Fix man and commandline docs
- missing help option in `docs/reference/commandline/*.md` (some files
  have it, the other I fixed didn't)
- missing `[OPTIONS]` in Usage description
- missing options
- formatting
- start/stop idempotence

Signed-off-by: Antonio Murdaca <amurdaca@redhat.com>
2017-06-02 00:07:11 +00:00
David Calavera 54a47bdcaa Add missing ps placeholder to the docs.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-06-02 00:07:08 +00:00
Vincent Demeester 67f663c7bf Add 'ancestor' ps filter for image
Makes it possible to filter containers by image, using
--filter=ancestor=busybox and get all the container running busybox
image and image based on busybox (to the bottom).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-02 00:07:07 +00:00
Vincent Demeester 898614f30a Update filtering chapters on ps/images references
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-06-02 00:07:07 +00:00
Brian Goff 1f10226bfd Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-06-02 00:07:07 +00:00
Ed Costello 67f43a0a8b Copy edits for typos
Signed-off-by: Ed Costello <epc@epcostello.com>
2017-06-02 00:07:04 +00:00
Phil Estes 5f2fd60890 ps --format: Add config.js doc, fix gofmt, add integration tests
Re-add the docs from @calavera's PR to the moved cli cmd reference docs.
Fix gofmt and vet issues from carried commits
Add integration test for using format with --no-trunc and multi-names
Fix custom_test map order dependency on expected value check
Add docs to reference/commandline/ps.md
Remove "-F" flag option from original carried PR content

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2017-06-02 00:07:02 +00:00
Mary Anthony 4f9fac3803 Splitting out the cli command into parts.
Signed-off-by: Mary Anthony <mary@docker.com>
2017-06-02 00:06:59 +00:00