Repository navigation
Expand file tree
/
Copy pathImageConfig.php
More file actions
414 lines (369 loc) · 10.7 KB
/
Copy pathImageConfig.php
File metadata and controls
414 lines (369 loc) · 10.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<?php
declare(strict_types=1);
namespace Docker\API\Model;
use Docker\API\Runtime\AdditionalAndPatternProperties;
use Docker\API\Runtime\AdditionalPropertiesInterface;
class ImageConfig implements AdditionalPropertiesInterface
{
use AdditionalAndPatternProperties;
/**
* @var array
*/
protected $initialized = [];
public function isInitialized($property): bool
{
return \array_key_exists($property, $this->initialized);
}
/**
* The user that commands are run as inside the container.
*
* @var string|null
*/
protected $user;
/**
* An object mapping ports to an empty object in the form:
*
* `{"<port>/<tcp|udp|sctp>": {}}`
*
* @var array<string, array<string, mixed>>|null
*/
protected $exposedPorts;
/**
* A list of environment variables to set inside the container in the
* form `["VAR=value", ...]`. A variable without `=` is removed from the
* environment, rather than to have an empty value.
*
* @var list<string>|null
*/
protected $env;
/**
* Command to run specified as a string or an array of strings.
*
* @var list<string>|null
*/
protected $cmd;
/**
* A test to perform to check that the container is healthy.
* Healthcheck commands should be side-effect free.
*
* @var HealthConfig|null
*/
protected $healthcheck;
/**
* Command is already escaped (Windows only).
*
* @var bool|null
*/
protected $argsEscaped = false;
/**
* An object mapping mount point paths inside the container to empty
* objects.
*
* @var array<string, array<string, mixed>>|null
*/
protected $volumes;
/**
* The working directory for commands to run in.
*
* @var string|null
*/
protected $workingDir;
/**
* The entry point for the container as a string or an array of strings.
*
* If the array consists of exactly one empty string (`[""]`) then the
* entry point is reset to system default (i.e., the entry point used by
* docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).
*
* @var list<string>|null
*/
protected $entrypoint;
/**
* `ONBUILD` metadata that were defined in the image's `Dockerfile`.
*
* @var list<string>|null
*/
protected $onBuild;
/**
* User-defined key/value metadata.
*
* @var array<string, string>|null
*/
protected $labels;
/**
* Signal to stop a container as a string or unsigned integer.
*
* @var string|null
*/
protected $stopSignal;
/**
* Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.
*
* @var list<string>|null
*/
protected $shell;
/**
* The user that commands are run as inside the container.
*/
public function getUser(): ?string
{
return $this->user;
}
/**
* The user that commands are run as inside the container.
*/
public function setUser(?string $user): self
{
$this->initialized['user'] = true;
$this->user = $user;
return $this;
}
/**
* An object mapping ports to an empty object in the form:
*
* `{"<port>/<tcp|udp|sctp>": {}}`
*
* @return array<string, array<string, mixed>>|null
*/
public function getExposedPorts(): ?iterable
{
return $this->exposedPorts;
}
/**
* An object mapping ports to an empty object in the form:
*
* `{"<port>/<tcp|udp|sctp>": {}}`
*
* @param array<string, array<string, mixed>>|null $exposedPorts
*/
public function setExposedPorts(?iterable $exposedPorts): self
{
$this->initialized['exposedPorts'] = true;
$this->exposedPorts = $exposedPorts;
return $this;
}
/**
* A list of environment variables to set inside the container in the
* form `["VAR=value", ...]`. A variable without `=` is removed from the
* environment, rather than to have an empty value.
*
* @return list<string>|null
*/
public function getEnv(): ?array
{
return $this->env;
}
/**
* A list of environment variables to set inside the container in the
* form `["VAR=value", ...]`. A variable without `=` is removed from the
* environment, rather than to have an empty value.
*
* @param list<string>|null $env
*/
public function setEnv(?array $env): self
{
$this->initialized['env'] = true;
$this->env = $env;
return $this;
}
/**
* Command to run specified as a string or an array of strings.
*
* @return list<string>|null
*/
public function getCmd(): ?array
{
return $this->cmd;
}
/**
* Command to run specified as a string or an array of strings.
*
* @param list<string>|null $cmd
*/
public function setCmd(?array $cmd): self
{
$this->initialized['cmd'] = true;
$this->cmd = $cmd;
return $this;
}
/**
* A test to perform to check that the container is healthy.
* Healthcheck commands should be side-effect free.
*/
public function getHealthcheck(): ?HealthConfig
{
return $this->healthcheck;
}
/**
* A test to perform to check that the container is healthy.
* Healthcheck commands should be side-effect free.
*/
public function setHealthcheck(?HealthConfig $healthcheck): self
{
$this->initialized['healthcheck'] = true;
$this->healthcheck = $healthcheck;
return $this;
}
/**
* Command is already escaped (Windows only).
*/
public function getArgsEscaped(): ?bool
{
return $this->argsEscaped;
}
/**
* Command is already escaped (Windows only).
*/
public function setArgsEscaped(?bool $argsEscaped): self
{
$this->initialized['argsEscaped'] = true;
$this->argsEscaped = $argsEscaped;
return $this;
}
/**
* An object mapping mount point paths inside the container to empty
* objects.
*
* @return array<string, array<string, mixed>>|null
*/
public function getVolumes(): ?iterable
{
return $this->volumes;
}
/**
* An object mapping mount point paths inside the container to empty
* objects.
*
* @param array<string, array<string, mixed>>|null $volumes
*/
public function setVolumes(?iterable $volumes): self
{
$this->initialized['volumes'] = true;
$this->volumes = $volumes;
return $this;
}
/**
* The working directory for commands to run in.
*/
public function getWorkingDir(): ?string
{
return $this->workingDir;
}
/**
* The working directory for commands to run in.
*/
public function setWorkingDir(?string $workingDir): self
{
$this->initialized['workingDir'] = true;
$this->workingDir = $workingDir;
return $this;
}
/**
* The entry point for the container as a string or an array of strings.
*
* If the array consists of exactly one empty string (`[""]`) then the
* entry point is reset to system default (i.e., the entry point used by
* docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).
*
* @return list<string>|null
*/
public function getEntrypoint(): ?array
{
return $this->entrypoint;
}
/**
* The entry point for the container as a string or an array of strings.
*
* If the array consists of exactly one empty string (`[""]`) then the
* entry point is reset to system default (i.e., the entry point used by
* docker when there is no `ENTRYPOINT` instruction in the `Dockerfile`).
*
* @param list<string>|null $entrypoint
*/
public function setEntrypoint(?array $entrypoint): self
{
$this->initialized['entrypoint'] = true;
$this->entrypoint = $entrypoint;
return $this;
}
/**
* `ONBUILD` metadata that were defined in the image's `Dockerfile`.
*
* @return list<string>|null
*/
public function getOnBuild(): ?array
{
return $this->onBuild;
}
/**
* `ONBUILD` metadata that were defined in the image's `Dockerfile`.
*
* @param list<string>|null $onBuild
*/
public function setOnBuild(?array $onBuild): self
{
$this->initialized['onBuild'] = true;
$this->onBuild = $onBuild;
return $this;
}
/**
* User-defined key/value metadata.
*
* @return array<string, string>|null
*/
public function getLabels(): ?iterable
{
return $this->labels;
}
/**
* User-defined key/value metadata.
*
* @param array<string, string>|null $labels
*/
public function setLabels(?iterable $labels): self
{
$this->initialized['labels'] = true;
$this->labels = $labels;
return $this;
}
/**
* Signal to stop a container as a string or unsigned integer.
*/
public function getStopSignal(): ?string
{
return $this->stopSignal;
}
/**
* Signal to stop a container as a string or unsigned integer.
*/
public function setStopSignal(?string $stopSignal): self
{
$this->initialized['stopSignal'] = true;
$this->stopSignal = $stopSignal;
return $this;
}
/**
* Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.
*
* @return list<string>|null
*/
public function getShell(): ?array
{
return $this->shell;
}
/**
* Shell for when `RUN`, `CMD`, and `ENTRYPOINT` uses a shell.
*
* @param list<string>|null $shell
*/
public function setShell(?array $shell): self
{
$this->initialized['shell'] = true;
$this->shell = $shell;
return $this;
}
public function definedProperties(): array
{
return ['user' => ['User', 'getUser', 'setUser'], 'exposedPorts' => ['ExposedPorts', 'getExposedPorts', 'setExposedPorts'], 'env' => ['Env', 'getEnv', 'setEnv'], 'cmd' => ['Cmd', 'getCmd', 'setCmd'], 'healthcheck' => ['Healthcheck', 'getHealthcheck', 'setHealthcheck'], 'argsEscaped' => ['ArgsEscaped', 'getArgsEscaped', 'setArgsEscaped'], 'volumes' => ['Volumes', 'getVolumes', 'setVolumes'], 'workingDir' => ['WorkingDir', 'getWorkingDir', 'setWorkingDir'], 'entrypoint' => ['Entrypoint', 'getEntrypoint', 'setEntrypoint'], 'onBuild' => ['OnBuild', 'getOnBuild', 'setOnBuild'], 'labels' => ['Labels', 'getLabels', 'setLabels'], 'stopSignal' => ['StopSignal', 'getStopSignal', 'setStopSignal'], 'shell' => ['Shell', 'getShell', 'setShell']];
}
}