@pulumi/docker 4.6.0-beta.1 → 4.6.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/buildx/image.d.ts CHANGED
@@ -6,14 +6,274 @@ import * as enums from "../types/enums";
6
6
  * A Docker image built using buildx -- Docker's interface to the improved
7
7
  * BuildKit backend.
8
8
  *
9
+ * ## Stability
10
+ *
9
11
  * **This resource is experimental and subject to change.**
10
12
  *
11
13
  * API types are unstable. Subsequent releases _may_ require manual edits
12
14
  * to your state file(s) in order to adopt API changes.
13
15
  *
16
+ * `retainOnDelete: true` is recommended with this resource until it is
17
+ * stable. This enables future API changes to be adopted more easily by renaming
18
+ * resources.
19
+ *
14
20
  * Only use this resource if you understand and accept the risks.
15
21
  *
22
+ * ## Migrating v3 and v4 Image resources
23
+ *
24
+ * The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
25
+ * Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
26
+ *
27
+ * ### Behavioral differences
28
+ *
29
+ * There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
30
+ *
31
+ * #### Previews
32
+ *
33
+ * Version `3.x` of the Pulumi Docker provider always builds images during preview operations.
34
+ * This is helpful as a safeguard to prevent "broken" images from merging, but users found the behavior unnecessarily redundant when running previews and updates locally.
35
+ *
36
+ * Version `4.x` changed build-on-preview behavior to be opt-in.
37
+ * By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
38
+ * Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
39
+ *
40
+ * The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
41
+ * By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
42
+ * Previews run in non-CI environments will not build images.
43
+ * This behavior is still configurable with `buildOnPreview`.
44
+ *
45
+ * #### Push behavior
46
+ *
47
+ * Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
48
+ * They expose a `skipPush: true` option to disable pushing.
49
+ *
50
+ * The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
51
+ *
52
+ * To push images to a registry you can include `push: true` (equivalent to Docker's `--push` flag) or configure an `export` of type `registry` (equivalent to Docker's `--output type=registry`).
53
+ * Like Docker, if an image is configured without exports you will see a warning with instructions for how to enable pushing, but the build will still proceed normally.
54
+ *
55
+ * #### Secrets
56
+ *
57
+ * Version `3.x` of the Pulumi Docker provider supports secrets by way of the `extraOptions` field.
58
+ *
59
+ * Version `4.x` of the Pulumi Docker provider does not support secrets.
60
+ *
61
+ * The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
62
+ * Instead, they should be passed directly as values.
63
+ * (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
64
+ * Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
65
+ *
66
+ * #### Caching
67
+ *
68
+ * Version `3.x` of the Pulumi Docker provider exposes `cacheFrom: bool | { stages: [...] }`.
69
+ * It builds targets individually and pushes them to separate images for caching.
70
+ *
71
+ * Version `4.x` exposes a similar parameter `cacheFrom: { images: [...] }` which pushes and pulls inline caches.
72
+ *
73
+ * Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
74
+ * This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
75
+ *
76
+ * The `buildx.Image` resource delegates all caching behavior to Docker.
77
+ * `cacheFrom` and `cacheTo` options (equivalent to Docker's `--cache-to` and `--cache-from`) are exposed and provide additional cache targets, such as local disk, S3 storage, etc.
78
+ *
79
+ * #### Outputs
80
+ *
81
+ * TODO:
82
+ *
83
+ * #### Tag deletion and refreshes
84
+ *
85
+ * Versions 3 and 4 of Pulumi Docker provider do not delete tags when the `Image` resource is deleted, nor do they confirm expected tags exist during `refresh` operations.
86
+ *
87
+ * The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
88
+ * If any are missing a subsequent `update` will push them.
89
+ *
90
+ * When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
91
+ * Deletion of remote tags is not guaranteed, because not all registries currently support this operation (`docker.io` in particular).
92
+ *
93
+ * Use the [`retainOnDelete: true`](https://www.pulumi.com/docs/concepts/options/retainondelete/) option if you do not want tags deleted.
94
+ *
95
+ * ### Example migration
96
+ *
97
+ * Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `buildx.Image` resource showing how they would look after migration.
98
+ *
99
+ * The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
100
+ * After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
101
+ * In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
102
+ *
103
+ * The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
104
+ * It it is shown with parameters similar to the `v3` example for completeness.
105
+ *
16
106
  * ## Example Usage
107
+ * ### v3/v4 migration
108
+ *
109
+ * ```typescript
110
+ *
111
+ * // v3 Image
112
+ * const v3 = new docker.Image("v3-image", {
113
+ * imageName: "myregistry.com/user/repo:latest",
114
+ * localImageName: "local-tag",
115
+ * skipPush: false,
116
+ * build: {
117
+ * dockerfile: "./Dockerfile",
118
+ * context: "../app",
119
+ * target: "mytarget",
120
+ * args: {
121
+ * MY_BUILD_ARG: "foo",
122
+ * },
123
+ * env: {
124
+ * DOCKER_BUILDKIT: "1",
125
+ * },
126
+ * extraOptions: [
127
+ * "--cache-from",
128
+ * "type=registry,myregistry.com/user/repo:cache",
129
+ * "--cache-to",
130
+ * "type=registry,myregistry.com/user/repo:cache",
131
+ * "--add-host",
132
+ * "metadata.google.internal:169.254.169.254",
133
+ * "--secret",
134
+ * "id=mysecret,src=/local/secret",
135
+ * "--ssh",
136
+ * "default=/home/runner/.ssh/id_ed25519",
137
+ * "--network",
138
+ * "host",
139
+ * "--platform",
140
+ * "linux/amd64",
141
+ * ],
142
+ * },
143
+ * registry: {
144
+ * server: "myregistry.com",
145
+ * username: "username",
146
+ * password: pulumi.secret("password"),
147
+ * },
148
+ * });
149
+ *
150
+ * // v3 Image after migrating to buildx.Image
151
+ * const v3Migrated = new docker.buildx.Image("v3-to-buildx", {
152
+ * tags: ["myregistry.com/user/repo:latest", "local-tag"],
153
+ * push: true,
154
+ * dockerfile: {
155
+ * location: "./Dockerfile",
156
+ * },
157
+ * context: {
158
+ * location: "../app",
159
+ * },
160
+ * targets: ["mytarget"],
161
+ * buildArgs: {
162
+ * MY_BUILD_ARG: "foo",
163
+ * },
164
+ * cacheFrom: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
165
+ * cacheTo: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
166
+ * secrets: {
167
+ * mysecret: "value",
168
+ * },
169
+ * addHosts: ["metadata.google.internal:169.254.169.254"],
170
+ * ssh: {
171
+ * default: ["/home/runner/.ssh/id_ed25519"],
172
+ * },
173
+ * network: "host",
174
+ * platforms: ["linux/amd64"],
175
+ * registries: [{
176
+ * address: "myregistry.com",
177
+ * username: "username",
178
+ * password: pulumi.secret("password"),
179
+ * }],
180
+ * });
181
+ *
182
+ *
183
+ * // v4 Image
184
+ * const v4 = new docker.Image("v4-image", {
185
+ * imageName: "myregistry.com/user/repo:latest",
186
+ * skipPush: false,
187
+ * build: {
188
+ * dockerfile: "./Dockerfile",
189
+ * context: "../app",
190
+ * target: "mytarget",
191
+ * args: {
192
+ * MY_BUILD_ARG: "foo",
193
+ * },
194
+ * cacheFrom: {
195
+ * images: ["myregistry.com/user/repo:cache"],
196
+ * },
197
+ * addHosts: ["metadata.google.internal:169.254.169.254"],
198
+ * network: "host",
199
+ * platform: "linux/amd64",
200
+ * },
201
+ * buildOnPreview: true,
202
+ * registry: {
203
+ * server: "myregistry.com",
204
+ * username: "username",
205
+ * password: pulumi.secret("password"),
206
+ * },
207
+ * });
208
+ *
209
+ * // v4 Image after migrating to buildx.Image
210
+ * const v4Migrated = new docker.buildx.Image("v4-to-buildx", {
211
+ * tags: ["myregistry.com/user/repo:latest"],
212
+ * push: true,
213
+ * dockerfile: {
214
+ * location: "./Dockerfile",
215
+ * },
216
+ * context: {
217
+ * location: "../app",
218
+ * },
219
+ * targets: ["mytarget"],
220
+ * buildArgs: {
221
+ * MY_BUILD_ARG: "foo",
222
+ * },
223
+ * cacheFrom: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
224
+ * cacheTo: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
225
+ * addHosts: ["metadata.google.internal:169.254.169.254"],
226
+ * network: "host",
227
+ * platforms: ["linux/amd64"],
228
+ * registries: [{
229
+ * address: "myregistry.com",
230
+ * username: "username",
231
+ * password: pulumi.secret("password"),
232
+ * }],
233
+ * });
234
+ *
235
+ * ```
236
+ *
237
+ * ## Example Usage
238
+ * ### Push to AWS ECR with caching
239
+ *
240
+ * ```typescript
241
+ * import * as pulumi from "@pulumi/pulumi";
242
+ * import * as aws from "@pulumi/aws";
243
+ * import * as docker from "@pulumi/docker";
244
+ *
245
+ * const ecrRepository = new aws.ecr.Repository("ecr-repository", {});
246
+ * const authToken = aws.ecr.getAuthorizationTokenOutput({
247
+ * registryId: ecrRepository.registryId,
248
+ * });
249
+ * const myImage = new docker.buildx.Image("my-image", {
250
+ * cacheFrom: [{
251
+ * registry: {
252
+ * ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
253
+ * },
254
+ * }],
255
+ * cacheTo: [{
256
+ * registry: {
257
+ * imageManifest: true,
258
+ * ociMediaTypes: true,
259
+ * ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
260
+ * },
261
+ * }],
262
+ * context: {
263
+ * location: "./app",
264
+ * },
265
+ * dockerfile: {
266
+ * location: "./Dockerfile",
267
+ * },
268
+ * push: true,
269
+ * registries: [{
270
+ * address: ecrRepository.repositoryUrl,
271
+ * password: authToken.apply(authToken => authToken.password),
272
+ * username: authToken.apply(authToken => authToken.userName),
273
+ * }],
274
+ * tags: [pulumi.interpolate`${ecrRepository.repositoryUrl}:latest`],
275
+ * });
276
+ * ```
17
277
  * ### Multi-platform image
18
278
  *
19
279
  * ```typescript
@@ -24,9 +284,6 @@ import * as enums from "../types/enums";
24
284
  * context: {
25
285
  * location: "app",
26
286
  * },
27
- * dockerfile: {
28
- * location: "app/Dockerfile",
29
- * },
30
287
  * platforms: [
31
288
  * docker.buildx.image.Platform.Plan9_amd64,
32
289
  * docker.buildx.image.Platform.Plan9_386,
@@ -43,19 +300,13 @@ import * as enums from "../types/enums";
43
300
  * context: {
44
301
  * location: "app",
45
302
  * },
46
- * dockerfile: {
47
- * location: "app/Dockerfile",
48
- * },
49
- * exports: [{
50
- * registry: {
51
- * ociMediaTypes: true,
52
- * },
53
- * }],
303
+ * push: true,
54
304
  * registries: [{
55
305
  * address: "docker.io",
56
306
  * password: dockerHubPassword,
57
307
  * username: "pulumibot",
58
308
  * }],
309
+ * tags: ["docker.io/pulumi/pulumi:3.107.0"],
59
310
  * });
60
311
  * ```
61
312
  * ### Caching
@@ -79,9 +330,6 @@ import * as enums from "../types/enums";
79
330
  * context: {
80
331
  * location: "app",
81
332
  * },
82
- * dockerfile: {
83
- * location: "app/Dockerfile",
84
- * },
85
333
  * });
86
334
  * ```
87
335
  * ### Build arguments
@@ -97,9 +345,6 @@ import * as enums from "../types/enums";
97
345
  * context: {
98
346
  * location: "app",
99
347
  * },
100
- * dockerfile: {
101
- * location: "app/Dockerfile",
102
- * },
103
348
  * });
104
349
  * ```
105
350
  * ### Build targets
@@ -112,9 +357,6 @@ import * as enums from "../types/enums";
112
357
  * context: {
113
358
  * location: "app",
114
359
  * },
115
- * dockerfile: {
116
- * location: "app/Dockerfile",
117
- * },
118
360
  * targets: [
119
361
  * "build-me",
120
362
  * "also-build-me",
@@ -127,19 +369,14 @@ import * as enums from "../types/enums";
127
369
  * import * as pulumi from "@pulumi/pulumi";
128
370
  * import * as docker from "@pulumi/docker";
129
371
  *
130
- * const image = new docker.buildx.Image("image", {
131
- * context: {
132
- * location: "app",
133
- * named: {
134
- * "golang:latest": {
135
- * location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
136
- * },
372
+ * const image = new docker.buildx.Image("image", {context: {
373
+ * location: "app",
374
+ * named: {
375
+ * "golang:latest": {
376
+ * location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
137
377
  * },
138
378
  * },
139
- * dockerfile: {
140
- * location: "app/Dockerfile",
141
- * },
142
- * });
379
+ * }});
143
380
  * ```
144
381
  * ### Remote context
145
382
  *
@@ -193,9 +430,6 @@ import * as enums from "../types/enums";
193
430
  * context: {
194
431
  * location: "app",
195
432
  * },
196
- * dockerfile: {
197
- * location: "app/Dockerfile",
198
- * },
199
433
  * exports: [{
200
434
  * docker: {
201
435
  * tar: true,
@@ -219,6 +453,12 @@ export declare class Image extends pulumi.CustomResource {
219
453
  * when multiple copies of the Pulumi SDK have been loaded into the same process.
220
454
  */
221
455
  static isInstance(obj: any): obj is Image;
456
+ /**
457
+ * Custom `host:ip` mappings to use during the build.
458
+ *
459
+ * Equivalent to Docker's `--add-host` flag.
460
+ */
461
+ readonly addHosts: pulumi.Output<string[] | undefined>;
222
462
  /**
223
463
  * `ARG` names and values to set during the build.
224
464
  *
@@ -227,13 +467,27 @@ export declare class Image extends pulumi.CustomResource {
227
467
  *
228
468
  * Build arguments are persisted in the image, so you should use `secrets`
229
469
  * if these arguments are sensitive.
470
+ *
471
+ * Equivalent to Docker's `--build-arg` flag.
230
472
  */
231
473
  readonly buildArgs: pulumi.Output<{
232
474
  [key: string]: string;
233
475
  } | undefined>;
234
476
  /**
235
- * When `true`, attempt to build the image during previews. The image will
236
- * not be pushed to registries, however caches will still populated.
477
+ * By default, preview behavior depends on the execution environment. If
478
+ * Pulumi detects the operation is running on a CI system (GitHub Actions,
479
+ * Travis CI, Azure Pipelines, etc.) then it will build images during
480
+ * previews as a safeguard. Otherwise, if not running on CI, previews will
481
+ * not build images.
482
+ *
483
+ * Setting this to `false` forces previews to never perform builds, and
484
+ * setting it to `true` will always build the image during previews.
485
+ *
486
+ * Images built during previews are never exported to registries, however
487
+ * cache manifests are still exported.
488
+ *
489
+ * On-disk Dockerfiles are always validated for syntactic correctness
490
+ * regardless of this setting.
237
491
  */
238
492
  readonly buildOnPreview: pulumi.Output<boolean | undefined>;
239
493
  /**
@@ -241,15 +495,21 @@ export declare class Image extends pulumi.CustomResource {
241
495
  */
242
496
  readonly builder: pulumi.Output<outputs.buildx.BuilderConfig | undefined>;
243
497
  /**
244
- * External cache configuration.
498
+ * Cache export configuration.
499
+ *
500
+ * Equivalent to Docker's `--cache-from` flag.
245
501
  */
246
502
  readonly cacheFrom: pulumi.Output<outputs.buildx.CacheFromEntry[] | undefined>;
247
503
  /**
248
- * Cache export configuration.
504
+ * Cache import configuration.
505
+ *
506
+ * Equivalent to Docker's `--cache-to` flag.
249
507
  */
250
508
  readonly cacheTo: pulumi.Output<outputs.buildx.CacheToEntry[] | undefined>;
251
509
  /**
252
510
  * Build context settings.
511
+ *
512
+ * Equivalent to Docker's `PATH | URL | -` positional argument.
253
513
  */
254
514
  readonly context: pulumi.Output<outputs.buildx.BuildContext | undefined>;
255
515
  /**
@@ -257,15 +517,21 @@ export declare class Image extends pulumi.CustomResource {
257
517
  *
258
518
  * Pulumi uses this to determine if an image _may_ need to be re-built.
259
519
  */
260
- readonly contextHash: pulumi.Output<string | undefined>;
520
+ readonly contextHash: pulumi.Output<string>;
261
521
  /**
262
- * A mapping of platform type to refs which were pushed to registries.
522
+ * A mapping of target names to the SHA256 digest of their pushed manifest.
523
+ *
524
+ * If no target was specified 'default' is used as the target name.
525
+ *
526
+ * Pushed manifests can be referenced as `<tag>@<digest>`.
263
527
  */
264
528
  readonly digests: pulumi.Output<{
265
- [key: string]: string[];
266
- } | undefined>;
529
+ [key: string]: string;
530
+ }>;
267
531
  /**
268
532
  * Dockerfile settings.
533
+ *
534
+ * Equivalent to Docker's `--file` flag.
269
535
  */
270
536
  readonly dockerfile: pulumi.Output<outputs.buildx.Dockerfile | undefined>;
271
537
  /**
@@ -273,25 +539,80 @@ export declare class Image extends pulumi.CustomResource {
273
539
  *
274
540
  * Images are only stored in the local cache unless `exports` are
275
541
  * explicitly configured.
542
+ *
543
+ * Equivalent to Docker's `--output` flag.
276
544
  */
277
545
  readonly exports: pulumi.Output<outputs.buildx.ExportEntry[] | undefined>;
278
546
  /**
279
547
  * Attach arbitrary key/value metadata to the image.
548
+ *
549
+ * Equivalent to Docker's `--label` flag.
280
550
  */
281
551
  readonly labels: pulumi.Output<{
282
552
  [key: string]: string;
283
553
  } | undefined>;
284
554
  /**
285
- * Set target platform(s) for the build. Defaults to the host's platform
555
+ * When `true` the build will automatically include a `docker` export.
556
+ *
557
+ * Defaults to `false`.
558
+ *
559
+ * Equivalent to Docker's `--load` flag.
560
+ */
561
+ readonly load: pulumi.Output<boolean | undefined>;
562
+ /**
563
+ * Set the network mode for `RUN` instructions. Defaults to `default`.
564
+ *
565
+ * For custom networks, configure your builder with `--driver-opt network=...`.
566
+ *
567
+ * Equivalent to Docker's `--network` flag.
568
+ */
569
+ readonly network: pulumi.Output<enums.buildx.NetworkMode | undefined>;
570
+ /**
571
+ * Do not import cache manifests when building the image.
572
+ *
573
+ * Equivalent to Docker's `--no-cache` flag.
574
+ */
575
+ readonly noCache: pulumi.Output<boolean | undefined>;
576
+ /**
577
+ * Set target platform(s) for the build. Defaults to the host's platform.
578
+ *
579
+ * Equivalent to Docker's `--platform` flag.
286
580
  */
287
581
  readonly platforms: pulumi.Output<enums.buildx.Platform[] | undefined>;
288
582
  /**
289
583
  * Always pull referenced images.
584
+ *
585
+ * Equivalent to Docker's `--pull` flag.
290
586
  */
291
587
  readonly pull: pulumi.Output<boolean | undefined>;
588
+ /**
589
+ * When `true` the build will automatically include a `registry` export.
590
+ *
591
+ * Defaults to `false`.
592
+ *
593
+ * Equivalent to Docker's `--push` flag.
594
+ */
595
+ readonly push: pulumi.Output<boolean | undefined>;
596
+ /**
597
+ * If the image was pushed to any registries then this will contain a
598
+ * single fully-qualified tag including the build's digest.
599
+ *
600
+ * This is only for convenience and may not be appropriate for situations
601
+ * where multiple tags or registries are involved. In those cases this
602
+ * output is not guaranteed to be stable.
603
+ *
604
+ * For more control over tags consumed by downstream resources you should
605
+ * use the `Digests` output.
606
+ */
607
+ readonly ref: pulumi.Output<string>;
292
608
  /**
293
609
  * Registry credentials. Required if reading or exporting to private
294
610
  * repositories.
611
+ *
612
+ * Credentials are kept in-memory and do not pollute pre-existing
613
+ * credentials on the host.
614
+ *
615
+ * Similar to `docker login`.
295
616
  */
296
617
  readonly registries: pulumi.Output<outputs.buildx.RegistryAuth[] | undefined>;
297
618
  /**
@@ -302,21 +623,33 @@ export declare class Image extends pulumi.CustomResource {
302
623
  *
303
624
  * Build arguments and environment variables are persistent in the final
304
625
  * image, so you should use this for sensitive values.
626
+ *
627
+ * Similar to Docker's `--secret` flag.
305
628
  */
306
629
  readonly secrets: pulumi.Output<{
307
630
  [key: string]: string;
308
631
  } | undefined>;
632
+ /**
633
+ * SSH agent socket or keys to expose to the build.
634
+ *
635
+ * Equivalent to Docker's `--ssh` flag.
636
+ */
637
+ readonly ssh: pulumi.Output<outputs.buildx.SSH[] | undefined>;
309
638
  /**
310
639
  * Name and optionally a tag (format: `name:tag`).
311
640
  *
312
641
  * If exporting to a registry, the name should include the fully qualified
313
642
  * registry address (e.g. `docker.io/pulumi/pulumi:latest`).
643
+ *
644
+ * Equivalent to Docker's `--tag` flag.
314
645
  */
315
646
  readonly tags: pulumi.Output<string[] | undefined>;
316
647
  /**
317
648
  * Set the target build stage(s) to build.
318
649
  *
319
650
  * If not specified all targets will be built by default.
651
+ *
652
+ * Equivalent to Docker's `--target` flag.
320
653
  */
321
654
  readonly targets: pulumi.Output<string[] | undefined>;
322
655
  /**
@@ -332,6 +665,12 @@ export declare class Image extends pulumi.CustomResource {
332
665
  * The set of arguments for constructing a Image resource.
333
666
  */
334
667
  export interface ImageArgs {
668
+ /**
669
+ * Custom `host:ip` mappings to use during the build.
670
+ *
671
+ * Equivalent to Docker's `--add-host` flag.
672
+ */
673
+ addHosts?: pulumi.Input<pulumi.Input<string>[]>;
335
674
  /**
336
675
  * `ARG` names and values to set during the build.
337
676
  *
@@ -340,13 +679,27 @@ export interface ImageArgs {
340
679
  *
341
680
  * Build arguments are persisted in the image, so you should use `secrets`
342
681
  * if these arguments are sensitive.
682
+ *
683
+ * Equivalent to Docker's `--build-arg` flag.
343
684
  */
344
685
  buildArgs?: pulumi.Input<{
345
686
  [key: string]: pulumi.Input<string>;
346
687
  }>;
347
688
  /**
348
- * When `true`, attempt to build the image during previews. The image will
349
- * not be pushed to registries, however caches will still populated.
689
+ * By default, preview behavior depends on the execution environment. If
690
+ * Pulumi detects the operation is running on a CI system (GitHub Actions,
691
+ * Travis CI, Azure Pipelines, etc.) then it will build images during
692
+ * previews as a safeguard. Otherwise, if not running on CI, previews will
693
+ * not build images.
694
+ *
695
+ * Setting this to `false` forces previews to never perform builds, and
696
+ * setting it to `true` will always build the image during previews.
697
+ *
698
+ * Images built during previews are never exported to registries, however
699
+ * cache manifests are still exported.
700
+ *
701
+ * On-disk Dockerfiles are always validated for syntactic correctness
702
+ * regardless of this setting.
350
703
  */
351
704
  buildOnPreview?: pulumi.Input<boolean>;
352
705
  /**
@@ -354,19 +707,27 @@ export interface ImageArgs {
354
707
  */
355
708
  builder?: pulumi.Input<inputs.buildx.BuilderConfig>;
356
709
  /**
357
- * External cache configuration.
710
+ * Cache export configuration.
711
+ *
712
+ * Equivalent to Docker's `--cache-from` flag.
358
713
  */
359
714
  cacheFrom?: pulumi.Input<pulumi.Input<inputs.buildx.CacheFromEntry>[]>;
360
715
  /**
361
- * Cache export configuration.
716
+ * Cache import configuration.
717
+ *
718
+ * Equivalent to Docker's `--cache-to` flag.
362
719
  */
363
720
  cacheTo?: pulumi.Input<pulumi.Input<inputs.buildx.CacheToEntry>[]>;
364
721
  /**
365
722
  * Build context settings.
723
+ *
724
+ * Equivalent to Docker's `PATH | URL | -` positional argument.
366
725
  */
367
726
  context?: pulumi.Input<inputs.buildx.BuildContext>;
368
727
  /**
369
728
  * Dockerfile settings.
729
+ *
730
+ * Equivalent to Docker's `--file` flag.
370
731
  */
371
732
  dockerfile?: pulumi.Input<inputs.buildx.Dockerfile>;
372
733
  /**
@@ -374,25 +735,68 @@ export interface ImageArgs {
374
735
  *
375
736
  * Images are only stored in the local cache unless `exports` are
376
737
  * explicitly configured.
738
+ *
739
+ * Equivalent to Docker's `--output` flag.
377
740
  */
378
741
  exports?: pulumi.Input<pulumi.Input<inputs.buildx.ExportEntry>[]>;
379
742
  /**
380
743
  * Attach arbitrary key/value metadata to the image.
744
+ *
745
+ * Equivalent to Docker's `--label` flag.
381
746
  */
382
747
  labels?: pulumi.Input<{
383
748
  [key: string]: pulumi.Input<string>;
384
749
  }>;
385
750
  /**
386
- * Set target platform(s) for the build. Defaults to the host's platform
751
+ * When `true` the build will automatically include a `docker` export.
752
+ *
753
+ * Defaults to `false`.
754
+ *
755
+ * Equivalent to Docker's `--load` flag.
756
+ */
757
+ load?: pulumi.Input<boolean>;
758
+ /**
759
+ * Set the network mode for `RUN` instructions. Defaults to `default`.
760
+ *
761
+ * For custom networks, configure your builder with `--driver-opt network=...`.
762
+ *
763
+ * Equivalent to Docker's `--network` flag.
764
+ */
765
+ network?: pulumi.Input<enums.buildx.NetworkMode>;
766
+ /**
767
+ * Do not import cache manifests when building the image.
768
+ *
769
+ * Equivalent to Docker's `--no-cache` flag.
770
+ */
771
+ noCache?: pulumi.Input<boolean>;
772
+ /**
773
+ * Set target platform(s) for the build. Defaults to the host's platform.
774
+ *
775
+ * Equivalent to Docker's `--platform` flag.
387
776
  */
388
777
  platforms?: pulumi.Input<pulumi.Input<enums.buildx.Platform>[]>;
389
778
  /**
390
779
  * Always pull referenced images.
780
+ *
781
+ * Equivalent to Docker's `--pull` flag.
391
782
  */
392
783
  pull?: pulumi.Input<boolean>;
784
+ /**
785
+ * When `true` the build will automatically include a `registry` export.
786
+ *
787
+ * Defaults to `false`.
788
+ *
789
+ * Equivalent to Docker's `--push` flag.
790
+ */
791
+ push?: pulumi.Input<boolean>;
393
792
  /**
394
793
  * Registry credentials. Required if reading or exporting to private
395
794
  * repositories.
795
+ *
796
+ * Credentials are kept in-memory and do not pollute pre-existing
797
+ * credentials on the host.
798
+ *
799
+ * Similar to `docker login`.
396
800
  */
397
801
  registries?: pulumi.Input<pulumi.Input<inputs.buildx.RegistryAuth>[]>;
398
802
  /**
@@ -403,21 +807,33 @@ export interface ImageArgs {
403
807
  *
404
808
  * Build arguments and environment variables are persistent in the final
405
809
  * image, so you should use this for sensitive values.
810
+ *
811
+ * Similar to Docker's `--secret` flag.
406
812
  */
407
813
  secrets?: pulumi.Input<{
408
814
  [key: string]: pulumi.Input<string>;
409
815
  }>;
816
+ /**
817
+ * SSH agent socket or keys to expose to the build.
818
+ *
819
+ * Equivalent to Docker's `--ssh` flag.
820
+ */
821
+ ssh?: pulumi.Input<pulumi.Input<inputs.buildx.SSH>[]>;
410
822
  /**
411
823
  * Name and optionally a tag (format: `name:tag`).
412
824
  *
413
825
  * If exporting to a registry, the name should include the fully qualified
414
826
  * registry address (e.g. `docker.io/pulumi/pulumi:latest`).
827
+ *
828
+ * Equivalent to Docker's `--tag` flag.
415
829
  */
416
830
  tags?: pulumi.Input<pulumi.Input<string>[]>;
417
831
  /**
418
832
  * Set the target build stage(s) to build.
419
833
  *
420
834
  * If not specified all targets will be built by default.
835
+ *
836
+ * Equivalent to Docker's `--target` flag.
421
837
  */
422
838
  targets?: pulumi.Input<pulumi.Input<string>[]>;
423
839
  }