Merge pull request #23830 from ardnaxelarak/23345_remove_name_from_volume_create

remove --name flag from volume create
Upstream-commit: 5168c93419547338b11f5d24d24a2a025ea64524
Component: engine
This commit is contained in:
Vincent Demeester
2016-08-26 21:52:07 +02:00
committed by GitHub
12 changed files with 78 additions and 62 deletions

View File

@ -11,7 +11,7 @@ parent = "smn_cli"
# volume create
```markdown
Usage: docker volume create [OPTIONS]
Usage: docker volume create [OPTIONS] [VOLUME]
Create a volume
@ -19,14 +19,13 @@ Options:
-d, --driver string Specify volume driver name (default "local")
--help Print usage
--label value Set metadata for a volume (default [])
--name string Specify volume name
-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:
```bash
$ docker volume create --name hello
$ docker volume create hello
hello
$ 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.
```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`:
```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`:
```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:
```bash
$ docker volume create --name rosemary
$ docker volume create rosemary
rosemary
$docker volume create --name tyler
$docker volume create tyler
tyler
$ docker volume ls
DRIVER VOLUME NAME
@ -91,9 +91,9 @@ a `label` and a value.
First, let's create some volumes to illustrate this;
```bash
$ docker volume create --name the-doctor --label is-timelord=yes
$ docker volume create the-doctor --label is-timelord=yes
the-doctor
$ docker volume create --name daleks --label is-timelord=no
$ docker volume create daleks --label is-timelord=no
daleks
```