@pulumi/docker 4.6.0-alpha.4 → 4.6.0-beta.1

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
@@ -1,8 +1,208 @@
1
1
  import * as pulumi from "@pulumi/pulumi";
2
2
  import * as inputs from "../types/input";
3
3
  import * as outputs from "../types/output";
4
+ import * as enums from "../types/enums";
4
5
  /**
5
- * A Docker image built using Buildkit
6
+ * A Docker image built using buildx -- Docker's interface to the improved
7
+ * BuildKit backend.
8
+ *
9
+ * **This resource is experimental and subject to change.**
10
+ *
11
+ * API types are unstable. Subsequent releases _may_ require manual edits
12
+ * to your state file(s) in order to adopt API changes.
13
+ *
14
+ * Only use this resource if you understand and accept the risks.
15
+ *
16
+ * ## Example Usage
17
+ * ### Multi-platform image
18
+ *
19
+ * ```typescript
20
+ * import * as pulumi from "@pulumi/pulumi";
21
+ * import * as docker from "@pulumi/docker";
22
+ *
23
+ * const image = new docker.buildx.Image("image", {
24
+ * context: {
25
+ * location: "app",
26
+ * },
27
+ * dockerfile: {
28
+ * location: "app/Dockerfile",
29
+ * },
30
+ * platforms: [
31
+ * docker.buildx.image.Platform.Plan9_amd64,
32
+ * docker.buildx.image.Platform.Plan9_386,
33
+ * ],
34
+ * });
35
+ * ```
36
+ * ### Registry export
37
+ *
38
+ * ```typescript
39
+ * import * as pulumi from "@pulumi/pulumi";
40
+ * import * as docker from "@pulumi/docker";
41
+ *
42
+ * const image = new docker.buildx.Image("image", {
43
+ * context: {
44
+ * location: "app",
45
+ * },
46
+ * dockerfile: {
47
+ * location: "app/Dockerfile",
48
+ * },
49
+ * exports: [{
50
+ * registry: {
51
+ * ociMediaTypes: true,
52
+ * },
53
+ * }],
54
+ * registries: [{
55
+ * address: "docker.io",
56
+ * password: dockerHubPassword,
57
+ * username: "pulumibot",
58
+ * }],
59
+ * });
60
+ * ```
61
+ * ### Caching
62
+ *
63
+ * ```typescript
64
+ * import * as pulumi from "@pulumi/pulumi";
65
+ * import * as docker from "@pulumi/docker";
66
+ *
67
+ * const image = new docker.buildx.Image("image", {
68
+ * cacheFrom: [{
69
+ * local: {
70
+ * src: "tmp/cache",
71
+ * },
72
+ * }],
73
+ * cacheTo: [{
74
+ * local: {
75
+ * dest: "tmp/cache",
76
+ * mode: docker.buildx.image.CacheMode.Max,
77
+ * },
78
+ * }],
79
+ * context: {
80
+ * location: "app",
81
+ * },
82
+ * dockerfile: {
83
+ * location: "app/Dockerfile",
84
+ * },
85
+ * });
86
+ * ```
87
+ * ### Build arguments
88
+ *
89
+ * ```typescript
90
+ * import * as pulumi from "@pulumi/pulumi";
91
+ * import * as docker from "@pulumi/docker";
92
+ *
93
+ * const image = new docker.buildx.Image("image", {
94
+ * buildArgs: {
95
+ * SET_ME_TO_TRUE: "true",
96
+ * },
97
+ * context: {
98
+ * location: "app",
99
+ * },
100
+ * dockerfile: {
101
+ * location: "app/Dockerfile",
102
+ * },
103
+ * });
104
+ * ```
105
+ * ### Build targets
106
+ *
107
+ * ```typescript
108
+ * import * as pulumi from "@pulumi/pulumi";
109
+ * import * as docker from "@pulumi/docker";
110
+ *
111
+ * const image = new docker.buildx.Image("image", {
112
+ * context: {
113
+ * location: "app",
114
+ * },
115
+ * dockerfile: {
116
+ * location: "app/Dockerfile",
117
+ * },
118
+ * targets: [
119
+ * "build-me",
120
+ * "also-build-me",
121
+ * ],
122
+ * });
123
+ * ```
124
+ * ### Named contexts
125
+ *
126
+ * ```typescript
127
+ * import * as pulumi from "@pulumi/pulumi";
128
+ * import * as docker from "@pulumi/docker";
129
+ *
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
+ * },
137
+ * },
138
+ * },
139
+ * dockerfile: {
140
+ * location: "app/Dockerfile",
141
+ * },
142
+ * });
143
+ * ```
144
+ * ### Remote context
145
+ *
146
+ * ```typescript
147
+ * import * as pulumi from "@pulumi/pulumi";
148
+ * import * as docker from "@pulumi/docker";
149
+ *
150
+ * const image = new docker.buildx.Image("image", {context: {
151
+ * location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
152
+ * }});
153
+ * ```
154
+ * ### Inline Dockerfile
155
+ *
156
+ * ```typescript
157
+ * import * as pulumi from "@pulumi/pulumi";
158
+ * import * as docker from "@pulumi/docker";
159
+ *
160
+ * const image = new docker.buildx.Image("image", {
161
+ * context: {
162
+ * location: "app",
163
+ * },
164
+ * dockerfile: {
165
+ * inline: `FROM busybox
166
+ * COPY hello.c ./
167
+ * `,
168
+ * },
169
+ * });
170
+ * ```
171
+ * ### Remote context
172
+ *
173
+ * ```typescript
174
+ * import * as pulumi from "@pulumi/pulumi";
175
+ * import * as docker from "@pulumi/docker";
176
+ *
177
+ * const image = new docker.buildx.Image("image", {
178
+ * context: {
179
+ * location: "https://github.com/docker-library/hello-world.git",
180
+ * },
181
+ * dockerfile: {
182
+ * location: "app/Dockerfile",
183
+ * },
184
+ * });
185
+ * ```
186
+ * ### Local export
187
+ *
188
+ * ```typescript
189
+ * import * as pulumi from "@pulumi/pulumi";
190
+ * import * as docker from "@pulumi/docker";
191
+ *
192
+ * const image = new docker.buildx.Image("image", {
193
+ * context: {
194
+ * location: "app",
195
+ * },
196
+ * dockerfile: {
197
+ * location: "app/Dockerfile",
198
+ * },
199
+ * exports: [{
200
+ * docker: {
201
+ * tar: true,
202
+ * },
203
+ * }],
204
+ * });
205
+ * ```
6
206
  */
