docker-cli/docs/reference/commandline/volume_inspect.md
Sebastiaan van Stijn 4d948e468b
docs: more Markdown touch-ups
- replace the "none" code-hint with "console"
- some changes in the "experimental" instructions
- reformat some notes
- reformat / re-indent JSON output to use 2 spaces (for consistency)
- split JSON outputs to separate code-block so that it can be highlighted

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-11 17:32:52 +02:00

1.6 KiB

title, description, keywords
title description keywords
volume inspect The volume inspect command description and usage volume, inspect

volume inspect

Usage:  docker volume inspect [OPTIONS] VOLUME [VOLUME...]

Display detailed information on one or more volumes

Options:
  -f, --format string   Format the output using the given Go template
      --help            Print usage

Description

Returns information about a volume. By default, this command renders all results in a JSON array. You can specify an alternate format to execute a given template for each result. Go's text/template package describes all the details of the format.

Examples

$ docker volume create myvolume

myvolume

Use the docker volume inspect comment to inspect the configuration of the volume:

$ docker volume inspect myvolume

The output is in JSON format, for example:

[
  {
    "CreatedAt": "2020-04-19T11:00:21Z",
    "Driver": "local",
    "Labels": {},
    "Mountpoint": "/var/lib/docker/volumes/8140a838303144125b4f54653b47ede0486282c623c3551fbc7f390cdc3e9cf5/_data",
    "Name": "myvolume",
    "Options": {},
    "Scope": "local"
  }
]

Use the --format flag to format the output using a Go template, for example, to print the Mountpoint property:

$ docker volume inspect --format '{{ .Mountpoint }}' myvolume

/var/lib/docker/volumes/myvolume/_data