Skip to content

Commit 4e12435

Browse files
mpeppingdavejrt
authored andcommitted
Adds a Usage example for daemon level extra_parameters (#386)
* Usage for extra_parameters for the Docker daemon * markdownlint fixes
1 parent 48abf2a commit 4e12435

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

README.md

+23-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/puppetlabs/docker.svg)](https://forge.puppetlabs.com/puppetlabs/docker)
44
[![Puppet Forge Endorsement](https://img.shields.io/puppetforge/e/puppetlabs/docker.svg)](https://forge.puppetlabs.com/puppetlabs/docker)
55

6-
76
# Docker
87

98
#### Table of Contents
@@ -34,7 +33,6 @@
3433

3534
The Puppet docker module installs, configures, and manages [Docker](https://github.com/docker/docker) from the [Docker repository](https://docs.docker.com/installation/). It supports the latest [Docker CE (Community Edition)](https://www.docker.com/community-edition) for Linux based distributions and [Docker EE(Enterprise Edition)](https://www.docker.com/enterprise-edition) for Windows and Linux as well as legacy releases.
3635

37-
3836
## Description
3937

4038
This module install, configures, and manages [Docker](https://github.com/docker/docker).
@@ -130,7 +128,7 @@ class { 'docker':
130128
fixed_cidr => '192.168.1.144/28',
131129
}
132130
133-
For more information about the options to configure the default docker bridge, see (this)[https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/] page.
131+
For more information about the options to configure the default docker bridge, see (this)[https://docs.docker.com/v17.09/engine/userguide/networking/default_network/custom-docker0/] page.
134132
```
135133

136134
When setting up TLS, upload the related files (CA certificate, server certificate, and key) and include their paths in the manifest file:
@@ -148,7 +146,7 @@ class { 'docker':
148146
To specify which Docker rpm package to install, add the following code to the manifest file:
149147

150148
```puppet
151-
class { 'docker' :
149+
class { 'docker':
152150
manage_package => true,
153151
use_upstream_package_source => false,
154152
package_engine_name => 'docker-engine'
@@ -197,6 +195,13 @@ class { 'docker':
197195
}
198196
```
199197

198+
To pass additional parameters to the daemon, add `extra_parameters` to the manifest file:
199+
200+
```puppet
201+
class { 'docker':
202+
extra_parameters => ['--experimental=true', '--metrics-addr=localhost:9323'],
203+
```
204+
200205
To uninstall docker, add the following to the manifest file:
201206

202207
```puppet
@@ -205,16 +210,19 @@ class { 'docker':
205210
}
206211
```
207212

208-
Only Docker EE is supported on Windows. To install docker on Windows 2016 and above the `docker_ee` parameter must be specified:
213+
Only Docker EE is supported on Windows. To install docker on Windows 2016 and above the `docker_ee` parameter must be specified:
214+
209215
```puppet
210216
class { 'docker':
211217
docker_ee => true
212218
}
213219
```
214220

215221
### Proxy on Windows
222+
216223
To use docker through a proxy on Windows, a System Environment Variable HTTP_PROXY/HTTPS_PROXY must be set. See [Docker Engine on Windows](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon#proxy-configuration)
217224
This can be done using a different puppet module such as the puppet-windows_env module. After setting the variable, the docker service must be restarted.
225+
218226
```puppet
219227
windows_env { 'HTTP_PROXY'
220228
value => 'http://1.2.3.4:80',
@@ -368,9 +376,9 @@ The `extra_parameters` parameter, which contains an array of command line argume
368376

369377
By default, automatic restarting of the service on failure is enabled by the service file for systemd based systems.
370378

371-
It's recommended that an image tag is used at all times with the `docker::run` define type. If not, the latest image ise used, whether it be in a remote registry or installed on the server already by the `docker::image` define type.
379+
It's recommended that an image tag is used at all times with the `docker::run` define type. If not, the latest image ise used, whether it be in a remote registry or installed on the server already by the `docker::image` define type.
372380

373-
NOTE: As of v3.0.0, if the latest tag is used, the image will be the latest at the time the of the initial puppet run. Any subsequent puppet runs will always reference the latest local image. For this this reason it highly recommended that an alternative tag be used, or the image be removed before pulling latest again.
381+
NOTE: As of v3.0.0, if the latest tag is used, the image will be the latest at the time the of the initial puppet run. Any subsequent puppet runs will always reference the latest local image. For this this reason it highly recommended that an alternative tag be used, or the image be removed before pulling latest again.
374382

375383
To use an image tag, add the following code to the manifest file:
376384

@@ -425,6 +433,7 @@ docker::run { 'helloworld':
425433
```
426434

427435
To run command on Windows 2016 requires the `restart` parameter to be set:
436+
428437
```puppet
429438
docker::run { 'helloworld':
430439
image => 'microsoft/nanoserver',
@@ -506,6 +515,7 @@ docker::volumes::volumes:
506515
Any extra options should be passed in as an array
507516

508517
Some of the key advantages for using `volumes` over `bind mounts` are:
518+
509519
* Easier to back up or migrate rather than `bind mounts` (legacy volumes).
510520
* Managed with Docker CLI or API (Puppet type uses the CLI commands).
511521
* Works on Windows and Linux.
@@ -543,6 +553,7 @@ class {'docker::compose':
543553
version => '1.9.0',
544554
}
545555
```
556+
546557
Set the `version` parameter to any version you need to install.
547558

548559
This is an example of a Compose file:
@@ -604,7 +615,7 @@ To deploy the stack, add the following code to the manifest file:
604615

605616
To remove the stack, set `ensure => absent`.
606617

607-
If you are using a v3.2compose file or above on a Docker Swarm cluster, include the `docker::stack` class. Similar to using older versions of Docker, compose the file resource before running the stack command.
618+
If you are using a v3.2compose file or above on a Docker Swarm cluster, include the `docker::stack` class. Similar to using older versions of Docker, compose the file resource before running the stack command.
608619

609620
To deploy the stack, add the following code to the manifest file.
610621

@@ -616,6 +627,7 @@ docker::stack { 'yourapp':
616627
require => [Class['docker'], File['/tmp/docker-compose.yaml']],
617628
}
618629
```
630+
619631
To remove the stack, set `ensure => absent`.
620632

621633
### Swarm mode
@@ -812,7 +824,7 @@ docker::registry_auth::registries:
812824
version: '<docker_version>'
813825
```
814826

815-
If using Docker V1.11 or later, the docker login email flag has been deprecated [docker_change_log](https://docs.docker.com/release-notes/docker-engine/#1110-2016-04-13).
827+
If using Docker V1.11 or later, the docker login email flag has been deprecated [docker_change_log](https://docs.docker.com/release-notes/docker-engine/#1110-2016-04-13).
816828

817829
Add the following code to the manifest file:
818830

@@ -1139,11 +1151,12 @@ IPv4 address for the container default gateway. This address must be part of the
11391151
Defaults to `undefined`.
11401152

11411153
#### `ipv6`
1154+
11421155
Enables ipv6 support for the docker daemon
11431156

11441157
Defaults to false
11451158

1146-
#### `ipv6_cidr`
1159+
#### `ipv6_cidr`
11471160

11481161
IPv6 subnet for fixed IPs
11491162

@@ -1289,7 +1302,6 @@ Group ownership of the unix control socket.
12891302

12901303
Default is `OS and package specific`.
12911304

1292-
12931305
#### `extra_parameters`
12941306

12951307
Extra parameters that should be passed to the Docker daemon.
@@ -1504,4 +1516,3 @@ This module supports:
15041516
## Development
15051517

15061518
If you would like to contribute to this module, see the guidelines in [CONTRIBUTING.MD](https://github.com/puppetlabs/puppetlabs-docker/blob/master/CONTRIBUTING.md).
1507-

0 commit comments

Comments
 (0)