1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/docs/reference/commandline/plugin_ls.md
Yong Tang 1c0d37fa7f Add --format flag for docker plugin ls
This fix tries to address the enhancement discussed in 28735 to add
`--format` for the output of `docker plugin ls`.

This fix
1. Add `--format` and `--quiet` flags to `docker plugin ls`
2. Convert the current implementation to use `formatter`, consistent with
   other docker list commands.
3. Add `pluginsFormat` for config.json.

Related docs has been updated.

Several unit tests have been added to cover the changes.

This fix is related to 28708 and 28735.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-01-20 15:59:44 -08:00

2.3 KiB

title description keywords
plugin ls The plugin ls command description and usage plugin, list

plugin ls

Usage:  docker plugin ls [OPTIONS]

List plugins

Aliases:
  ls, list

Options:
      --format string   Pretty-print plugins using a Go template
      --help            Print usage
      --no-trunc        Don't truncate output
  -q, --quiet           Only display plugin IDs

Lists all the plugins that are currently installed. You can install plugins using the docker plugin install command.

Example output:

$ docker plugin ls

ID                  NAME                             TAG                 DESCRIPTION                ENABLED
69553ca1d123        tiborvass/sample-volume-plugin   latest              A test plugin for Docker   true

Formatting

The formatting options (--format) pretty-prints plugins output using a Go template.

Valid placeholders for the Go template are listed below:

Placeholder Description
.ID Plugin ID
.Name Plugin name
.Description Plugin description
.Enabled Whether plugin is enabled or not

When using the --format option, the plugin ls command will either output the data exactly as the template declares or, when using the table directive, includes column headers as well.

The following example uses a template without headers and outputs the ID and Name entries separated by a colon for all plugins:

$ docker plugin ls --format "{{.ID}}: {{.Name}}"
4be01827a72e: tiborvass/no-remove