7
207
  export declare class Image extends pulumi.CustomResource {
8
208
  /**
@@ -20,75 +220,105 @@ export declare class Image extends pulumi.CustomResource {
20
220
  */
21
221
  static isInstance(obj: any): obj is Image;
22
222
  /**
223
+ * `ARG` names and values to set during the build.
23
224
  *
24
- * An optional map of named build-time argument variables to set during
25
- * the Docker build. This flag allows you to pass build-time variables that
26
- * can be accessed like environment variables inside the RUN
27
- * instruction.
225
+ * These variables are accessed like environment variables inside `RUN`
226
+ * instructions.
227
+ *
228
+ * Build arguments are persisted in the image, so you should use `secrets`
229
+ * if these arguments are sensitive.
28
230
  */
29
231
  readonly buildArgs: pulumi.Output<{
30
232
  [key: string]: string;
31
233
  } | undefined>;
32
234
  /**
33
- *
34
- * When true, attempt to build the image during previews. Outputs are not
35
- * pushed to registries, however caches are still populated.
235
+ * When `true`, attempt to build the image during previews. The image will
236
+ * not be pushed to registries, however caches will still populated.
36
237
  */
37
238
  readonly buildOnPreview: pulumi.Output<boolean | undefined>;
38
239
  /**
39
- *
40
- * Build with a specific builder instance
240
+ * Builder configuration.
41
241
  */
42
- readonly builder: pulumi.Output<string | undefined>;
242
+ readonly builder: pulumi.Output<outputs.buildx.BuilderConfig | undefined>;
43
243
  /**
44
- *
45
- * External cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir")
244
+ * External cache configuration.
46
245
  */
47
- readonly cacheFrom: pulumi.Output<string[] | undefined>;
246
+ readonly cacheFrom: pulumi.Output<outputs.buildx.CacheFromEntry[] | undefined>;
48
247
  /**
49
- *
50
- * Cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir")
248
+ * Cache export configuration.
249
+ */
250
+ readonly cacheTo: pulumi.Output<outputs.buildx.CacheToEntry[] | undefined>;
251
+ /**
252
+ * Build context settings.
51
253
  */
52
- readonly cacheTo: pulumi.Output<string[] | undefined>;
254
+ readonly context: pulumi.Output<outputs.buildx.BuildContext | undefined>;
53
255
  /**
256
+ * A preliminary hash of the image's build context.
54
257
  *
55
- * Path to use for build context. If omitted, an empty context is used.
258
+ * Pulumi uses this to determine if an image _may_ need to be re-built.
56
259
  */
57
- readonly context: pulumi.Output<string | undefined>;
58
260
  readonly contextHash: pulumi.Output<string | undefined>;
59
261
  /**
60
- *
61
- * Name and optionally a tag (format: "name:tag"). If outputting to a
62
- * registry, the name should include the fully qualified registry address.
262
+ * A mapping of platform type to refs which were pushed to registries.
63
263
  */
64
- readonly exports: pulumi.Output<string[] | undefined>;
264
+ readonly digests: pulumi.Output<{
265
+ [key: string]: string[];
266
+ } | undefined>;
65
267
  /**
66
- *
67
- * Name of the Dockerfile to use (defaults to "${context}/Dockerfile").
268
+ * Dockerfile settings.
68
269
  */
69
- readonly file: pulumi.Output<string | undefined>;
70
- readonly manifests: pulumi.Output<outputs.buildx.Manifest[]>;
270
+ readonly dockerfile: pulumi.Output<outputs.buildx.Dockerfile | undefined>;
71
271
  /**
272
+ * Controls where images are persisted after building.
72
273
  *
73
- * Set target platforms for the build. Defaults to the host's platform
274
+ * Images are only stored in the local cache unless `exports` are
275
+ * explicitly configured.
74
276
  */
75
- readonly platforms: pulumi.Output<string[] | undefined>;
277
+ readonly exports: pulumi.Output<outputs.buildx.ExportEntry[] | undefined>;
76
278
  /**
77
- *
78
- * Always attempt to pull all referenced images
279
+ * Attach arbitrary key/value metadata to the image.
280
+ */
281
+ readonly labels: pulumi.Output<{
282
+ [key: string]: string;
283
+ } | undefined>;
284
+ /**
285
+ * Set target platform(s) for the build. Defaults to the host's platform
286
+ */
287
+ readonly platforms: pulumi.Output<enums.buildx.Platform[] | undefined>;
288
+ /**
289
+ * Always pull referenced images.
79
290
  */
80
291
  readonly pull: pulumi.Output<boolean | undefined>;
81
292
  /**
82
- *
83
- * Logins for registry outputs
293
+ * Registry credentials. Required if reading or exporting to private
294
+ * repositories.
84
295
  */
85
296
  readonly registries: pulumi.Output<outputs.buildx.RegistryAuth[] | undefined>;
86
297
  /**
298
+ * A mapping of secret names to their corresponding values.
299
+ *
300
+ * Unlike the Docker CLI, these can be passed by value and do not need to
301
+ * exist on-disk or in environment variables.
302
+ *
303
+ * Build arguments and environment variables are persistent in the final
304
+ * image, so you should use this for sensitive values.
305
+ */
306
+ readonly secrets: pulumi.Output<{
307
+ [key: string]: string;
308
+ } | undefined>;
309
+ /**
310
+ * Name and optionally a tag (format: `name:tag`).
311
+ *
312
+ * If exporting to a registry, the name should include the fully qualified
313
+ * registry address (e.g. `docker.io/pulumi/pulumi:latest`).
314
+ */
315
+ readonly tags: pulumi.Output<string[] | undefined>;
316
+ /**
317
+ * Set the target build stage(s) to build.
87
318
  *
88
- * Name and optionally a tag (format: "name:tag"). If outputting to a
89
- * registry, the name should include the fully qualified registry address.
319
+ * If not specified all targets will be built by default.
90
320
  */
91
- readonly tags: pulumi.Output<string[]>;
321
+ readonly targets: pulumi.Output<string[] | undefined>;
92
322
  /**
93
323
  * Create a Image resource with the given unique name, arguments, and options.
94
324
  *
@@ -96,78 +326,98 @@ export declare class Image extends pulumi.CustomResource {
96
326
  * @param args The arguments to use to populate this resource's properties.
97
327
  * @param opts A bag of options that control this resource's behavior.
98
328
  */
99
- constructor(name: string, args: ImageArgs, opts?: pulumi.CustomResourceOptions);
329
+ constructor(name: string, args?: ImageArgs, opts?: pulumi.CustomResourceOptions);
100
330
  }
