diff --git a/engine/swarm/services.md b/engine/swarm/services.md index 44ac1cd0a6..4a42094b15 100644 --- a/engine/swarm/services.md +++ b/engine/swarm/services.md @@ -879,18 +879,8 @@ $ docker service create \ ``` -> **Important:** If your volume driver accepts a comma-separated list as an option, -> you must escape the value from the outer CSV parser. To escape a `volume-opt`, -> surround it with double quotes (`"`) and surround the entire mount parameter -> with single quotes (`'`). -> -> For example, the `local` driver accepts mount options as a comma-separated -> list in the `o` parameter. This example shows the correct way to escape the list. -> -> $ docker service create \ -> --mount 'type=volume,src=,dst=,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:,"volume-opt=o=addr=,vers=4,soft,timeo=180,bg,tcp,rw"' -> --name myservice \ -> +For more information on how to create data volumes and the use of volume +drivers, see [Use volumes](/storage/volumes/). #### Bind mounts diff --git a/storage/volumes.md b/storage/volumes.md index 477851d3aa..a156664858 100644 --- a/storage/volumes.md +++ b/storage/volumes.md @@ -81,6 +81,23 @@ If you need to specify volume driver options, you must use `--mount`. - The `volume-opt` option, which can be specified more than once, takes a key-value pair consisting of the option name and its value. +> Escape values from outer CSV parser +> +> If your volume driver accepts a comma-separated list as an option, +> you must escape the value from the outer CSV parser. To escape a `volume-opt`, +> surround it with double quotes (`"`) and surround the entire mount parameter +> with single quotes (`'`). +> +> For example, the `local` driver accepts mount options as a comma-separated +> list in the `o` parameter. This example shows the correct way to escape the list. +> +> $ docker service create \ +> --mount 'type=volume,src=,dst=,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:,"volume-opt=o=addr=,vers=4,soft,timeo=180,bg,tcp,rw"' +> --name myservice \ +> +> {: .warning} + + The examples below show both the `--mount` and `-v` syntax where possible, and `--mount` is presented first.