1
0
mirror of https://github.com/docker/cli.git synced 2025-08-29 00:47:54 +03:00
Files
cli/docs/reference/commandline/volume_inspect.md
Djordje Lukic 9c0234bbcb Output compact JSON by default for --format=json
With this change all `inspect` commands will output a compact JSON
representation of the elements, the default format (indented JSON) stays the
same.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-03-15 15:42:35 +01:00

76 lines
1.9 KiB
Markdown

---
title: "volume inspect"
description: "The volume inspect command description and usage"
keywords: "volume, inspect"
---
# volume inspect
```markdown
Usage: docker volume inspect [OPTIONS] VOLUME [VOLUME...]
Display detailed information on one or more volumes
Options:
-f, --format string Format output using a custom template:
'json': Print in JSON format
'TEMPLATE': Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates
--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](https://golang.org/pkg/text/template/) package describes all the
details of the format.
## Examples
```console
$ docker volume create myvolume
myvolume
```
Use the `docker volume inspect` comment to inspect the configuration of the volume:
```console
$ docker volume inspect myvolume
```
The output is in JSON format, for example:
```json
[
{
"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:
```console
$ docker volume inspect --format '{{ .Mountpoint }}' myvolume
/var/lib/docker/volumes/myvolume/_data
```
## Related commands
* [volume create](volume_create.md)
* [volume ls](volume_ls.md)
* [volume rm](volume_rm.md)
* [volume prune](volume_prune.md)
* [Understand Data Volumes](https://docs.docker.com/storage/volumes/)