101
331
  /**
102
332
  * The set of arguments for constructing a Image resource.
103
333
  */
104
334
  export interface ImageArgs {
105
335
  /**
336
+ * `ARG` names and values to set during the build.
106
337
  *
107
- * An optional map of named build-time argument variables to set during
108
- * the Docker build. This flag allows you to pass build-time variables that
109
- * can be accessed like environment variables inside the RUN
110
- * instruction.
338
+ * These variables are accessed like environment variables inside `RUN`
339
+ * instructions.
340
+ *
341
+ * Build arguments are persisted in the image, so you should use `secrets`
342
+ * if these arguments are sensitive.
111
343
  */
112
344
  buildArgs?: pulumi.Input<{
113
345
  [key: string]: pulumi.Input<string>;
114
346
  }>;
115
347
  /**
116
- *
117
- * When true, attempt to build the image during previews. Outputs are not
118
- * pushed to registries, however caches are still populated.
348
+ * When `true`, attempt to build the image during previews. The image will
349
+ * not be pushed to registries, however caches will still populated.
119
350
  */
120
351
  buildOnPreview?: pulumi.Input<boolean>;
121
352
  /**
122
- *
123
- * Build with a specific builder instance
353
+ * Builder configuration.
124
354
  */
125
- builder?: pulumi.Input<string>;
355
+ builder?: pulumi.Input<inputs.buildx.BuilderConfig>;
126
356
  /**
127
- *
128
- * External cache sources (e.g., "user/app:cache", "type=local,src=path/to/dir")
357
+ * External cache configuration.
129
358
  */
130
- cacheFrom?: pulumi.Input<pulumi.Input<string>[]>;
359
+ cacheFrom?: pulumi.Input<pulumi.Input<inputs.buildx.CacheFromEntry>[]>;
131
360
  /**
132
- *
133
- * Cache export destinations (e.g., "user/app:cache", "type=local,dest=path/to/dir")
361
+ * Cache export configuration.
134
362
  */
135
- cacheTo?: pulumi.Input<pulumi.Input<string>[]>;
363
+ cacheTo?: pulumi.Input<pulumi.Input<inputs.buildx.CacheToEntry>[]>;
136
364
  /**
137
- *
138
- * Path to use for build context. If omitted, an empty context is used.
365
+ * Build context settings.
139
366
  */
140
- context?: pulumi.Input<string>;
367
+ context?: pulumi.Input<inputs.buildx.BuildContext>;
141
368
  /**
142
- *
143
- * Name and optionally a tag (format: "name:tag"). If outputting to a
144
- * registry, the name should include the fully qualified registry address.
369
+ * Dockerfile settings.
145
370
  */
146
- exports?: pulumi.Input<pulumi.Input<string>[]>;
371
+ dockerfile?: pulumi.Input<inputs.buildx.Dockerfile>;
147
372
  /**
373
+ * Controls where images are persisted after building.
148
374
  *
149
- * Name of the Dockerfile to use (defaults to "${context}/Dockerfile").
375
+ * Images are only stored in the local cache unless `exports` are
376
+ * explicitly configured.
150
377
  */
151
- file?: pulumi.Input<string>;
378
+ exports?: pulumi.Input<pulumi.Input<inputs.buildx.ExportEntry>[]>;
152
379
  /**
153
- *
154
- * Set target platforms for the build. Defaults to the host's platform
380
+ * Attach arbitrary key/value metadata to the image.
155
381
  */
156
- platforms?: pulumi.Input<pulumi.Input<string>[]>;
382
+ labels?: pulumi.Input<{
383
+ [key: string]: pulumi.Input<string>;
384
+ }>;
157
385
  /**
158
- *
159
- * Always attempt to pull all referenced images
386
+ * Set target platform(s) for the build. Defaults to the host's platform
387
+ */
388
+ platforms?: pulumi.Input<pulumi.Input<enums.buildx.Platform>[]>;
389
+ /**
390
+ * Always pull referenced images.
160
391
  */
161
392
  pull?: pulumi.Input<boolean>;
162
393
  /**
163
- *
164
- * Logins for registry outputs
394
+ * Registry credentials. Required if reading or exporting to private
395
+ * repositories.
165
396
  */
166
397
  registries?: pulumi.Input<pulumi.Input<inputs.buildx.RegistryAuth>[]>;
167
398
  /**
399
+ * A mapping of secret names to their corresponding values.
400
+ *
401
+ * Unlike the Docker CLI, these can be passed by value and do not need to
402
+ * exist on-disk or in environment variables.
403
+ *
404
+ * Build arguments and environment variables are persistent in the final
405
+ * image, so you should use this for sensitive values.
406
+ */
407
+ secrets?: pulumi.Input<{
408
+ [key: string]: pulumi.Input<string>;
409
+ }>;
410
+ /**
411
+ * Name and optionally a tag (format: `name:tag`).
412
+ *
413
+ * If exporting to a registry, the name should include the fully qualified
414
+ * registry address (e.g. `docker.io/pulumi/pulumi:latest`).
415
+ */
416
+ tags?: pulumi.Input<pulumi.Input<string>[]>;
417
+ /**
418
+ * Set the target build stage(s) to build.
168
419
  *
169
- * Name and optionally a tag (format: "name:tag"). If outputting to a
170
- * registry, the name should include the fully qualified registry address.
420
+ * If not specified all targets will be built by default.
171
421
  */
172
- tags: pulumi.Input<pulumi.Input<string>[]>;
422
+ targets?: pulumi.Input<pulumi.Input<string>[]>;
173
423
  }