You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
36
35
37
-
38
36
## Description
39
37
40
38
This module install, configures, and manages [Docker](https://github.com/docker/docker).
@@ -130,7 +128,7 @@ class { 'docker':
130
128
fixed_cidr => '192.168.1.144/28',
131
129
}
132
130
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.
134
132
```
135
133
136
134
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':
148
146
To specify which Docker rpm package to install, add the following code to the manifest file:
149
147
150
148
```puppet
151
-
class { 'docker':
149
+
class { 'docker':
152
150
manage_package => true,
153
151
use_upstream_package_source => false,
154
152
package_engine_name => 'docker-engine'
@@ -197,6 +195,13 @@ class { 'docker':
197
195
}
198
196
```
199
197
198
+
To pass additional parameters to the daemon, add `extra_parameters` to the manifest file:
To uninstall docker, add the following to the manifest file:
201
206
202
207
```puppet
@@ -205,16 +210,19 @@ class { 'docker':
205
210
}
206
211
```
207
212
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
+
209
215
```puppet
210
216
class { 'docker':
211
217
docker_ee => true
212
218
}
213
219
```
214
220
215
221
### Proxy on Windows
222
+
216
223
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)
217
224
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
+
218
226
```puppet
219
227
windows_env { 'HTTP_PROXY'
220
228
value => 'http://1.2.3.4:80',
@@ -368,9 +376,9 @@ The `extra_parameters` parameter, which contains an array of command line argume
368
376
369
377
By default, automatic restarting of the service on failure is enabled by the service file for systemd based systems.
370
378
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.
372
380
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.
374
382
375
383
To use an image tag, add the following code to the manifest file:
376
384
@@ -425,6 +433,7 @@ docker::run { 'helloworld':
425
433
```
426
434
427
435
To run command on Windows 2016 requires the `restart` parameter to be set:
436
+
428
437
```puppet
429
438
docker::run { 'helloworld':
430
439
image => 'microsoft/nanoserver',
@@ -506,6 +515,7 @@ docker::volumes::volumes:
506
515
Any extra options should be passed in as an array
507
516
508
517
Some of the key advantages for using `volumes` over `bind mounts` are:
518
+
509
519
* Easier to back up or migrate rather than `bind mounts` (legacy volumes).
510
520
* Managed with Docker CLI or API (Puppet type uses the CLI commands).
511
521
* Works on Windows and Linux.
@@ -543,6 +553,7 @@ class {'docker::compose':
543
553
version => '1.9.0',
544
554
}
545
555
```
556
+
546
557
Set the `version` parameter to any version you need to install.
547
558
548
559
This is an example of a Compose file:
@@ -604,7 +615,7 @@ To deploy the stack, add the following code to the manifest file:
604
615
605
616
To remove the stack, set `ensure => absent`.
606
617
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.
608
619
609
620
To deploy the stack, add the following code to the manifest file.
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).
816
828
817
829
Add the following code to the manifest file:
818
830
@@ -1139,11 +1151,12 @@ IPv4 address for the container default gateway. This address must be part of the
1139
1151
Defaults to `undefined`.
1140
1152
1141
1153
#### `ipv6`
1154
+
1142
1155
Enables ipv6 support for the docker daemon
1143
1156
1144
1157
Defaults to false
1145
1158
1146
-
#### `ipv6_cidr`
1159
+
#### `ipv6_cidr`
1147
1160
1148
1161
IPv6 subnet for fixed IPs
1149
1162
@@ -1289,7 +1302,6 @@ Group ownership of the unix control socket.
1289
1302
1290
1303
Default is `OS and package specific`.
1291
1304
1292
-
1293
1305
#### `extra_parameters`
1294
1306
1295
1307
Extra parameters that should be passed to the Docker daemon.
@@ -1504,4 +1516,3 @@ This module supports:
1504
1516
## Development
1505
1517
1506
1518
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).
0 commit comments