mirror of
https://github.com/docker/compose.git
synced 2025-07-06 13:24:25 +02:00
Update documentation for volume_driver option.
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
d5514965d5
commit
176b966486
@ -582,10 +582,11 @@ limit as an integer or soft/hard limits as a mapping.
|
|||||||
### volumes, volume\_driver
|
### volumes, volume\_driver
|
||||||
|
|
||||||
Mount paths or named volumes, optionally specifying a path on the host machine
|
Mount paths or named volumes, optionally specifying a path on the host machine
|
||||||
(`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`). Named volumes can
|
(`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`).
|
||||||
be specified with the
|
For [version 2 files](#version-2), named volumes need to be specified with the
|
||||||
[top-level `volumes` key](#volume-configuration-reference), but this is
|
[top-level `volumes` key](#volume-configuration-reference).
|
||||||
optional - the Docker Engine will create the volume if it doesn't exist.
|
When using [version 1](#version-1), the Docker Engine will create the named
|
||||||
|
volume automatically if it doesn't exist.
|
||||||
|
|
||||||
You can mount a relative path on the host, which will expand relative to
|
You can mount a relative path on the host, which will expand relative to
|
||||||
the directory of the Compose configuration file being used. Relative paths
|
the directory of the Compose configuration file being used. Relative paths
|
||||||
@ -607,11 +608,16 @@ should always begin with `.` or `..`.
|
|||||||
# Named volume
|
# Named volume
|
||||||
- datavolume:/var/lib/mysql
|
- datavolume:/var/lib/mysql
|
||||||
|
|
||||||
If you use a volume name (instead of a volume path), you may also specify
|
If you do not use a host path, you may specify a `volume_driver`.
|
||||||
a `volume_driver`.
|
|
||||||
|
|
||||||
volume_driver: mydriver
|
volume_driver: mydriver
|
||||||
|
|
||||||
|
Note that for [version 2 files](#version-2), this driver
|
||||||
|
will not apply to named volumes (you should use the `driver` option when
|
||||||
|
[declaring the volume](#volume-configuration-reference) instead).
|
||||||
|
For [version 1](#version-1), both named volumes and container volumes will
|
||||||
|
use the specified driver.
|
||||||
|
|
||||||
> Note: No path expansion will be done if you have also specified a
|
> Note: No path expansion will be done if you have also specified a
|
||||||
> `volume_driver`.
|
> `volume_driver`.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user