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
@@ -108,21 +108,21 @@ To use the CE packages, add the following code to the manifest file:
108
108
```puppet
109
109
class { 'docker':
110
110
use_upstream_package_source => false,
111
-
repo_opt => '',
111
+
repo_opt => '',
112
112
}
113
113
```
114
114
115
115
By default, the Docker daemon binds to a unix socket at `/var/run/docker.sock`. To change this parameter and update the binding parameter to a tcp socket, add the following code to the manifest file:
116
116
117
117
```puppet
118
118
class { 'docker':
119
-
tcp_bind => ['tcp://127.0.0.1:2375'],
120
-
socket_bind => 'unix:///var/run/docker.sock',
121
-
ip_forward => true,
122
-
iptables => true,
123
-
ip_masq => true,
124
-
bip => '192.168.1.1/24',
125
-
fixed_cidr => '192.168.1.144/28',
119
+
tcp_bind => ['tcp://127.0.0.1:2375'],
120
+
socket_bind => 'unix:///var/run/docker.sock',
121
+
ip_forward => true,
122
+
iptables => true,
123
+
ip_masq => true,
124
+
bip => '192.168.1.1/24',
125
+
fixed_cidr => '192.168.1.144/28',
126
126
}
127
127
```
128
128
@@ -132,7 +132,7 @@ The default group ownership of the Unix control socket differs based on OS. For
132
132
133
133
```puppet
134
134
class {'docker':
135
-
socket_group => 'root',
135
+
socket_group => 'root',
136
136
socket_override => true,
137
137
}
138
138
```
@@ -153,11 +153,11 @@ When setting up TLS, upload the related files (CA certificate, server certificat
153
153
154
154
```puppet
155
155
class { 'docker':
156
-
tcp_bind => ['tcp://0.0.0.0:2376'],
157
-
tls_enable => true,
158
-
tls_cacert => '/etc/docker/tls/ca.pem',
159
-
tls_cert => '/etc/docker/tls/cert.pem',
160
-
tls_key => '/etc/docker/tls/key.pem',
156
+
tcp_bind => ['tcp://0.0.0.0:2376'],
157
+
tls_enable => true,
158
+
tls_cacert => '/etc/docker/tls/ca.pem',
159
+
tls_cert => '/etc/docker/tls/cert.pem',
160
+
tls_key => '/etc/docker/tls/key.pem',
161
161
}
162
162
```
163
163
@@ -177,7 +177,7 @@ To track the latest version of Docker, add the following code to the manifest fi
177
177
178
178
```puppet
179
179
class { 'docker':
180
-
version => 'latest',
180
+
version => latest,
181
181
}
182
182
```
183
183
@@ -477,18 +477,18 @@ To enable the restart of an unhealthy container, add the following code to the m
health_check_interval => '<time between running docker healthcheck>',
485
485
```
486
486
487
487
To run command on Windows 2016 requires the `restart` parameter to be set:
488
488
489
489
```puppet
490
490
docker::run { 'helloworld':
491
-
image => 'microsoft/nanoserver',
491
+
image => 'microsoft/nanoserver',
492
492
command => 'ping 127.0.0.1 -t',
493
493
restart => 'always'
494
494
```
@@ -611,7 +611,7 @@ To install Docker Compose, add the following code to the manifest file:
611
611
612
612
```puppet
613
613
class {'docker::compose':
614
-
ensure => present,
614
+
ensure => present,
615
615
version => '1.9.0',
616
616
}
617
617
```
@@ -631,22 +631,25 @@ Specify the `file` resource to add a Compose file to the machine you have Puppet
631
631
```puppet
632
632
docker_compose { 'test':
633
633
compose_files => ['/tmp/docker-compose.yml'],
634
-
ensure => present,
634
+
ensure => present,
635
635
}
636
636
```
637
637
638
638
Puppet automatically runs Compose because the relevant Compose services aren't running. If required, include additional options such as enabling experimental features and scaling rules.
639
639
640
-
In the example below, Puppet runs Compose when the number of containers specified for a service doesn't match the scale values.
640
+
Additionally, the TMPDIR environment variable can optionally be set when docker_compose runs if you want Puppet to manage the environment variable within the scope of the resource. This is effective when noexec is set on the default /tmp dir, however you must ensure that the target directory exists as the resource will not create it.
641
+
642
+
In the example below, Puppet runs Compose when the number of containers specified for a service doesn't match the scale values. The optional tmpdir parameter is also specified.
641
643
642
644
```puppet
643
645
docker_compose { 'test':
644
646
compose_files => ['/tmp/docker-compose.yml'],
645
-
ensure => present,
646
-
scale => {
647
+
ensure => present,
648
+
scale => {
647
649
'compose_test' => 2,
648
650
},
649
-
options => ['--x-networking']
651
+
tmpdir => '/usr/local/share/tmp_docker',
652
+
options => ['--x-networking']
650
653
}
651
654
```
652
655
@@ -670,10 +673,10 @@ To deploy the stack, add the following code to the manifest file:
0 commit comments