2015-06-12 09:25:32 -04:00
<!-- [metadata]>
+++
title = "volume create"
description = "The volume create command description and usage"
keywords = ["volume, create"]
[menu.main]
parent = "smn_cli"
+++
<![end-metadata]-->
# volume create
Usage: docker volume create [OPTIONS]
Create a volume
2015-10-03 11:56:41 -04:00
-d, --driver=local Specify volume driver name
2015-12-23 09:37:06 -05:00
--help Print usage
2015-10-03 11:56:41 -04:00
--name= Specify volume name
-o, --opt=map[] Set driver specific options
2015-06-12 09:25:32 -04:00
2015-09-07 15:16:38 -04:00
Creates a new volume that containers can consume and store data in. If a name is not specified, Docker generates a random name. You create a volume and then configure the container to use it, for example:
2015-06-12 09:25:32 -04:00
2015-11-09 03:17:50 -05:00
$ docker volume create --name hello
hello
$ docker run -d -v hello:/world busybox ls /world
2015-06-12 09:25:32 -04:00
2015-11-04 13:18:42 -05:00
The mount is created inside the container's `/world` directory. Docker does not support relative paths for mount points inside the container.
2015-06-12 09:25:32 -04:00
Multiple containers can use the same volume in the same time period. This is useful if two containers need access to shared data. For example, if one container writes and the other reads the data.
2015-10-04 08:09:51 -04:00
Volume names must be unique among drivers. This means you cannot use the same volume name with two different drivers. If you attempt this `docker` returns an error:
```
2015-10-29 22:48:56 -04:00
A volume named "hello" already exists with the "some-other" driver. Choose a different volume name.
2015-10-04 08:09:51 -04:00
```
If you specify a volume name already in use on the current driver, Docker assumes you want to re-use the existing volume and does not return an error.
2015-06-12 09:25:32 -04:00
## Driver specific options
Some volume drivers may take options to customize the volume creation. Use the `-o` or `--opt` flags to pass driver options:
2015-11-09 03:17:50 -05:00
$ docker volume create --driver fake --opt tardis=blue --opt timey=wimey
2015-06-12 09:25:32 -04:00
These options are passed directly to the volume driver. Options for
different volume drivers may do different things (or nothing at all).
*Note*: The built-in `local` volume driver does not currently accept any options.