@pulumi/docker 4.6.0-beta.1 → 4.6.0-beta.3
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 +554 -61
- package/buildx/image.js +314 -45
- package/buildx/image.js.map +1 -1
- package/buildx/index.d.ts +3 -0
- package/buildx/index.js +5 -1
- package/buildx/index.js.map +1 -1
- package/buildx/index_.d.ts +140 -0
- package/buildx/index_.js +130 -0
- package/buildx/index_.js.map +1 -0
- package/config/vars.d.ts +8 -6
- package/config/vars.js.map +1 -1
- package/package.json +1 -1
- package/provider.d.ts +14 -11
- package/provider.js.map +1 -1
- package/types/enums/buildx/index.d.ts +15 -0
- package/types/enums/buildx/index.js +15 -1
- package/types/enums/buildx/index.js.map +1 -1
- package/types/input.d.ts +139 -127
- package/types/input.js +17 -17
- package/types/input.js.map +1 -1
- package/types/output.d.ts +139 -127
- package/types/output.js +17 -17
- package/types/output.js.map +1 -1
package/buildx/image.d.ts
CHANGED
|
@@ -6,14 +6,280 @@ 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
|
+
* Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
|
82
|
+
* In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
|
83
|
+
*
|
|
84
|
+
* Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
|
85
|
+
* As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
|
86
|
+
* If multiple tags were pushed this uses one at random.
|
|
87
|
+
*
|
|
88
|
+
* If you need more control over tag references you can use the `digest` output, which is always a single sha256 hash as long as the image was exported somewhere.
|
|
89
|
+
*
|
|
90
|
+
* #### Tag deletion and refreshes
|
|
91
|
+
*
|
|
92
|
+
* 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.
|
|
93
|
+
*
|
|
94
|
+
* The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
|
95
|
+
* If any are missing a subsequent `update` will push them.
|
|
96
|
+
*
|
|
97
|
+
* When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
|
98
|
+
* Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
|
99
|
+
* Manifests are _not_ deleted in the same way during updates -- to do so safely would require a full build to determine whether a Pulumi operation should be an update or update-replace.
|
|
100
|
+
*
|
|
101
|
+
* Use the [`retainOnDelete: true`](https://www.pulumi.com/docs/concepts/options/retainondelete/) option if you do not want tags deleted.
|
|
102
|
+
*
|
|
103
|
+
* ### Example migration
|
|
104
|
+
*
|
|
105
|
+
* 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.
|
|
106
|
+
*
|
|
107
|
+
* The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
|
108
|
+
* After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
|
109
|
+
* In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
|
110
|
+
*
|
|
111
|
+
* The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
|
112
|
+
* It it is shown with parameters similar to the `v3` example for completeness.
|
|
113
|
+
*
|
|
16
114
|
* ## Example Usage
|
|
115
|
+
* ### v3/v4 migration
|
|
116
|
+
*
|
|
117
|
+
* ```typescript
|
|
118
|
+
*
|
|
119
|
+
* // v3 Image
|
|
120
|
+
* const v3 = new docker.Image("v3-image", {
|
|
121
|
+
* imageName: "myregistry.com/user/repo:latest",
|
|
122
|
+
* localImageName: "local-tag",
|
|
123
|
+
* skipPush: false,
|
|
124
|
+
* build: {
|
|
125
|
+
* dockerfile: "./Dockerfile",
|
|
126
|
+
* context: "../app",
|
|
127
|
+
* target: "mytarget",
|
|
128
|
+
* args: {
|
|
129
|
+
* MY_BUILD_ARG: "foo",
|
|
130
|
+
* },
|
|
131
|
+
* env: {
|
|
132
|
+
* DOCKER_BUILDKIT: "1",
|
|
133
|
+
* },
|
|
134
|
+
* extraOptions: [
|
|
135
|
+
* "--cache-from",
|
|
136
|
+
* "type=registry,myregistry.com/user/repo:cache",
|
|
137
|
+
* "--cache-to",
|
|
138
|
+
* "type=registry,myregistry.com/user/repo:cache",
|
|
139
|
+
* "--add-host",
|
|
140
|
+
* "metadata.google.internal:169.254.169.254",
|
|
141
|
+
* "--secret",
|
|
142
|
+
* "id=mysecret,src=/local/secret",
|
|
143
|
+
* "--ssh",
|
|
144
|
+
* "default=/home/runner/.ssh/id_ed25519",
|
|
145
|
+
* "--network",
|
|
146
|
+
* "host",
|
|
147
|
+
* "--platform",
|
|
148
|
+
* "linux/amd64",
|
|
149
|
+
* ],
|
|
150
|
+
* },
|
|
151
|
+
* registry: {
|
|
152
|
+
* server: "myregistry.com",
|
|
153
|
+
* username: "username",
|
|
154
|
+
* password: pulumi.secret("password"),
|
|
155
|
+
* },
|
|
156
|
+
* });
|
|
157
|
+
*
|
|
158
|
+
* // v3 Image after migrating to buildx.Image
|
|
159
|
+
* const v3Migrated = new docker.buildx.Image("v3-to-buildx", {
|
|
160
|
+
* tags: ["myregistry.com/user/repo:latest", "local-tag"],
|
|
161
|
+
* push: true,
|
|
162
|
+
* dockerfile: {
|
|
163
|
+
* location: "./Dockerfile",
|
|
164
|
+
* },
|
|
165
|
+
* context: {
|
|
166
|
+
* location: "../app",
|
|
167
|
+
* },
|
|
168
|
+
* targets: ["mytarget"],
|
|
169
|
+
* buildArgs: {
|
|
170
|
+
* MY_BUILD_ARG: "foo",
|
|
171
|
+
* },
|
|
172
|
+
* cacheFrom: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
|
|
173
|
+
* cacheTo: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
|
|
174
|
+
* secrets: {
|
|
175
|
+
* mysecret: "value",
|
|
176
|
+
* },
|
|
177
|
+
* addHosts: ["metadata.google.internal:169.254.169.254"],
|
|
178
|
+
* ssh: {
|
|
179
|
+
* default: ["/home/runner/.ssh/id_ed25519"],
|
|
180
|
+
* },
|
|
181
|
+
* network: "host",
|
|
182
|
+
* platforms: ["linux/amd64"],
|
|
183
|
+
* registries: [{
|
|
184
|
+
* address: "myregistry.com",
|
|
185
|
+
* username: "username",
|
|
186
|
+
* password: pulumi.secret("password"),
|
|
187
|
+
* }],
|
|
188
|
+
* });
|
|
189
|
+
*
|
|
190
|
+
*
|
|
191
|
+
* // v4 Image
|
|
192
|
+
* const v4 = new docker.Image("v4-image", {
|
|
193
|
+
* imageName: "myregistry.com/user/repo:latest",
|
|
194
|
+
* skipPush: false,
|
|
195
|
+
* build: {
|
|
196
|
+
* dockerfile: "./Dockerfile",
|
|
197
|
+
* context: "../app",
|
|
198
|
+
* target: "mytarget",
|
|
199
|
+
* args: {
|
|
200
|
+
* MY_BUILD_ARG: "foo",
|
|
201
|
+
* },
|
|
202
|
+
* cacheFrom: {
|
|
203
|
+
* images: ["myregistry.com/user/repo:cache"],
|
|
204
|
+
* },
|
|
205
|
+
* addHosts: ["metadata.google.internal:169.254.169.254"],
|
|
206
|
+
* network: "host",
|
|
207
|
+
* platform: "linux/amd64",
|
|
208
|
+
* },
|
|
209
|
+
* buildOnPreview: true,
|
|
210
|
+
* registry: {
|
|
211
|
+
* server: "myregistry.com",
|
|
212
|
+
* username: "username",
|
|
213
|
+
* password: pulumi.secret("password"),
|
|
214
|
+
* },
|
|
215
|
+
* });
|
|
216
|
+
*
|
|
217
|
+
* // v4 Image after migrating to buildx.Image
|
|
218
|
+
* const v4Migrated = new docker.buildx.Image("v4-to-buildx", {
|
|
219
|
+
* tags: ["myregistry.com/user/repo:latest"],
|
|
220
|
+
* push: true,
|
|
221
|
+
* dockerfile: {
|
|
222
|
+
* location: "./Dockerfile",
|
|
223
|
+
* },
|
|
224
|
+
* context: {
|
|
225
|
+
* location: "../app",
|
|
226
|
+
* },
|
|
227
|
+
* targets: ["mytarget"],
|
|
228
|
+
* buildArgs: {
|
|
229
|
+
* MY_BUILD_ARG: "foo",
|
|
230
|
+
* },
|
|
231
|
+
* cacheFrom: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
|
|
232
|
+
* cacheTo: [{ registry: { ref: "myregistry.com/user/repo:cache" } }],
|
|
233
|
+
* addHosts: ["metadata.google.internal:169.254.169.254"],
|
|
234
|
+
* network: "host",
|
|
235
|
+
* platforms: ["linux/amd64"],
|
|
236
|
+
* registries: [{
|
|
237
|
+
* address: "myregistry.com",
|
|
238
|
+
* username: "username",
|
|
239
|
+
* password: pulumi.secret("password"),
|
|
240
|
+
* }],
|
|
241
|
+
* });
|
|
242
|
+
*
|
|
243
|
+
* ```
|
|
244
|
+
*
|
|
245
|
+
* ## Example Usage
|
|
246
|
+
* ### Push to AWS ECR with caching
|
|
247
|
+
*
|
|
248
|
+
* ```typescript
|
|
249
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
250
|
+
* import * as aws from "@pulumi/aws";
|
|
251
|
+
* import * as docker from "@pulumi/docker";
|
|
252
|
+
*
|
|
253
|
+
* const ecrRepository = new aws.ecr.Repository("ecr-repository", {});
|
|
254
|
+
* const authToken = aws.ecr.getAuthorizationTokenOutput({
|
|
255
|
+
* registryId: ecrRepository.registryId,
|
|
256
|
+
* });
|
|
257
|
+
* const myImage = new docker.buildx.Image("my-image", {
|
|
258
|
+
* cacheFrom: [{
|
|
259
|
+
* registry: {
|
|
260
|
+
* ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
|
|
261
|
+
* },
|
|
262
|
+
* }],
|
|
263
|
+
* cacheTo: [{
|
|
264
|
+
* registry: {
|
|
265
|
+
* imageManifest: true,
|
|
266
|
+
* ociMediaTypes: true,
|
|
267
|
+
* ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
|
|
268
|
+
* },
|
|
269
|
+
* }],
|
|
270
|
+
* context: {
|
|
271
|
+
* location: "./app",
|
|
272
|
+
* },
|
|
273
|
+
* push: true,
|
|
274
|
+
* registries: [{
|
|
275
|
+
* address: ecrRepository.repositoryUrl,
|
|
276
|
+
* password: authToken.apply(authToken => authToken.password),
|
|
277
|
+
* username: authToken.apply(authToken => authToken.userName),
|
|
278
|
+
* }],
|
|
279
|
+
* tags: [pulumi.interpolate`${ecrRepository.repositoryUrl}:latest`],
|
|
280
|
+
* });
|
|
281
|
+
* export const ref = myImage.ref;
|
|
282
|
+
* ```
|
|
17
283
|
* ### Multi-platform image
|
|
18
284
|
*
|
|
19
285
|
* ```typescript
|
|
@@ -24,9 +290,6 @@ import * as enums from "../types/enums";
|
|
|
24
290
|
* context: {
|
|
25
291
|
* location: "app",
|
|
26
292
|
* },
|
|
27
|
-
* dockerfile: {
|
|
28
|
-
* location: "app/Dockerfile",
|
|
29
|
-
* },
|
|
30
293
|
* platforms: [
|
|
31
294
|
* docker.buildx.image.Platform.Plan9_amd64,
|
|
32
295
|
* docker.buildx.image.Platform.Plan9_386,
|
|
@@ -43,20 +306,15 @@ import * as enums from "../types/enums";
|
|
|
43
306
|
* context: {
|
|
44
307
|
* location: "app",
|
|
45
308
|
* },
|
|
46
|
-
*
|
|
47
|
-
* location: "app/Dockerfile",
|
|
48
|
-
* },
|
|
49
|
-
* exports: [{
|
|
50
|
-
* registry: {
|
|
51
|
-
* ociMediaTypes: true,
|
|
52
|
-
* },
|
|
53
|
-
* }],
|
|
309
|
+
* push: true,
|
|
54
310
|
* registries: [{
|
|
55
311
|
* address: "docker.io",
|
|
56
312
|
* password: dockerHubPassword,
|
|
57
313
|
* username: "pulumibot",
|
|
58
314
|
* }],
|
|
315
|
+
* tags: ["docker.io/pulumi/pulumi:3.107.0"],
|
|
59
316
|
* });
|
|
317
|
+
* export const ref = myImage.ref;
|
|
60
318
|
* ```
|
|
61
319
|
* ### Caching
|
|
62
320
|
*
|
|
@@ -79,9 +337,22 @@ import * as enums from "../types/enums";
|
|
|
79
337
|
* context: {
|
|
80
338
|
* location: "app",
|
|
81
339
|
* },
|
|
82
|
-
*
|
|
83
|
-
*
|
|
340
|
+
* });
|
|
341
|
+
* ```
|
|
342
|
+
* ### Docker Build Cloud
|
|
343
|
+
*
|
|
344
|
+
* ```typescript
|
|
345
|
+
* import * as pulumi from "@pulumi/pulumi";
|
|
346
|
+
* import * as docker from "@pulumi/docker";
|
|
347
|
+
*
|
|
348
|
+
* const image = new docker.buildx.Image("image", {
|
|
349
|
+
* builder: {
|
|
350
|
+
* name: "cloud-builder-name",
|
|
351
|
+
* },
|
|
352
|
+
* context: {
|
|
353
|
+
* location: "app",
|
|
84
354
|
* },
|
|
355
|
+
* exec: true,
|
|
85
356
|
* });
|
|
86
357
|
* ```
|
|
87
358
|
* ### Build arguments
|
|
@@ -97,12 +368,9 @@ import * as enums from "../types/enums";
|
|
|
97
368
|
* context: {
|
|
98
369
|
* location: "app",
|
|
99
370
|
* },
|
|
100
|
-
* dockerfile: {
|
|
101
|
-
* location: "app/Dockerfile",
|
|
102
|
-
* },
|
|
103
371
|
* });
|
|
104
372
|
* ```
|
|
105
|
-
* ### Build
|
|
373
|
+
* ### Build target
|
|
106
374
|
*
|
|
107
375
|
* ```typescript
|
|
108
376
|
* import * as pulumi from "@pulumi/pulumi";
|
|
@@ -112,13 +380,7 @@ import * as enums from "../types/enums";
|
|
|
112
380
|
* context: {
|
|
113
381
|
* location: "app",
|
|
114
382
|
* },
|
|
115
|
-
*
|
|
116
|
-
* location: "app/Dockerfile",
|
|
117
|
-
* },
|
|
118
|
-
* targets: [
|
|
119
|
-
* "build-me",
|
|
120
|
-
* "also-build-me",
|
|
121
|
-
* ],
|
|
383
|
+
* target: "build-me",
|
|
122
384
|
* });
|
|
123
385
|
* ```
|
|
124
386
|
* ### Named contexts
|
|
@@ -127,19 +389,14 @@ import * as enums from "../types/enums";
|
|
|
127
389
|
* import * as pulumi from "@pulumi/pulumi";
|
|
128
390
|
* import * as docker from "@pulumi/docker";
|
|
129
391
|
*
|
|
130
|
-
* const image = new docker.buildx.Image("image", {
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* "golang:
|
|
135
|
-
* location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
|
136
|
-
* },
|
|
392
|
+
* const image = new docker.buildx.Image("image", {context: {
|
|
393
|
+
* location: "app",
|
|
394
|
+
* named: {
|
|
395
|
+
* "golang:latest": {
|
|
396
|
+
* location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
|
137
397
|
* },
|
|
138
398
|
* },
|
|
139
|
-
*
|
|
140
|
-
* location: "app/Dockerfile",
|
|
141
|
-
* },
|
|
142
|
-
* });
|
|
399
|
+
* }});
|
|
143
400
|
* ```
|
|
144
401
|
* ### Remote context
|
|
145
402
|
*
|
|
@@ -193,9 +450,6 @@ import * as enums from "../types/enums";
|
|
|
193
450
|
* context: {
|
|
194
451
|
* location: "app",
|
|
195
452
|
* },
|
|
196
|
-
* dockerfile: {
|
|
197
|
-
* location: "app/Dockerfile",
|
|
198
|
-
* },
|
|
199
453
|
* exports: [{
|
|
200
454
|
* docker: {
|
|
201
455
|
* tar: true,
|
|
@@ -219,6 +473,12 @@ export declare class Image extends pulumi.CustomResource {
|
|
|
219
473
|
* when multiple copies of the Pulumi SDK have been loaded into the same process.
|
|
220
474
|
*/
|
|
221
475
|
static isInstance(obj: any): obj is Image;
|
|
476
|
+
/**
|
|
477
|
+
* Custom `host:ip` mappings to use during the build.
|
|
478
|
+
*
|
|
479
|
+
* Equivalent to Docker's `--add-host` flag.
|
|
480
|
+
*/
|
|
481
|
+
readonly addHosts: pulumi.Output<string[] | undefined>;
|
|
222
482
|
/**
|
|
223
483
|
* `ARG` names and values to set during the build.
|
|
224
484
|
*
|
|
@@ -227,13 +487,27 @@ export declare class Image extends pulumi.CustomResource {
|
|
|
227
487
|
*
|
|
228
488
|
* Build arguments are persisted in the image, so you should use `secrets`
|
|
229
489
|
* if these arguments are sensitive.
|
|
490
|
+
*
|
|
491
|
+
* Equivalent to Docker's `--build-arg` flag.
|
|
230
492
|
*/
|
|
231
493
|
readonly buildArgs: pulumi.Output<{
|
|
232
494
|
[key: string]: string;
|
|
233
495
|
} | undefined>;
|
|
234
496
|
/**
|
|
235
|
-
*
|
|
236
|
-
*
|
|
497
|
+
* By default, preview behavior depends on the execution environment. If
|
|
498
|
+
* Pulumi detects the operation is running on a CI system (GitHub Actions,
|
|
499
|
+
* Travis CI, Azure Pipelines, etc.) then it will build images during
|
|
500
|
+
* previews as a safeguard. Otherwise, if not running on CI, previews will
|
|
501
|
+
* not build images.
|
|
502
|
+
*
|
|
503
|
+
* Setting this to `false` forces previews to never perform builds, and
|
|
504
|
+
* setting it to `true` will always build the image during previews.
|
|
505
|
+
*
|
|
506
|
+
* Images built during previews are never exported to registries, however
|
|
507
|
+
* cache manifests are still exported.
|
|
508
|
+
*
|
|
509
|
+
* On-disk Dockerfiles are always validated for syntactic correctness
|
|
510
|
+
* regardless of this setting.
|
|
237
511
|
*/
|
|
238
512
|
readonly buildOnPreview: pulumi.Output<boolean | undefined>;
|
|
239
513
|
/**
|
|
@@ -241,15 +515,21 @@ export declare class Image extends pulumi.CustomResource {
|
|
|
241
515
|
*/
|
|
242
516
|
readonly builder: pulumi.Output<outputs.buildx.BuilderConfig | undefined>;
|
|
243
517
|
/**
|
|
244
|
-
*
|
|
518
|
+
* Cache export configuration.
|
|
519
|
+
*
|
|
520
|
+
* Equivalent to Docker's `--cache-from` flag.
|
|
245
521
|
*/
|
|
246
|
-
readonly cacheFrom: pulumi.Output<outputs.buildx.
|
|
522
|
+
readonly cacheFrom: pulumi.Output<outputs.buildx.CacheFrom[] | undefined>;
|
|
247
523
|
/**
|
|
248
|
-
* Cache
|
|
524
|
+
* Cache import configuration.
|
|
525
|
+
*
|
|
526
|
+
* Equivalent to Docker's `--cache-to` flag.
|
|
249
527
|
*/
|
|
250
|
-
readonly cacheTo: pulumi.Output<outputs.buildx.
|
|
528
|
+
readonly cacheTo: pulumi.Output<outputs.buildx.CacheTo[] | undefined>;
|
|
251
529
|
/**
|
|
252
530
|
* Build context settings.
|
|
531
|
+
*
|
|
532
|
+
* Equivalent to Docker's `PATH | URL | -` positional argument.
|
|
253
533
|
*/
|
|
254
534
|
readonly context: pulumi.Output<outputs.buildx.BuildContext | undefined>;
|
|
255
535
|
/**
|
|
@@ -257,41 +537,133 @@ export declare class Image extends pulumi.CustomResource {
|
|
|
257
537
|
*
|
|
258
538
|
* Pulumi uses this to determine if an image _may_ need to be re-built.
|
|
259
539
|
*/
|
|
260
|
-
readonly contextHash: pulumi.Output<string
|
|
540
|
+
readonly contextHash: pulumi.Output<string>;
|
|
261
541
|
/**
|
|
262
|
-
* A
|
|
542
|
+
* A SHA256 digest of the image if it was exported to a registry or
|
|
543
|
+
* elsewhere.
|
|
544
|
+
*
|
|
545
|
+
* Empty if the image was not exported.
|
|
546
|
+
*
|
|
547
|
+
* Registry images can be referenced precisely as `<tag>@<digest>`. The
|
|
548
|
+
* `ref` output provides one such reference as a convenience.
|
|
263
549
|
*/
|
|
264
|
-
readonly
|
|
265
|
-
[key: string]: string[];
|
|
266
|
-
} | undefined>;
|
|
550
|
+
readonly digest: pulumi.Output<string>;
|
|
267
551
|
/**
|
|
268
552
|
* Dockerfile settings.
|
|
553
|
+
*
|
|
554
|
+
* Equivalent to Docker's `--file` flag.
|
|
269
555
|
*/
|
|
270
556
|
readonly dockerfile: pulumi.Output<outputs.buildx.Dockerfile | undefined>;
|
|
557
|
+
/**
|
|
558
|
+
* Use `exec` mode to build this image.
|
|
559
|
+
*
|
|
560
|
+
* By default the provider embeds a v25 Docker client with v0.12 buildx
|
|
561
|
+
* support. This helps ensure consistent behavior across environments and
|
|
562
|
+
* is compatible with alternative build backends (e.g. `buildkitd`), but
|
|
563
|
+
* it may not be desirable if you require a specific version of buildx.
|
|
564
|
+
* For example you may want to run a custom `docker-buildx` binary with
|
|
565
|
+
* support for [Docker Build
|
|
566
|
+
* Cloud](https://docs.docker.com/build/cloud/setup/) (DBC).
|
|
567
|
+
*
|
|
568
|
+
* When this is set to `true` the provider will instead execute the
|
|
569
|
+
* `docker-buildx` binary directly to perform its operations. The user is
|
|
570
|
+
* responsible for ensuring this binary exists, with correct permissions
|
|
571
|
+
* and pre-configured builders, at a path Docker expects (e.g.
|
|
572
|
+
* `~/.docker/cli-plugins`).
|
|
573
|
+
*
|
|
574
|
+
* Debugging `exec` mode may be more difficult as Pulumi will not be able
|
|
575
|
+
* to surface fine-grained errors and warnings. Additionally credentials
|
|
576
|
+
* are temporarily written to disk in order to provide them to the
|
|
577
|
+
* `docker-buildx` binary.
|
|
578
|
+
*/
|
|
579
|
+
readonly exec: pulumi.Output<boolean | undefined>;
|
|
271
580
|
/**
|
|
272
581
|
* Controls where images are persisted after building.
|
|
273
582
|
*
|
|
274
583
|
* Images are only stored in the local cache unless `exports` are
|
|
275
584
|
* explicitly configured.
|
|
585
|
+
*
|
|
586
|
+
* Exporting to multiple destinations requires a daemon running BuildKit
|
|
587
|
+
* 0.13 or later.
|
|
588
|
+
*
|
|
589
|
+
* Equivalent to Docker's `--output` flag.
|
|
276
590
|
*/
|
|
277
|
-
readonly exports: pulumi.Output<outputs.buildx.
|
|
591
|
+
readonly exports: pulumi.Output<outputs.buildx.Export[] | undefined>;
|
|
278
592
|
/**
|
|
279
593
|
* Attach arbitrary key/value metadata to the image.
|
|
594
|
+
*
|
|
595
|
+
* Equivalent to Docker's `--label` flag.
|
|
280
596
|
*/
|
|
281
597
|
readonly labels: pulumi.Output<{
|
|
282
598
|
[key: string]: string;
|
|
283
599
|
} | undefined>;
|
|
284
600
|
/**
|
|
285
|
-
*
|
|
601
|
+
* When `true` the build will automatically include a `docker` export.
|
|
602
|
+
*
|
|
603
|
+
* Defaults to `false`.
|
|
604
|
+
*
|
|
605
|
+
* Equivalent to Docker's `--load` flag.
|
|
606
|
+
*/
|
|
607
|
+
readonly load: pulumi.Output<boolean | undefined>;
|
|
608
|
+
/**
|
|
609
|
+
* Set the network mode for `RUN` instructions. Defaults to `default`.
|
|
610
|
+
*
|
|
611
|
+
* For custom networks, configure your builder with `--driver-opt network=...`.
|
|
612
|
+
*
|
|
613
|
+
* Equivalent to Docker's `--network` flag.
|
|
614
|
+
*/
|
|
615
|
+
readonly network: pulumi.Output<enums.buildx.NetworkMode | undefined>;
|
|
616
|
+
/**
|
|
617
|
+
* Do not import cache manifests when building the image.
|
|
618
|
+
*
|
|
619
|
+
* Equivalent to Docker's `--no-cache` flag.
|
|
620
|
+
*/
|
|
621
|
+
readonly noCache: pulumi.Output<boolean | undefined>;
|
|
622
|
+
/**
|
|
623
|
+
* Set target platform(s) for the build. Defaults to the host's platform.
|
|
624
|
+
*
|
|
625
|
+
* Equivalent to Docker's `--platform` flag.
|
|
286
626
|
*/
|
|
287
627
|
readonly platforms: pulumi.Output<enums.buildx.Platform[] | undefined>;
|
|
288
628
|
/**
|
|
289
629
|
* Always pull referenced images.
|
|
630
|
+
*
|
|
631
|
+
* Equivalent to Docker's `--pull` flag.
|
|
290
632
|
*/
|
|
291
633
|
readonly pull: pulumi.Output<boolean | undefined>;
|
|
634
|
+
/**
|
|
635
|
+
* When `true` the build will automatically include a `registry` export.
|
|
636
|
+
*
|
|
637
|
+
* Defaults to `false`.
|
|
638
|
+
*
|
|
639
|
+
* Equivalent to Docker's `--push` flag.
|
|
640
|
+
*/
|
|
641
|
+
readonly push: pulumi.Output<boolean | undefined>;
|
|
642
|
+
/**
|
|
643
|
+
* If the image was pushed to any registries then this will contain a
|
|
644
|
+
* single fully-qualified tag including the build's digest.
|
|
645
|
+
*
|
|
646
|
+
* If the image had tags but was not exported, this will take on a value
|
|
647
|
+
* of one of those tags.
|
|
648
|
+
*
|
|
649
|
+
* This will be empty if the image had no exports and no tags.
|
|
650
|
+
*
|
|
651
|
+
* This is only for convenience and may not be appropriate for situations
|
|
652
|
+
* where multiple tags or registries are involved. In those cases this
|
|
653
|
+
* output is not guaranteed to be stable.
|
|
654
|
+
*
|
|
655
|
+
* For more control over tags consumed by downstream resources you should
|
|
656
|
+
* use the `digest` output.
|
|
657
|
+
*/
|
|
658
|
+
readonly ref: pulumi.Output<string>;
|
|
292
659
|
/**
|
|
293
660
|
* Registry credentials. Required if reading or exporting to private
|
|
294
661
|
* repositories.
|
|
662
|
+
*
|
|
663
|
+
* Credentials are kept in-memory and do not pollute pre-existing
|
|
664
|
+
* credentials on the host.
|
|
665
|
+
*
|
|
666
|
+
* Similar to `docker login`.
|
|
295
667
|
*/
|
|
296
668
|
readonly registries: pulumi.Output<outputs.buildx.RegistryAuth[] | undefined>;
|
|
297
669
|
/**
|
|
@@ -302,23 +674,35 @@ export declare class Image extends pulumi.CustomResource {
|
|
|
302
674
|
*
|
|
303
675
|
* Build arguments and environment variables are persistent in the final
|
|
304
676
|
* image, so you should use this for sensitive values.
|
|
677
|
+
*
|
|
678
|
+
* Similar to Docker's `--secret` flag.
|
|
305
679
|
*/
|
|
306
680
|
readonly secrets: pulumi.Output<{
|
|
307
681
|
[key: string]: string;
|
|
308
682
|
} | undefined>;
|
|
683
|
+
/**
|
|
684
|
+
* SSH agent socket or keys to expose to the build.
|
|
685
|
+
*
|
|
686
|
+
* Equivalent to Docker's `--ssh` flag.
|
|
687
|
+
*/
|
|
688
|
+
readonly ssh: pulumi.Output<outputs.buildx.SSH[] | undefined>;
|
|
309
689
|
/**
|
|
310
690
|
* Name and optionally a tag (format: `name:tag`).
|
|
311
691
|
*
|
|
312
692
|
* If exporting to a registry, the name should include the fully qualified
|
|
313
693
|
* registry address (e.g. `docker.io/pulumi/pulumi:latest`).
|
|
694
|
+
*
|
|
695
|
+
* Equivalent to Docker's `--tag` flag.
|
|
314
696
|
*/
|
|
315
697
|
readonly tags: pulumi.Output<string[] | undefined>;
|
|
316
698
|
/**
|
|
317
699
|
* Set the target build stage(s) to build.
|
|
318
700
|
*
|
|
319
701
|
* If not specified all targets will be built by default.
|
|
702
|
+
*
|
|
703
|
+
* Equivalent to Docker's `--target` flag.
|
|
320
704
|
*/
|
|
321
|
-
readonly
|
|
705
|
+
readonly target: pulumi.Output<string | undefined>;
|
|
322
706
|
/**
|
|
323
707
|
* Create a Image resource with the given unique name, arguments, and options.
|
|
324
708
|
*
|
|
@@ -332,6 +716,12 @@ export declare class Image extends pulumi.CustomResource {
|
|
|
332
716
|
* The set of arguments for constructing a Image resource.
|
|
333
717
|
*/
|
|
334
718
|
export interface ImageArgs {
|
|
719
|
+
/**
|
|
720
|
+
* Custom `host:ip` mappings to use during the build.
|
|
721
|
+
*
|
|
722
|
+
* Equivalent to Docker's `--add-host` flag.
|
|
723
|
+
*/
|
|
724
|
+
addHosts?: pulumi.Input<pulumi.Input<string>[]>;
|
|
335
725
|
/**
|
|
336
726
|
* `ARG` names and values to set during the build.
|
|
337
727
|
*
|
|
@@ -340,13 +730,27 @@ export interface ImageArgs {
|
|
|
340
730
|
*
|
|
341
731
|
* Build arguments are persisted in the image, so you should use `secrets`
|
|
342
732
|
* if these arguments are sensitive.
|
|
733
|
+
*
|
|
734
|
+
* Equivalent to Docker's `--build-arg` flag.
|
|
343
735
|
*/
|
|
344
736
|
buildArgs?: pulumi.Input<{
|
|
345
737
|
[key: string]: pulumi.Input<string>;
|
|
346
738
|
}>;
|
|
347
739
|
/**
|
|
348
|
-
*
|
|
349
|
-
*
|
|
740
|
+
* By default, preview behavior depends on the execution environment. If
|
|
741
|
+
* Pulumi detects the operation is running on a CI system (GitHub Actions,
|
|
742
|
+
* Travis CI, Azure Pipelines, etc.) then it will build images during
|
|
743
|
+
* previews as a safeguard. Otherwise, if not running on CI, previews will
|
|
744
|
+
* not build images.
|
|
745
|
+
*
|
|
746
|
+
* Setting this to `false` forces previews to never perform builds, and
|
|
747
|
+
* setting it to `true` will always build the image during previews.
|
|
748
|
+
*
|
|
749
|
+
* Images built during previews are never exported to registries, however
|
|
750
|
+
* cache manifests are still exported.
|
|
751
|
+
*
|
|
752
|
+
* On-disk Dockerfiles are always validated for syntactic correctness
|
|
753
|
+
* regardless of this setting.
|
|
350
754
|
*/
|
|
351
755
|
buildOnPreview?: pulumi.Input<boolean>;
|
|
352
756
|
/**
|
|
@@ -354,45 +758,122 @@ export interface ImageArgs {
|
|
|
354
758
|
*/
|
|
355
759
|
builder?: pulumi.Input<inputs.buildx.BuilderConfig>;
|
|
356
760
|
/**
|
|
357
|
-
*
|
|
761
|
+
* Cache export configuration.
|
|
762
|
+
*
|
|
763
|
+
* Equivalent to Docker's `--cache-from` flag.
|
|
358
764
|
*/
|
|
359
|
-
cacheFrom?: pulumi.Input<pulumi.Input<inputs.buildx.
|
|
765
|
+
cacheFrom?: pulumi.Input<pulumi.Input<inputs.buildx.CacheFrom>[]>;
|
|
360
766
|
/**
|
|
361
|
-
* Cache
|
|
767
|
+
* Cache import configuration.
|
|
768
|
+
*
|
|
769
|
+
* Equivalent to Docker's `--cache-to` flag.
|
|
362
770
|
*/
|
|
363
|
-
cacheTo?: pulumi.Input<pulumi.Input<inputs.buildx.
|
|
771
|
+
cacheTo?: pulumi.Input<pulumi.Input<inputs.buildx.CacheTo>[]>;
|
|
364
772
|
/**
|
|
365
773
|
* Build context settings.
|
|
774
|
+
*
|
|
775
|
+
* Equivalent to Docker's `PATH | URL | -` positional argument.
|
|
366
776
|
*/
|
|
367
777
|
context?: pulumi.Input<inputs.buildx.BuildContext>;
|
|
368
778
|
/**
|
|
369
779
|
* Dockerfile settings.
|
|
780
|
+
*
|
|
781
|
+
* Equivalent to Docker's `--file` flag.
|
|
370
782
|
*/
|
|
371
783
|
dockerfile?: pulumi.Input<inputs.buildx.Dockerfile>;
|
|
784
|
+
/**
|
|
785
|
+
* Use `exec` mode to build this image.
|
|
786
|
+
*
|
|
787
|
+
* By default the provider embeds a v25 Docker client with v0.12 buildx
|
|
788
|
+
* support. This helps ensure consistent behavior across environments and
|
|
789
|
+
* is compatible with alternative build backends (e.g. `buildkitd`), but
|
|
790
|
+
* it may not be desirable if you require a specific version of buildx.
|
|
791
|
+
* For example you may want to run a custom `docker-buildx` binary with
|
|
792
|
+
* support for [Docker Build
|
|
793
|
+
* Cloud](https://docs.docker.com/build/cloud/setup/) (DBC).
|
|
794
|
+
*
|
|
795
|
+
* When this is set to `true` the provider will instead execute the
|
|
796
|
+
* `docker-buildx` binary directly to perform its operations. The user is
|
|
797
|
+
* responsible for ensuring this binary exists, with correct permissions
|
|
798
|
+
* and pre-configured builders, at a path Docker expects (e.g.
|
|
799
|
+
* `~/.docker/cli-plugins`).
|
|
800
|
+
*
|
|
801
|
+
* Debugging `exec` mode may be more difficult as Pulumi will not be able
|
|
802
|
+
* to surface fine-grained errors and warnings. Additionally credentials
|
|
803
|
+
* are temporarily written to disk in order to provide them to the
|
|
804
|
+
* `docker-buildx` binary.
|
|
805
|
+
*/
|
|
806
|
+
exec?: pulumi.Input<boolean>;
|
|
372
807
|
/**
|
|
373
808
|
* Controls where images are persisted after building.
|
|
374
809
|
*
|
|
375
810
|
* Images are only stored in the local cache unless `exports` are
|
|
376
811
|
* explicitly configured.
|
|
812
|
+
*
|
|
813
|
+
* Exporting to multiple destinations requires a daemon running BuildKit
|
|
814
|
+
* 0.13 or later.
|
|
815
|
+
*
|
|
816
|
+
* Equivalent to Docker's `--output` flag.
|
|
377
817
|
*/
|
|
378
|
-
exports?: pulumi.Input<pulumi.Input<inputs.buildx.
|
|
818
|
+
exports?: pulumi.Input<pulumi.Input<inputs.buildx.Export>[]>;
|
|
379
819
|
/**
|
|
380
820
|
* Attach arbitrary key/value metadata to the image.
|
|
821
|
+
*
|
|
822
|
+
* Equivalent to Docker's `--label` flag.
|
|
381
823
|
*/
|
|
382
824
|
labels?: pulumi.Input<{
|
|
383
825
|
[key: string]: pulumi.Input<string>;
|
|
384
826
|
}>;
|
|
385
827
|
/**
|
|
386
|
-
*
|
|
828
|
+
* When `true` the build will automatically include a `docker` export.
|
|
829
|
+
*
|
|
830
|
+
* Defaults to `false`.
|
|
831
|
+
*
|
|
832
|
+
* Equivalent to Docker's `--load` flag.
|
|
833
|
+
*/
|
|
834
|
+
load?: pulumi.Input<boolean>;
|
|
835
|
+
/**
|
|
836
|
+
* Set the network mode for `RUN` instructions. Defaults to `default`.
|
|
837
|
+
*
|
|
838
|
+
* For custom networks, configure your builder with `--driver-opt network=...`.
|
|
839
|
+
*
|
|
840
|
+
* Equivalent to Docker's `--network` flag.
|
|
841
|
+
*/
|
|
842
|
+
network?: pulumi.Input<enums.buildx.NetworkMode>;
|
|
843
|
+
/**
|
|
844
|
+
* Do not import cache manifests when building the image.
|
|
845
|
+
*
|
|
846
|
+
* Equivalent to Docker's `--no-cache` flag.
|
|
847
|
+
*/
|
|
848
|
+
noCache?: pulumi.Input<boolean>;
|
|
849
|
+
/**
|
|
850
|
+
* Set target platform(s) for the build. Defaults to the host's platform.
|
|
851
|
+
*
|
|
852
|
+
* Equivalent to Docker's `--platform` flag.
|
|
387
853
|
*/
|
|
388
854
|
platforms?: pulumi.Input<pulumi.Input<enums.buildx.Platform>[]>;
|
|
389
855
|
/**
|
|
390
856
|
* Always pull referenced images.
|
|
857
|
+
*
|
|
858
|
+
* Equivalent to Docker's `--pull` flag.
|
|
391
859
|
*/
|
|
392
860
|
pull?: pulumi.Input<boolean>;
|
|
861
|
+
/**
|
|
862
|
+
* When `true` the build will automatically include a `registry` export.
|
|
863
|
+
*
|
|
864
|
+
* Defaults to `false`.
|
|
865
|
+
*
|
|
866
|
+
* Equivalent to Docker's `--push` flag.
|
|
867
|
+
*/
|
|
868
|
+
push?: pulumi.Input<boolean>;
|
|
393
869
|
/**
|
|
394
870
|
* Registry credentials. Required if reading or exporting to private
|
|
395
871
|
* repositories.
|
|
872
|
+
*
|
|
873
|
+
* Credentials are kept in-memory and do not pollute pre-existing
|
|
874
|
+
* credentials on the host.
|
|
875
|
+
*
|
|
876
|
+
* Similar to `docker login`.
|
|
396
877
|
*/
|
|
397
878
|
registries?: pulumi.Input<pulumi.Input<inputs.buildx.RegistryAuth>[]>;
|
|
398
879
|
/**
|
|
@@ -403,21 +884,33 @@ export interface ImageArgs {
|
|
|
403
884
|
*
|
|
404
885
|
* Build arguments and environment variables are persistent in the final
|
|
405
886
|
* image, so you should use this for sensitive values.
|
|
887
|
+
*
|
|
888
|
+
* Similar to Docker's `--secret` flag.
|
|
406
889
|
*/
|
|
407
890
|
secrets?: pulumi.Input<{
|
|
408
891
|
[key: string]: pulumi.Input<string>;
|
|
409
892
|
}>;
|
|
893
|
+
/**
|
|
894
|
+
* SSH agent socket or keys to expose to the build.
|
|
895
|
+
*
|
|
896
|
+
* Equivalent to Docker's `--ssh` flag.
|
|
897
|
+
*/
|
|
898
|
+
ssh?: pulumi.Input<pulumi.Input<inputs.buildx.SSH>[]>;
|
|
410
899
|
/**
|
|
411
900
|
* Name and optionally a tag (format: `name:tag`).
|
|
412
901
|
*
|
|
413
902
|
* If exporting to a registry, the name should include the fully qualified
|
|
414
903
|
* registry address (e.g. `docker.io/pulumi/pulumi:latest`).
|
|
904
|
+
*
|
|
905
|
+
* Equivalent to Docker's `--tag` flag.
|
|
415
906
|
*/
|
|
416
907
|
tags?: pulumi.Input<pulumi.Input<string>[]>;
|
|
417
908
|
/**
|
|
418
909
|
* Set the target build stage(s) to build.
|
|
419
910
|
*
|
|
420
911
|
* If not specified all targets will be built by default.
|
|
912
|
+
*
|
|
913
|
+
* Equivalent to Docker's `--target` flag.
|
|
421
914
|
*/
|
|
422
|
-
|
|
915
|
+
target?: pulumi.Input<string>;
|
|
423
916
|
}
|