Skip to content

Commit d93316c

Browse files
author
carabasdaniel
authored
Merge pull request #480 from benningm/master
Update docker volume documentation
2 parents a77179b + d7473eb commit d93316c

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,24 +540,41 @@ docker_volume { 'my-volume':
540540
}
541541
```
542542

543+
Additional mount options can be passed to the `local` driver. For mounting a NFS export use:
544+
545+
```puppet
546+
docker_volume { 'nfs-volume':
547+
ensure => present,
548+
driver => 'local',
549+
options => {
550+
type => 'nfs4',
551+
o => 'addr=10.10.10.10,rw',
552+
device => ':/exports/data'
553+
},
554+
}
555+
```
556+
543557
The name value and the `ensure` parameter are required. If you do not include the `driver` value, the default `local` is used.
544558

545559
If using Hiera, configure the `docker::volumes` class in the manifest file:
546560

547561
```yaml
548562
---
549563
classes:
550-
- docker::volumes::volumes
564+
- docker::volumes
551565
552-
docker::volumes::volumes:
566+
docker::volumes:
553567
blueocean:
554568
ensure: present
555569
driver: local
556570
options:
557-
- ['type=nfs','o=addr=%{custom_manager},rw','device=:/srv/blueocean']
571+
type: "nfs"
572+
o: "addr=%{custom_manager},rw",
573+
device: ":/srv/blueocean"
558574
```
559575

560-
Any extra options should be passed in as an array
576+
Available parameters for `options` depend on the used volume driver. For details read
577+
[Using volumes](https://docs.docker.com/storage/volumes/) from the Docker manual.
561578

562579
Some of the key advantages for using `volumes` over `bind mounts` are:
563580

@@ -582,8 +599,6 @@ docker::run { 'helloworld':
582599
}
583600
```
584601

585-
For more information on volumes see the [Docker Volumes](https://docs.docker.com/engine/admin/volumes/volumes) documentation.
586-
587602
### Compose
588603

589604
Docker Compose describes a set of containers in YAML format and runs a command to build and run those containers. Included in the docker module is the `docker_compose` type. This enables Puppet to run Compose and remediate any issues to ensure reality matches the model in your Compose file.

0 commit comments

Comments
 (0)