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
Brian Goff 0e8e8f0f31 Add support for metrics plugins
Allows for a plugin type that can be used to scrape metrics.
This is useful because metrics are not neccessarily at a standard
location... `--metrics-addr` must be set, and must currently be a TCP
socket.
Even if metrics are done via a unix socket, there's no guarentee where
the socket may be located on the system, making bind-mounting such a
socket into a container difficult (and racey, failure-prone on daemon
restart).

Metrics plugins side-step this issue by always listening on a unix
socket and then bind-mounting that into a known path in the plugin
container.

Note there has been similar work in the past (and ultimately punted at
the time) for consistent access to the Docker API from within a
container.

Why not add metrics to the Docker API and just provide a plugin with
access to the Docker API? Certainly this can be useful, but gives a lot
of control/access to a plugin that may only need the metrics. We can
look at supporting API plugins separately for this reason.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-05-12 00:30:09 -04:00

3.6 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:
  -f, --filter filter   Provide filter values (e.g. 'enabled=true')
      --format string   Pretty-print plugins using a Go template
      --help            Print usage
      --no-trunc        Don't truncate output
  -q, --quiet           Only display plugin IDs

Description

Lists all the plugins that are currently installed. You can install plugins using the docker plugin install command. You can also filter using the -f or --filter flag. Refer to the filtering section for more information about available filter options.

Examples

$ docker plugin ls

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

Filtering

The filtering flag (-f or --filter) format is of "key=value". If there is more than one filter, then pass multiple flags (e.g., --filter "foo=bar" --filter "bif=baz")

The currently supported filters are:

  • enabled (boolean - true or false, 0 or 1)
  • capability (string - currently volumedriver, networkdriver, ipamdriver, logdriver, metricscollector, or authz)

enabled

The enabled filter matches on plugins enabled or disabled.

capability

The capability filter matches on plugin capabilities. One plugin might have multiple capabilities. Currently volumedriver, networkdriver, ipamdriver, logdriver, metricscollector, and authz are supported capabilities.

$ docker plugin install --disable tiborvass/no-remove

tiborvass/no-remove

$ docker plugin ls --filter enabled=true

NAME                  TAG                 DESCRIPTION                ENABLED

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
.PluginReference The reference used to push/pull from a registry

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