Add option to specify name without --name in volume create

Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
This commit is contained in:
Kara Alexandra 2016-06-14 15:42:30 -07:00 committed by Tibor Vass
parent a2b443d1df
commit 4594e5d50e
2 changed files with 9 additions and 10 deletions

View File

@ -11,7 +11,7 @@ parent = "smn_cli"
# volume create # volume create
```markdown ```markdown
Usage: docker volume create [OPTIONS] Usage: docker volume create [OPTIONS] [VOLUME]
Create a volume Create a volume
@ -19,14 +19,13 @@ Options:
-d, --driver string Specify volume driver name (default "local") -d, --driver string Specify volume driver name (default "local")
--help Print usage --help Print usage
--label value Set metadata for a volume (default []) --label value Set metadata for a volume (default [])
--name string Specify volume name
-o, --opt value Set driver specific options (default map[]) -o, --opt value Set driver specific options (default map[])
``` ```
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: 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:
```bash ```bash
$ docker volume create --name hello $ docker volume create hello
hello hello
$ docker run -d -v hello:/world busybox ls /world $ docker run -d -v hello:/world busybox ls /world
@ -62,19 +61,19 @@ The built-in `local` driver on Linux accepts options similar to the linux `mount
For example, the following creates a `tmpfs` volume called `foo` with a size of 100 megabyte and `uid` of 1000. For example, the following creates a `tmpfs` volume called `foo` with a size of 100 megabyte and `uid` of 1000.
```bash ```bash
$ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 --name foo $ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 foo
``` ```
Another example that uses `btrfs`: Another example that uses `btrfs`:
```bash ```bash
$ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 --name foo $ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 foo
``` ```
Another example that uses `nfs` to mount the `/path/to/dir` in `rw` mode from `192.168.1.1`: Another example that uses `nfs` to mount the `/path/to/dir` in `rw` mode from `192.168.1.1`:
```bash ```bash
$ docker volume create --driver local --opt type=nfs --opt o=addr=192.168.1.1,rw --opt device=:/path/to/dir --name foo $ docker volume create --driver local --opt type=nfs --opt o=addr=192.168.1.1,rw --opt device=:/path/to/dir foo
``` ```

View File

@ -34,9 +34,9 @@ Lists all the volumes Docker knows about. You can filter using the `-f` or `--fi
Example output: Example output:
```bash ```bash
$ docker volume create --name rosemary $ docker volume create rosemary
rosemary rosemary
$docker volume create --name tyler $docker volume create tyler
tyler tyler
$ docker volume ls $ docker volume ls
DRIVER VOLUME NAME DRIVER VOLUME NAME
@ -91,9 +91,9 @@ a `label` and a value.
First, let's create some volumes to illustrate this; First, let's create some volumes to illustrate this;
```bash ```bash
$ docker volume create --name the-doctor --label is-timelord=yes $ docker volume create the-doctor --label is-timelord=yes
the-doctor the-doctor
$ docker volume create --name daleks --label is-timelord=no $ docker volume create daleks --label is-timelord=no
daleks daleks
``` ```