2016-10-14 18:30:36 -04:00
|
|
|
---
|
|
|
|
title: "volume inspect"
|
|
|
|
description: "The volume inspect command description and usage"
|
2016-11-03 18:48:30 -04:00
|
|
|
keywords: "volume, inspect"
|
2016-10-14 18:30:36 -04:00
|
|
|
---
|
2015-06-12 09:25:32 -04:00
|
|
|
|
|
|
|
# volume inspect
|
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
```markdown
|
|
|
|
Usage: docker volume inspect [OPTIONS] VOLUME [VOLUME...]
|
2015-06-12 09:25:32 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Display detailed information on one or more volumes
|
2015-06-12 09:25:32 -04:00
|
|
|
|
2016-07-07 14:43:18 -04:00
|
|
|
Options:
|
2016-10-18 06:50:11 -04:00
|
|
|
-f, --format string Format the output using the given Go template
|
2016-07-07 14:43:18 -04:00
|
|
|
--help Print usage
|
|
|
|
```
|
2015-06-12 09:25:32 -04:00
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Description
|
|
|
|
|
2015-06-12 09:25:32 -04:00
|
|
|
Returns information about a volume. By default, this command renders all results
|
2015-11-18 10:02:24 -05:00
|
|
|
in a JSON array. You can specify an alternate format to execute a
|
|
|
|
given template for each result. Go's
|
2021-10-14 18:04:36 -04:00
|
|
|
[text/template](https://golang.org/pkg/text/template/) package describes all the
|
2015-06-12 09:25:32 -04:00
|
|
|
details of the format.
|
|
|
|
|
2017-02-07 18:42:48 -05:00
|
|
|
## Examples
|
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2020-05-11 11:32:52 -04:00
|
|
|
$ docker volume create myvolume
|
2020-04-19 09:43:08 -04:00
|
|
|
|
2020-05-11 11:32:52 -04:00
|
|
|
myvolume
|
|
|
|
```
|
|
|
|
|
|
|
|
Use the `docker volume inspect` comment to inspect the configuration of the volume:
|
2020-04-19 09:43:08 -04:00
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2020-05-11 11:32:52 -04:00
|
|
|
$ docker volume inspect myvolume
|
|
|
|
```
|
2020-04-19 09:43:08 -04:00
|
|
|
|
2020-05-11 11:32:52 -04:00
|
|
|
The output is in JSON format, for example:
|
|
|
|
|
|
|
|
```json
|
2017-02-07 18:42:48 -05:00
|
|
|
[
|
|
|
|
{
|
2020-04-19 09:43:08 -04:00
|
|
|
"CreatedAt": "2020-04-19T11:00:21Z",
|
|
|
|
"Driver": "local",
|
|
|
|
"Labels": {},
|
|
|
|
"Mountpoint": "/var/lib/docker/volumes/8140a838303144125b4f54653b47ede0486282c623c3551fbc7f390cdc3e9cf5/_data",
|
2020-05-11 11:32:52 -04:00
|
|
|
"Name": "myvolume",
|
2020-04-19 09:43:08 -04:00
|
|
|
"Options": {},
|
|
|
|
"Scope": "local"
|
2017-02-07 18:42:48 -05:00
|
|
|
}
|
|
|
|
]
|
2020-05-11 11:32:52 -04:00
|
|
|
```
|
2021-08-21 08:54:14 -04:00
|
|
|
|
2023-01-06 13:28:29 -05:00
|
|
|
### <a name="format"></a> Format the output (--format)
|
2022-03-30 09:05:29 -04:00
|
|
|
|
2020-05-11 11:32:52 -04:00
|
|
|
Use the `--format` flag to format the output using a Go template, for example,
|
|
|
|
to print the `Mountpoint` property:
|
2017-02-07 18:42:48 -05:00
|
|
|
|
2021-08-21 08:54:14 -04:00
|
|
|
```console
|
2020-05-11 11:32:52 -04:00
|
|
|
$ docker volume inspect --format '{{ .Mountpoint }}' myvolume
|
2020-04-19 09:43:08 -04:00
|
|
|
|
2020-05-11 11:32:52 -04:00
|
|
|
/var/lib/docker/volumes/myvolume/_data
|
2017-02-07 18:42:48 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
## Related commands
|
2016-02-18 14:52:15 -05:00
|
|
|
|
|
|
|
* [volume create](volume_create.md)
|
|
|
|
* [volume ls](volume_ls.md)
|
|
|
|
* [volume rm](volume_rm.md)
|
2016-10-18 06:50:11 -04:00
|
|
|
* [volume prune](volume_prune.md)
|
2020-04-19 09:43:08 -04:00
|
|
|
* [Understand Data Volumes](https://docs.docker.com/storage/volumes/)
|