From 6387822594b3eef73595510111c92bb66de63e48 Mon Sep 17 00:00:00 2001 From: Nicola Kabar Date: Wed, 29 Jun 2016 18:11:41 -0700 Subject: [PATCH] [Docs] clarified local volume driver docs Signed-off-by: Nico (cherry picked from commit 841f9859944250585b2adf2c9bf2ad5332ccc0bd) Signed-off-by: Tibor Vass --- docs/reference/commandline/volume_create.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/reference/commandline/volume_create.md b/docs/reference/commandline/volume_create.md index 3e69b79864..e1f642fbf7 100644 --- a/docs/reference/commandline/volume_create.md +++ b/docs/reference/commandline/volume_create.md @@ -54,17 +54,24 @@ different volume drivers may do different things (or nothing at all). The built-in `local` driver on Windows does not support any options. -The built-in `local` driver on Linux accepts options similar to the linux `mount` -command: +The built-in `local` driver on Linux accepts options similar to the linux `mount` command. You can provide multiple options by passing the `--opt` flag multiple times. Some `mount` options (such as the `o` option) can take a comma-separated list of options. Complete list of available mount options can be found [here](http://man7.org/linux/man-pages/man8/mount.8.html). + +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 +$ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 --name foo ``` -Another example: +Another example that uses `btrfs`: ```bash -$ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 +$ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 --name 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 ```