Browse code

intro volume plugins in userguide volumes

NOTE should be lowercase

Signed-off-by: Ryan Wallner <ryan.wallner@clusterhq.com>

add link to list of plugins

Signed-off-by: Ryan Wallner <ryan.wallner@clusterhq.com>

address changres

Signed-off-by: Ryan Wallner <ryan.wallner@clusterhq.com>

Ryan Wallner authored on 2016/02/24 04:43:37
Showing 1 changed files
... ...
@@ -159,6 +159,48 @@ user with access to host and its mounted directory.
159 159
 >should be portable. A host directory wouldn't be available on all potential
160 160
 >hosts.
161 161
 
162
+### Mount a shared-storage volume as a data volume
163
+
164
+In addition to mounting a host directory in your container, some Docker
165
+[volume plugins](../../extend/plugins_volume.md) allow you to 
166
+provision and mount shared storage, such as iSCSI, NFS, or FC.
167
+
168
+A benefit of using shared volumes is that they are host-independent. This
169
+means that a volume can be made available on any host that a container is
170
+started on as long as it has access to the shared storage backend, and has
171
+the plugin installed.
172
+
173
+One way to use volume drivers is through the `docker run` command. 
174
+Volume drivers create volumes by name, instead of by path like in
175
+the other examples.
176
+
177
+The following command creates a named volume, called `my-named-volume`,
178
+using the `flocker` volume driver, and makes it available within the container
179
+at `/opt/webapp`:
180
+
181
+```bash
182
+$ docker run -d -P \
183
+  --volume-driver=flocker \
184
+  -v my-named-volume:/opt/webapp \
185
+  --name web training/webapp python app.py
186
+```
187
+
188
+You may also use the `docker volume create` command, to create a volume before
189
+using it in a container.
190
+
191
+The following example also creates the `my-named-volume` volume, this time
192
+using the `docker volume create` command.
193
+
194
+```bash
195
+$ docker volume create -d flocker --name my-named-volume -o size=20GB
196
+$ docker run -d -P \
197
+  -v my-named-volume:/opt/webapp \
198
+  --name web training/webapp python app.py
199
+```
200
+
201
+A list of available plugins, including volume plugins, is available
202
+[here](../../extend/plugins.md).
203
+
162 204
 ### Volume labels
163 205
 
164 206
 Labeling systems like SELinux require that proper labels are placed on volume