-
Notifications
You must be signed in to change notification settings - Fork 14
/
container.ts
917 lines (908 loc) · 36.7 KB
/
container.ts
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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
import * as utilities from "./utilities";
/**
* Manages the lifecycle of a Docker container.
*
* ## Example Usage
*
*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as docker from "@pulumi/docker";
*
* // Find the latest Ubuntu precise image.
* const ubuntuRemoteImage = new docker.RemoteImage("ubuntu", {
* name: "ubuntu:precise",
* });
* // Start a container
* const ubuntuContainer = new docker.Container("ubuntu", {
* image: ubuntuRemoteImage.latest,
* });
* ```
*/
export class Container extends pulumi.CustomResource {
/**
* Get an existing Container resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ContainerState, opts?: pulumi.CustomResourceOptions): Container {
return new Container(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'docker:index/container:Container';
/**
* Returns true if the given object is an instance of Container. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Container {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Container.__pulumiType;
}
/**
* If true attach to the container after its creation and waits the end of his execution.
*/
public readonly attach!: pulumi.Output<boolean | undefined>;
/**
* The network bridge of the container as read from its NetworkSettings.
*/
public /*out*/ readonly bridge!: pulumi.Output<string>;
/**
* See Capabilities below for details.
*/
public readonly capabilities!: pulumi.Output<outputs.ContainerCapabilities | undefined>;
/**
* The command to use to start the
* container. For example, to run `/usr/bin/myprogram -f baz.conf` set the
* command to be `["/usr/bin/myprogram", "-f", "baz.conf"]`.
*/
public readonly command!: pulumi.Output<string[]>;
/**
* The logs of the container if its execution is done (`attach` must be disabled).
*/
public /*out*/ readonly containerLogs!: pulumi.Output<string>;
/**
* A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. `0-1`.
*/
public readonly cpuSet!: pulumi.Output<string | undefined>;
/**
* CPU shares (relative weight) for the container.
*/
public readonly cpuShares!: pulumi.Output<number | undefined>;
/**
* If defined will attempt to stop the container before destroying. Container will be destroyed after `n` seconds or on successful stop.
*/
public readonly destroyGraceSeconds!: pulumi.Output<number | undefined>;
/**
* See Devices below for details.
*/
public readonly devices!: pulumi.Output<outputs.ContainerDevice[] | undefined>;
/**
* Set of DNS servers.
*/
public readonly dns!: pulumi.Output<string[] | undefined>;
/**
* Set of DNS options used by the DNS provider(s), see `resolv.conf` documentation for valid list of options.
*/
public readonly dnsOpts!: pulumi.Output<string[] | undefined>;
/**
* Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container.
*/
public readonly dnsSearches!: pulumi.Output<string[] | undefined>;
/**
* Domain name of the container.
*/
public readonly domainname!: pulumi.Output<string | undefined>;
/**
* The command to use as the
* Entrypoint for the container. The Entrypoint allows you to configure a
* container to run as an executable. For example, to run `/usr/bin/myprogram`
* when starting a container, set the entrypoint to be
* `["/usr/bin/myprogram"]`.
*/
public readonly entrypoints!: pulumi.Output<string[]>;
/**
* Environment variables to set.
*/
public readonly envs!: pulumi.Output<string[]>;
/**
* The exit code of the container if its execution is done (`mustRun` must be disabled).
*/
public /*out*/ readonly exitCode!: pulumi.Output<number>;
/**
* *Deprecated:* Use `networkData` instead. The network gateway of the container as read from its
* NetworkSettings.
*/
public /*out*/ readonly gateway!: pulumi.Output<string>;
/**
* Add additional groups to run as.
*/
public readonly groupAdds!: pulumi.Output<string[] | undefined>;
/**
* See Healthcheck below for details.
*/
public readonly healthcheck!: pulumi.Output<outputs.ContainerHealthcheck | undefined>;
/**
* Hostname to add.
*/
public readonly hosts!: pulumi.Output<outputs.ContainerHost[] | undefined>;
/**
* Hostname of the container.
*/
public readonly hostname!: pulumi.Output<string>;
/**
* The ID of the image to back this container.
* The easiest way to get this value is to use the `docker..RemoteImage` resource
* as is shown in the example above.
*/
public readonly image!: pulumi.Output<string>;
/**
* *Deprecated:* Use `networkData` instead. The IP address of the container's first network it.
*/
public /*out*/ readonly ipAddress!: pulumi.Output<string>;
/**
* *Deprecated:* Use `networkData` instead. The IP prefix length of the container as read from its
* NetworkSettings.
*/
public /*out*/ readonly ipPrefixLength!: pulumi.Output<number>;
/**
* IPC sharing mode for the container. Possible values are: `none`, `private`, `shareable`, `container:<name|id>` or `host`.
*/
public readonly ipcMode!: pulumi.Output<string>;
/**
* Adding labels.
*/
public readonly labels!: pulumi.Output<outputs.ContainerLabel[]>;
/**
* Set of links for link based
* connectivity between containers that are running on the same host.
*/
public readonly links!: pulumi.Output<string[] | undefined>;
/**
* The logging driver to use for the container.
* Defaults to "json-file".
*/
public readonly logDriver!: pulumi.Output<string>;
/**
* Key/value pairs to use as options for
* the logging driver.
*/
public readonly logOpts!: pulumi.Output<{[key: string]: any}>;
/**
* Save the container logs (`attach` must be enabled).
*/
public readonly logs!: pulumi.Output<boolean | undefined>;
/**
* The maximum amount of times to an attempt
* a restart when `restart` is set to "on-failure"
*/
public readonly maxRetryCount!: pulumi.Output<number | undefined>;
/**
* The memory limit for the container in MBs.
*/
public readonly memory!: pulumi.Output<number | undefined>;
public readonly memorySwap!: pulumi.Output<number | undefined>;
/**
* See Mounts below for details.
*/
public readonly mounts!: pulumi.Output<outputs.ContainerMount[] | undefined>;
public readonly mustRun!: pulumi.Output<boolean | undefined>;
public readonly name!: pulumi.Output<string>;
/**
* Network aliases of the container for user-defined networks only. *Deprecated:* use `networksAdvanced` instead.
*/
public readonly networkAliases!: pulumi.Output<string[] | undefined>;
/**
* (Map of a block) The IP addresses of the container on each
* network. Key are the network names, values are the IP addresses.
*/
public /*out*/ readonly networkDatas!: pulumi.Output<outputs.ContainerNetworkData[]>;
/**
* Network mode of the container.
*/
public readonly networkMode!: pulumi.Output<string | undefined>;
/**
* Id of the networks in which the
* container is. *Deprecated:* use `networksAdvanced` instead.
*/
public readonly networks!: pulumi.Output<string[] | undefined>;
/**
* See Networks Advanced below for details. If this block has priority to the deprecated `networkAlias` and `network` properties.
*/
public readonly networksAdvanced!: pulumi.Output<outputs.ContainerNetworksAdvanced[] | undefined>;
/**
* The PID (Process) Namespace mode for the container. Either `container:<name|id>` or `host`.
*/
public readonly pidMode!: pulumi.Output<string | undefined>;
/**
* See Ports below for details.
*/
public readonly ports!: pulumi.Output<outputs.ContainerPort[] | undefined>;
/**
* Run container in privileged mode.
*/
public readonly privileged!: pulumi.Output<boolean | undefined>;
/**
* Publish all ports of the container.
*/
public readonly publishAllPorts!: pulumi.Output<boolean | undefined>;
/**
* If true, this volume will be readonly.
* Defaults to false.
*/
public readonly readOnly!: pulumi.Output<boolean | undefined>;
/**
* The restart policy for the container. Must be
* one of "no", "on-failure", "always", "unless-stopped".
*/
public readonly restart!: pulumi.Output<string | undefined>;
public readonly rm!: pulumi.Output<boolean | undefined>;
/**
* Size of `/dev/shm` in MBs.
*/
public readonly shmSize!: pulumi.Output<number>;
/**
* If true, then the Docker container will be
* started after creation. If false, then the container is only created.
*/
public readonly start!: pulumi.Output<boolean | undefined>;
/**
* A map of kernel parameters (sysctls) to set in the container.
*/
public readonly sysctls!: pulumi.Output<{[key: string]: any} | undefined>;
/**
* A map of container directories which should be replaced by `tmpfs mounts`, and their corresponding mount options.
*/
public readonly tmpfs!: pulumi.Output<{[key: string]: any} | undefined>;
/**
* See Ulimits below for
* details.
*/
public readonly ulimits!: pulumi.Output<outputs.ContainerUlimit[] | undefined>;
/**
* See File Upload below for details.
*/
public readonly uploads!: pulumi.Output<outputs.ContainerUpload[] | undefined>;
/**
* User used for run the first process. Format is
* `user` or `user:group` which user and group can be passed literraly or
* by name.
*/
public readonly user!: pulumi.Output<string>;
/**
* Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
*/
public readonly usernsMode!: pulumi.Output<string | undefined>;
/**
* See Volumes below for details.
*/
public readonly volumes!: pulumi.Output<outputs.ContainerVolume[] | undefined>;
/**
* The working directory for commands to run in
*/
public readonly workingDir!: pulumi.Output<string | undefined>;
/**
* Create a Container resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ContainerArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ContainerArgs | ContainerState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as ContainerState | undefined;
inputs["attach"] = state ? state.attach : undefined;
inputs["bridge"] = state ? state.bridge : undefined;
inputs["capabilities"] = state ? state.capabilities : undefined;
inputs["command"] = state ? state.command : undefined;
inputs["containerLogs"] = state ? state.containerLogs : undefined;
inputs["cpuSet"] = state ? state.cpuSet : undefined;
inputs["cpuShares"] = state ? state.cpuShares : undefined;
inputs["destroyGraceSeconds"] = state ? state.destroyGraceSeconds : undefined;
inputs["devices"] = state ? state.devices : undefined;
inputs["dns"] = state ? state.dns : undefined;
inputs["dnsOpts"] = state ? state.dnsOpts : undefined;
inputs["dnsSearches"] = state ? state.dnsSearches : undefined;
inputs["domainname"] = state ? state.domainname : undefined;
inputs["entrypoints"] = state ? state.entrypoints : undefined;
inputs["envs"] = state ? state.envs : undefined;
inputs["exitCode"] = state ? state.exitCode : undefined;
inputs["gateway"] = state ? state.gateway : undefined;
inputs["groupAdds"] = state ? state.groupAdds : undefined;
inputs["healthcheck"] = state ? state.healthcheck : undefined;
inputs["hosts"] = state ? state.hosts : undefined;
inputs["hostname"] = state ? state.hostname : undefined;
inputs["image"] = state ? state.image : undefined;
inputs["ipAddress"] = state ? state.ipAddress : undefined;
inputs["ipPrefixLength"] = state ? state.ipPrefixLength : undefined;
inputs["ipcMode"] = state ? state.ipcMode : undefined;
inputs["labels"] = state ? state.labels : undefined;
inputs["links"] = state ? state.links : undefined;
inputs["logDriver"] = state ? state.logDriver : undefined;
inputs["logOpts"] = state ? state.logOpts : undefined;
inputs["logs"] = state ? state.logs : undefined;
inputs["maxRetryCount"] = state ? state.maxRetryCount : undefined;
inputs["memory"] = state ? state.memory : undefined;
inputs["memorySwap"] = state ? state.memorySwap : undefined;
inputs["mounts"] = state ? state.mounts : undefined;
inputs["mustRun"] = state ? state.mustRun : undefined;
inputs["name"] = state ? state.name : undefined;
inputs["networkAliases"] = state ? state.networkAliases : undefined;
inputs["networkDatas"] = state ? state.networkDatas : undefined;
inputs["networkMode"] = state ? state.networkMode : undefined;
inputs["networks"] = state ? state.networks : undefined;
inputs["networksAdvanced"] = state ? state.networksAdvanced : undefined;
inputs["pidMode"] = state ? state.pidMode : undefined;
inputs["ports"] = state ? state.ports : undefined;
inputs["privileged"] = state ? state.privileged : undefined;
inputs["publishAllPorts"] = state ? state.publishAllPorts : undefined;
inputs["readOnly"] = state ? state.readOnly : undefined;
inputs["restart"] = state ? state.restart : undefined;
inputs["rm"] = state ? state.rm : undefined;
inputs["shmSize"] = state ? state.shmSize : undefined;
inputs["start"] = state ? state.start : undefined;
inputs["sysctls"] = state ? state.sysctls : undefined;
inputs["tmpfs"] = state ? state.tmpfs : undefined;
inputs["ulimits"] = state ? state.ulimits : undefined;
inputs["uploads"] = state ? state.uploads : undefined;
inputs["user"] = state ? state.user : undefined;
inputs["usernsMode"] = state ? state.usernsMode : undefined;
inputs["volumes"] = state ? state.volumes : undefined;
inputs["workingDir"] = state ? state.workingDir : undefined;
} else {
const args = argsOrState as ContainerArgs | undefined;
if (!args || args.image === undefined) {
throw new Error("Missing required property 'image'");
}
inputs["attach"] = args ? args.attach : undefined;
inputs["capabilities"] = args ? args.capabilities : undefined;
inputs["command"] = args ? args.command : undefined;
inputs["cpuSet"] = args ? args.cpuSet : undefined;
inputs["cpuShares"] = args ? args.cpuShares : undefined;
inputs["destroyGraceSeconds"] = args ? args.destroyGraceSeconds : undefined;
inputs["devices"] = args ? args.devices : undefined;
inputs["dns"] = args ? args.dns : undefined;
inputs["dnsOpts"] = args ? args.dnsOpts : undefined;
inputs["dnsSearches"] = args ? args.dnsSearches : undefined;
inputs["domainname"] = args ? args.domainname : undefined;
inputs["entrypoints"] = args ? args.entrypoints : undefined;
inputs["envs"] = args ? args.envs : undefined;
inputs["groupAdds"] = args ? args.groupAdds : undefined;
inputs["healthcheck"] = args ? args.healthcheck : undefined;
inputs["hosts"] = args ? args.hosts : undefined;
inputs["hostname"] = args ? args.hostname : undefined;
inputs["image"] = args ? args.image : undefined;
inputs["ipcMode"] = args ? args.ipcMode : undefined;
inputs["labels"] = args ? args.labels : undefined;
inputs["links"] = args ? args.links : undefined;
inputs["logDriver"] = args ? args.logDriver : undefined;
inputs["logOpts"] = args ? args.logOpts : undefined;
inputs["logs"] = args ? args.logs : undefined;
inputs["maxRetryCount"] = args ? args.maxRetryCount : undefined;
inputs["memory"] = args ? args.memory : undefined;
inputs["memorySwap"] = args ? args.memorySwap : undefined;
inputs["mounts"] = args ? args.mounts : undefined;
inputs["mustRun"] = args ? args.mustRun : undefined;
inputs["name"] = args ? args.name : undefined;
inputs["networkAliases"] = args ? args.networkAliases : undefined;
inputs["networkMode"] = args ? args.networkMode : undefined;
inputs["networks"] = args ? args.networks : undefined;
inputs["networksAdvanced"] = args ? args.networksAdvanced : undefined;
inputs["pidMode"] = args ? args.pidMode : undefined;
inputs["ports"] = args ? args.ports : undefined;
inputs["privileged"] = args ? args.privileged : undefined;
inputs["publishAllPorts"] = args ? args.publishAllPorts : undefined;
inputs["readOnly"] = args ? args.readOnly : undefined;
inputs["restart"] = args ? args.restart : undefined;
inputs["rm"] = args ? args.rm : undefined;
inputs["shmSize"] = args ? args.shmSize : undefined;
inputs["start"] = args ? args.start : undefined;
inputs["sysctls"] = args ? args.sysctls : undefined;
inputs["tmpfs"] = args ? args.tmpfs : undefined;
inputs["ulimits"] = args ? args.ulimits : undefined;
inputs["uploads"] = args ? args.uploads : undefined;
inputs["user"] = args ? args.user : undefined;
inputs["usernsMode"] = args ? args.usernsMode : undefined;
inputs["volumes"] = args ? args.volumes : undefined;
inputs["workingDir"] = args ? args.workingDir : undefined;
inputs["bridge"] = undefined /*out*/;
inputs["containerLogs"] = undefined /*out*/;
inputs["exitCode"] = undefined /*out*/;
inputs["gateway"] = undefined /*out*/;
inputs["ipAddress"] = undefined /*out*/;
inputs["ipPrefixLength"] = undefined /*out*/;
inputs["networkDatas"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(Container.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering Container resources.
*/
export interface ContainerState {
/**
* If true attach to the container after its creation and waits the end of his execution.
*/
readonly attach?: pulumi.Input<boolean>;
/**
* The network bridge of the container as read from its NetworkSettings.
*/
readonly bridge?: pulumi.Input<string>;
/**
* See Capabilities below for details.
*/
readonly capabilities?: pulumi.Input<inputs.ContainerCapabilities>;
/**
* The command to use to start the
* container. For example, to run `/usr/bin/myprogram -f baz.conf` set the
* command to be `["/usr/bin/myprogram", "-f", "baz.conf"]`.
*/
readonly command?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The logs of the container if its execution is done (`attach` must be disabled).
*/
readonly containerLogs?: pulumi.Input<string>;
/**
* A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. `0-1`.
*/
readonly cpuSet?: pulumi.Input<string>;
/**
* CPU shares (relative weight) for the container.
*/
readonly cpuShares?: pulumi.Input<number>;
/**
* If defined will attempt to stop the container before destroying. Container will be destroyed after `n` seconds or on successful stop.
*/
readonly destroyGraceSeconds?: pulumi.Input<number>;
/**
* See Devices below for details.
*/
readonly devices?: pulumi.Input<pulumi.Input<inputs.ContainerDevice>[]>;
/**
* Set of DNS servers.
*/
readonly dns?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Set of DNS options used by the DNS provider(s), see `resolv.conf` documentation for valid list of options.
*/
readonly dnsOpts?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container.
*/
readonly dnsSearches?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Domain name of the container.
*/
readonly domainname?: pulumi.Input<string>;
/**
* The command to use as the
* Entrypoint for the container. The Entrypoint allows you to configure a
* container to run as an executable. For example, to run `/usr/bin/myprogram`
* when starting a container, set the entrypoint to be
* `["/usr/bin/myprogram"]`.
*/
readonly entrypoints?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Environment variables to set.
*/
readonly envs?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The exit code of the container if its execution is done (`mustRun` must be disabled).
*/
readonly exitCode?: pulumi.Input<number>;
/**
* *Deprecated:* Use `networkData` instead. The network gateway of the container as read from its
* NetworkSettings.
* @deprecated Use gateway from ip_adresses_data instead. This field exposes the data of the container's first network.
*/
readonly gateway?: pulumi.Input<string>;
/**
* Add additional groups to run as.
*/
readonly groupAdds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* See Healthcheck below for details.
*/
readonly healthcheck?: pulumi.Input<inputs.ContainerHealthcheck>;
/**
* Hostname to add.
*/
readonly hosts?: pulumi.Input<pulumi.Input<inputs.ContainerHost>[]>;
/**
* Hostname of the container.
*/
readonly hostname?: pulumi.Input<string>;
/**
* The ID of the image to back this container.
* The easiest way to get this value is to use the `docker..RemoteImage` resource
* as is shown in the example above.
*/
readonly image?: pulumi.Input<string>;
/**
* *Deprecated:* Use `networkData` instead. The IP address of the container's first network it.
* @deprecated Use ip_adresses_data instead. This field exposes the data of the container's first network.
*/
readonly ipAddress?: pulumi.Input<string>;
/**
* *Deprecated:* Use `networkData` instead. The IP prefix length of the container as read from its
* NetworkSettings.
* @deprecated Use ip_prefix_length from ip_adresses_data instead. This field exposes the data of the container's first network.
*/
readonly ipPrefixLength?: pulumi.Input<number>;
/**
* IPC sharing mode for the container. Possible values are: `none`, `private`, `shareable`, `container:<name|id>` or `host`.
*/
readonly ipcMode?: pulumi.Input<string>;
/**
* Adding labels.
*/
readonly labels?: pulumi.Input<pulumi.Input<inputs.ContainerLabel>[]>;
/**
* Set of links for link based
* connectivity between containers that are running on the same host.
* @deprecated The --link flag is a legacy feature of Docker. It may eventually be removed.
*/
readonly links?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The logging driver to use for the container.
* Defaults to "json-file".
*/
readonly logDriver?: pulumi.Input<string>;
/**
* Key/value pairs to use as options for
* the logging driver.
*/
readonly logOpts?: pulumi.Input<{[key: string]: any}>;
/**
* Save the container logs (`attach` must be enabled).
*/
readonly logs?: pulumi.Input<boolean>;
/**
* The maximum amount of times to an attempt
* a restart when `restart` is set to "on-failure"
*/
readonly maxRetryCount?: pulumi.Input<number>;
/**
* The memory limit for the container in MBs.
*/
readonly memory?: pulumi.Input<number>;
readonly memorySwap?: pulumi.Input<number>;
/**
* See Mounts below for details.
*/
readonly mounts?: pulumi.Input<pulumi.Input<inputs.ContainerMount>[]>;
readonly mustRun?: pulumi.Input<boolean>;
readonly name?: pulumi.Input<string>;
/**
* Network aliases of the container for user-defined networks only. *Deprecated:* use `networksAdvanced` instead.
* @deprecated Use networks_advanced instead. Will be removed in v2.0.0
*/
readonly networkAliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* (Map of a block) The IP addresses of the container on each
* network. Key are the network names, values are the IP addresses.
*/
readonly networkDatas?: pulumi.Input<pulumi.Input<inputs.ContainerNetworkData>[]>;
/**
* Network mode of the container.
*/
readonly networkMode?: pulumi.Input<string>;
/**
* Id of the networks in which the
* container is. *Deprecated:* use `networksAdvanced` instead.
* @deprecated Use networks_advanced instead. Will be removed in v2.0.0
*/
readonly networks?: pulumi.Input<pulumi.Input<string>[]>;
/**
* See Networks Advanced below for details. If this block has priority to the deprecated `networkAlias` and `network` properties.
*/
readonly networksAdvanced?: pulumi.Input<pulumi.Input<inputs.ContainerNetworksAdvanced>[]>;
/**
* The PID (Process) Namespace mode for the container. Either `container:<name|id>` or `host`.
*/
readonly pidMode?: pulumi.Input<string>;
/**
* See Ports below for details.
*/
readonly ports?: pulumi.Input<pulumi.Input<inputs.ContainerPort>[]>;
/**
* Run container in privileged mode.
*/
readonly privileged?: pulumi.Input<boolean>;
/**
* Publish all ports of the container.
*/
readonly publishAllPorts?: pulumi.Input<boolean>;
/**
* If true, this volume will be readonly.
* Defaults to false.
*/
readonly readOnly?: pulumi.Input<boolean>;
/**
* The restart policy for the container. Must be
* one of "no", "on-failure", "always", "unless-stopped".
*/
readonly restart?: pulumi.Input<string>;
readonly rm?: pulumi.Input<boolean>;
/**
* Size of `/dev/shm` in MBs.
*/
readonly shmSize?: pulumi.Input<number>;
/**
* If true, then the Docker container will be
* started after creation. If false, then the container is only created.
*/
readonly start?: pulumi.Input<boolean>;
/**
* A map of kernel parameters (sysctls) to set in the container.
*/
readonly sysctls?: pulumi.Input<{[key: string]: any}>;
/**
* A map of container directories which should be replaced by `tmpfs mounts`, and their corresponding mount options.
*/
readonly tmpfs?: pulumi.Input<{[key: string]: any}>;
/**
* See Ulimits below for
* details.
*/
readonly ulimits?: pulumi.Input<pulumi.Input<inputs.ContainerUlimit>[]>;
/**
* See File Upload below for details.
*/
readonly uploads?: pulumi.Input<pulumi.Input<inputs.ContainerUpload>[]>;
/**
* User used for run the first process. Format is
* `user` or `user:group` which user and group can be passed literraly or
* by name.
*/
readonly user?: pulumi.Input<string>;
/**
* Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
*/
readonly usernsMode?: pulumi.Input<string>;
/**
* See Volumes below for details.
*/
readonly volumes?: pulumi.Input<pulumi.Input<inputs.ContainerVolume>[]>;
/**
* The working directory for commands to run in
*/
readonly workingDir?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Container resource.
*/
export interface ContainerArgs {
/**
* If true attach to the container after its creation and waits the end of his execution.
*/
readonly attach?: pulumi.Input<boolean>;
/**
* See Capabilities below for details.
*/
readonly capabilities?: pulumi.Input<inputs.ContainerCapabilities>;
/**
* The command to use to start the
* container. For example, to run `/usr/bin/myprogram -f baz.conf` set the
* command to be `["/usr/bin/myprogram", "-f", "baz.conf"]`.
*/
readonly command?: pulumi.Input<pulumi.Input<string>[]>;
/**
* A comma-separated list or hyphen-separated range of CPUs a container can use, e.g. `0-1`.
*/
readonly cpuSet?: pulumi.Input<string>;
/**
* CPU shares (relative weight) for the container.
*/
readonly cpuShares?: pulumi.Input<number>;
/**
* If defined will attempt to stop the container before destroying. Container will be destroyed after `n` seconds or on successful stop.
*/
readonly destroyGraceSeconds?: pulumi.Input<number>;
/**
* See Devices below for details.
*/
readonly devices?: pulumi.Input<pulumi.Input<inputs.ContainerDevice>[]>;
/**
* Set of DNS servers.
*/
readonly dns?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Set of DNS options used by the DNS provider(s), see `resolv.conf` documentation for valid list of options.
*/
readonly dnsOpts?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Set of DNS search domains that are used when bare unqualified hostnames are used inside of the container.
*/
readonly dnsSearches?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Domain name of the container.
*/
readonly domainname?: pulumi.Input<string>;
/**
* The command to use as the
* Entrypoint for the container. The Entrypoint allows you to configure a
* container to run as an executable. For example, to run `/usr/bin/myprogram`
* when starting a container, set the entrypoint to be
* `["/usr/bin/myprogram"]`.
*/
readonly entrypoints?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Environment variables to set.
*/
readonly envs?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Add additional groups to run as.
*/
readonly groupAdds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* See Healthcheck below for details.
*/
readonly healthcheck?: pulumi.Input<inputs.ContainerHealthcheck>;
/**
* Hostname to add.
*/
readonly hosts?: pulumi.Input<pulumi.Input<inputs.ContainerHost>[]>;
/**
* Hostname of the container.
*/
readonly hostname?: pulumi.Input<string>;
/**
* The ID of the image to back this container.
* The easiest way to get this value is to use the `docker..RemoteImage` resource
* as is shown in the example above.
*/
readonly image: pulumi.Input<string>;
/**
* IPC sharing mode for the container. Possible values are: `none`, `private`, `shareable`, `container:<name|id>` or `host`.
*/
readonly ipcMode?: pulumi.Input<string>;
/**
* Adding labels.
*/
readonly labels?: pulumi.Input<pulumi.Input<inputs.ContainerLabel>[]>;
/**
* Set of links for link based
* connectivity between containers that are running on the same host.
* @deprecated The --link flag is a legacy feature of Docker. It may eventually be removed.
*/
readonly links?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The logging driver to use for the container.
* Defaults to "json-file".
*/
readonly logDriver?: pulumi.Input<string>;
/**
* Key/value pairs to use as options for
* the logging driver.
*/
readonly logOpts?: pulumi.Input<{[key: string]: any}>;
/**
* Save the container logs (`attach` must be enabled).
*/
readonly logs?: pulumi.Input<boolean>;
/**
* The maximum amount of times to an attempt
* a restart when `restart` is set to "on-failure"
*/
readonly maxRetryCount?: pulumi.Input<number>;
/**
* The memory limit for the container in MBs.
*/
readonly memory?: pulumi.Input<number>;
readonly memorySwap?: pulumi.Input<number>;
/**
* See Mounts below for details.
*/
readonly mounts?: pulumi.Input<pulumi.Input<inputs.ContainerMount>[]>;
readonly mustRun?: pulumi.Input<boolean>;
readonly name?: pulumi.Input<string>;
/**
* Network aliases of the container for user-defined networks only. *Deprecated:* use `networksAdvanced` instead.
* @deprecated Use networks_advanced instead. Will be removed in v2.0.0
*/
readonly networkAliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Network mode of the container.
*/
readonly networkMode?: pulumi.Input<string>;
/**
* Id of the networks in which the
* container is. *Deprecated:* use `networksAdvanced` instead.
* @deprecated Use networks_advanced instead. Will be removed in v2.0.0
*/
readonly networks?: pulumi.Input<pulumi.Input<string>[]>;
/**
* See Networks Advanced below for details. If this block has priority to the deprecated `networkAlias` and `network` properties.
*/
readonly networksAdvanced?: pulumi.Input<pulumi.Input<inputs.ContainerNetworksAdvanced>[]>;
/**
* The PID (Process) Namespace mode for the container. Either `container:<name|id>` or `host`.
*/
readonly pidMode?: pulumi.Input<string>;
/**
* See Ports below for details.
*/
readonly ports?: pulumi.Input<pulumi.Input<inputs.ContainerPort>[]>;
/**
* Run container in privileged mode.
*/
readonly privileged?: pulumi.Input<boolean>;
/**
* Publish all ports of the container.
*/
readonly publishAllPorts?: pulumi.Input<boolean>;
/**
* If true, this volume will be readonly.
* Defaults to false.
*/
readonly readOnly?: pulumi.Input<boolean>;
/**
* The restart policy for the container. Must be
* one of "no", "on-failure", "always", "unless-stopped".
*/
readonly restart?: pulumi.Input<string>;
readonly rm?: pulumi.Input<boolean>;
/**
* Size of `/dev/shm` in MBs.
*/
readonly shmSize?: pulumi.Input<number>;
/**
* If true, then the Docker container will be
* started after creation. If false, then the container is only created.
*/
readonly start?: pulumi.Input<boolean>;
/**
* A map of kernel parameters (sysctls) to set in the container.
*/
readonly sysctls?: pulumi.Input<{[key: string]: any}>;
/**
* A map of container directories which should be replaced by `tmpfs mounts`, and their corresponding mount options.
*/
readonly tmpfs?: pulumi.Input<{[key: string]: any}>;
/**
* See Ulimits below for
* details.
*/
readonly ulimits?: pulumi.Input<pulumi.Input<inputs.ContainerUlimit>[]>;
/**
* See File Upload below for details.
*/
readonly uploads?: pulumi.Input<pulumi.Input<inputs.ContainerUpload>[]>;
/**
* User used for run the first process. Format is
* `user` or `user:group` which user and group can be passed literraly or
* by name.
*/
readonly user?: pulumi.Input<string>;
/**
* Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
*/
readonly usernsMode?: pulumi.Input<string>;
/**
* See Volumes below for details.
*/
readonly volumes?: pulumi.Input<pulumi.Input<inputs.ContainerVolume>[]>;
/**
* The working directory for commands to run in
*/
readonly workingDir?: pulumi.Input<string>;
}