Fix references to buildx.Image
This commit is contained in:
6
Makefile
6
Makefile
@@ -172,14 +172,12 @@ build_dotnet: # Required by CI
|
|||||||
${SCHEMA_PATH}: bin/${PROVIDER}
|
${SCHEMA_PATH}: bin/${PROVIDER}
|
||||||
pulumi package get-schema bin/${PROVIDER} > $(SCHEMA_PATH)
|
pulumi package get-schema bin/${PROVIDER} > $(SCHEMA_PATH)
|
||||||
|
|
||||||
bin/${PROVIDER}: $(shell find ./provider -name '*.go') go.mod
|
bin/${PROVIDER}: $(shell find ./provider -name '*.go') go.mod docs
|
||||||
(cd provider && go build -o ../bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))
|
(cd provider && go build -o ../bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" $(PROJECT)/${PROVIDER_PATH}/cmd/$(PROVIDER))
|
||||||
|
|
||||||
bin/pulumi-gen-${PACK}: # Required by CI
|
bin/pulumi-gen-${PACK}: # Required by CI
|
||||||
touch bin/pulumi-gen-${PACK}
|
touch bin/pulumi-gen-${PACK}
|
||||||
|
|
||||||
$(shell find . -name '*.go'):
|
|
||||||
|
|
||||||
go.mod: $(shell find . -name '*.go')
|
go.mod: $(shell find . -name '*.go')
|
||||||
go.sum: go.mod
|
go.sum: go.mod
|
||||||
go mod tidy
|
go mod tidy
|
||||||
@@ -245,6 +243,6 @@ sdk/java: $(PULUMI) bin/${PROVIDER}
|
|||||||
cd ${TMPDIR}/java/ && gradle --console=plain build
|
cd ${TMPDIR}/java/ && gradle --console=plain build
|
||||||
mv -f ${TMPDIR}/java ${WORKING_DIR}/sdk/.
|
mv -f ${TMPDIR}/java ${WORKING_DIR}/sdk/.
|
||||||
|
|
||||||
docs: $(shell find docs/yaml -type f)
|
docs: $(shell find docs/yaml -type f) $(shell find ./provider/internal/embed -name '*.md')
|
||||||
go generate docs/generate.go
|
go generate docs/generate.go
|
||||||
@touch docs
|
@touch docs
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ resources:
|
|||||||
ecr-repository:
|
ecr-repository:
|
||||||
type: aws:ecr:Repository
|
type: aws:ecr:Repository
|
||||||
my-image:
|
my-image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
tags:
|
tags:
|
||||||
- ${ecr-repository.repositoryUrl}:latest
|
- ${ecr-repository.repositoryUrl}:latest
|
||||||
@@ -36,7 +36,7 @@ runtime: yaml
|
|||||||
description: Multi-platform image
|
description: Multi-platform image
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
@@ -49,7 +49,7 @@ runtime: yaml
|
|||||||
description: Registry export
|
description: Registry export
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
tags:
|
tags:
|
||||||
- "docker.io/pulumi/pulumi:3.107.0"
|
- "docker.io/pulumi/pulumi:3.107.0"
|
||||||
@@ -68,7 +68,7 @@ runtime: yaml
|
|||||||
description: Caching
|
description: Caching
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
@@ -85,7 +85,7 @@ runtime: yaml
|
|||||||
description: Docker Build Cloud
|
description: Docker Build Cloud
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
@@ -98,7 +98,7 @@ runtime: yaml
|
|||||||
description: Build arguments
|
description: Build arguments
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
@@ -110,7 +110,7 @@ runtime: yaml
|
|||||||
description: Build target
|
description: Build target
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
@@ -121,7 +121,7 @@ runtime: yaml
|
|||||||
description: Named contexts
|
description: Named contexts
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: app
|
location: app
|
||||||
@@ -134,7 +134,7 @@ runtime: yaml
|
|||||||
description: Remote context
|
description: Remote context
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"
|
location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"
|
||||||
@@ -145,7 +145,7 @@ runtime: yaml
|
|||||||
description: Inline Dockerfile
|
description: Inline Dockerfile
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
inline: |
|
inline: |
|
||||||
@@ -159,7 +159,7 @@ runtime: yaml
|
|||||||
description: Remote context
|
description: Remote context
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: app/Dockerfile
|
location: app/Dockerfile
|
||||||
@@ -171,7 +171,7 @@ runtime: yaml
|
|||||||
description: Local export
|
description: Local export
|
||||||
resources:
|
resources:
|
||||||
image:
|
image:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ description: Multi-platform registry caching
|
|||||||
runtime: yaml
|
runtime: yaml
|
||||||
resources:
|
resources:
|
||||||
arm64:
|
arm64:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
@@ -20,7 +20,7 @@ resources:
|
|||||||
ref: "docker.io/pulumi/pulumi:cache-arm64"
|
ref: "docker.io/pulumi/pulumi:cache-arm64"
|
||||||
|
|
||||||
amd64:
|
amd64:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "app"
|
location: "app"
|
||||||
@@ -37,7 +37,7 @@ resources:
|
|||||||
ref: "docker.io/pulumi/pulumi:cache-amd64"
|
ref: "docker.io/pulumi/pulumi:cache-amd64"
|
||||||
|
|
||||||
index:
|
index:
|
||||||
type: dockerbuild:index:Index
|
type: dockerbuild:Index
|
||||||
properties:
|
properties:
|
||||||
tag: "docker.io/pulumi/pulumi:3.107.0"
|
tag: "docker.io/pulumi/pulumi:3.107.0"
|
||||||
sources:
|
sources:
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ plugins:
|
|||||||
resources:
|
resources:
|
||||||
# docker buildx build -f app/Dockerfile.multiPlatform --platform plan9/amd64,plan9/386 app
|
# docker buildx build -f app/Dockerfile.multiPlatform --platform plan9/amd64,plan9/386 app
|
||||||
multiPlatform:
|
multiPlatform:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: "./app/Dockerfile.multiPlatform"
|
location: "./app/Dockerfile.multiPlatform"
|
||||||
@@ -20,7 +20,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build --output=type=registry app
|
# docker buildx build --output=type=registry app
|
||||||
registryPush:
|
registryPush:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "./app"
|
location: "./app"
|
||||||
@@ -36,7 +36,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build --cache-to=type=local,dest=tmp/cache,mode=max --cache-from=type=local,src=tmp/cache app
|
# docker buildx build --cache-to=type=local,dest=tmp/cache,mode=max --cache-from=type=local,src=tmp/cache app
|
||||||
cached:
|
cached:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "./app"
|
location: "./app"
|
||||||
@@ -50,7 +50,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build -f app/Dockerfile.buildArgs --build-arg SET_ME_TO_TRUE=true app
|
# docker buildx build -f app/Dockerfile.buildArgs --build-arg SET_ME_TO_TRUE=true app
|
||||||
buildArgs:
|
buildArgs:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: "./app/Dockerfile.buildArgs"
|
location: "./app/Dockerfile.buildArgs"
|
||||||
@@ -61,7 +61,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build -f app/Dockerfile.extraHosts --add-host metadata.google.internal:169.254.169.254 app
|
# docker buildx build -f app/Dockerfile.extraHosts --add-host metadata.google.internal:169.254.169.254 app
|
||||||
extraHosts:
|
extraHosts:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: "./app/Dockerfile.extraHosts"
|
location: "./app/Dockerfile.extraHosts"
|
||||||
@@ -72,7 +72,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build -f app/Dockerfile.sshMount --ssh default app
|
# docker buildx build -f app/Dockerfile.sshMount --ssh default app
|
||||||
sshMount:
|
sshMount:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: "./app/Dockerfile.sshMount"
|
location: "./app/Dockerfile.sshMount"
|
||||||
@@ -83,7 +83,7 @@ resources:
|
|||||||
|
|
||||||
# PASSWORD=hunter2 docker buildx build -f app/Dockerfile.secrets --secret id=password,env=PASSWORD app
|
# PASSWORD=hunter2 docker buildx build -f app/Dockerfile.secrets --secret id=password,env=PASSWORD app
|
||||||
secrets:
|
secrets:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: "./app/Dockerfile.secrets"
|
location: "./app/Dockerfile.secrets"
|
||||||
@@ -94,7 +94,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build --label "description=This image will get a descriptive label 👍" app
|
# docker buildx build --label "description=This image will get a descriptive label 👍" app
|
||||||
labels:
|
labels:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "./app"
|
location: "./app"
|
||||||
@@ -103,7 +103,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build -f app/Dockerfile.target --target build-me app
|
# docker buildx build -f app/Dockerfile.target --target build-me app
|
||||||
target:
|
target:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: "./app/Dockerfile.target"
|
location: "./app/Dockerfile.target"
|
||||||
@@ -114,7 +114,7 @@ resources:
|
|||||||
# docker buildx build -f app/Dockerfile.namedContexts \
|
# docker buildx build -f app/Dockerfile.namedContexts \
|
||||||
# --build-context golang:latest=docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984 app
|
# --build-context golang:latest=docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984 app
|
||||||
namedContexts:
|
namedContexts:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
location: "./app/Dockerfile.namedContexts"
|
location: "./app/Dockerfile.namedContexts"
|
||||||
@@ -126,7 +126,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile
|
# docker buildx build https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile
|
||||||
remoteContext:
|
remoteContext:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"
|
location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"
|
||||||
@@ -136,7 +136,7 @@ resources:
|
|||||||
# COPY hello.c ./
|
# COPY hello.c ./
|
||||||
# EOF
|
# EOF
|
||||||
remoteContextWithInline:
|
remoteContextWithInline:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
inline: |
|
inline: |
|
||||||
@@ -147,7 +147,7 @@ resources:
|
|||||||
|
|
||||||
# echo "FROM alpine" | docker buildx build -f - .
|
# echo "FROM alpine" | docker buildx build -f - .
|
||||||
inline:
|
inline:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
dockerfile:
|
dockerfile:
|
||||||
inline: |
|
inline: |
|
||||||
@@ -158,7 +158,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build --load .
|
# docker buildx build --load .
|
||||||
dockerLoad:
|
dockerLoad:
|
||||||
type: dockerbuild:index:Image
|
type: dockerbuild:Image
|
||||||
properties:
|
properties:
|
||||||
context:
|
context:
|
||||||
location: "./app"
|
location: "./app"
|
||||||
@@ -168,7 +168,7 @@ resources:
|
|||||||
|
|
||||||
# docker buildx build - < app/Dockerfile.emptyContext
|
# docker buildx build - < app/Dockerfile.emptyContext
|
||||||
#emptyContext:
|
#emptyContext:
|
||||||
# type: dockerbuild:index:Image
|
# type: dockerbuild:Image
|
||||||
# properties:
|
# properties:
|
||||||
# file: "app/Dockerfile.emptyContext"
|
# file: "app/Dockerfile.emptyContext"
|
||||||
# context: "-"
|
# context: "-"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
|||||||
## Migrating v3 and v4 Image resources
|
## Migrating v3 and v4 Image resources
|
||||||
|
|
||||||
The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
|
|
||||||
### Behavioral differences
|
### Behavioral differences
|
||||||
|
|
||||||
There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
|
|
||||||
#### Previews
|
#### Previews
|
||||||
|
|
||||||
@@ -16,8 +16,8 @@ Version `4.x` changed build-on-preview behavior to be opt-in.
|
|||||||
By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
|
|
||||||
The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
Previews run in non-CI environments will not build images.
|
Previews run in non-CI environments will not build images.
|
||||||
This behavior is still configurable with `buildOnPreview`.
|
This behavior is still configurable with `buildOnPreview`.
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ This behavior is still configurable with `buildOnPreview`.
|
|||||||
Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
They expose a `skipPush: true` option to disable pushing.
|
They expose a `skipPush: true` option to disable pushing.
|
||||||
|
|
||||||
The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
|
|
||||||
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`).
|
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`).
|
||||||
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.
|
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.
|
||||||
@@ -37,7 +37,7 @@ Version `3.x` of the Pulumi Docker provider supports secrets by way of the `extr
|
|||||||
|
|
||||||
Version `4.x` of the Pulumi Docker provider does not support secrets.
|
Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
|
|
||||||
The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
Instead, they should be passed directly as values.
|
Instead, they should be passed directly as values.
|
||||||
(Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
(Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -52,7 +52,7 @@ Version `4.x` exposes a similar parameter `cacheFrom: { images: [...] }` which p
|
|||||||
Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
|
|
||||||
The `buildx.Image` resource delegates all caching behavior to Docker.
|
The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
`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.
|
`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.
|
||||||
|
|
||||||
#### Outputs
|
#### Outputs
|
||||||
@@ -60,7 +60,7 @@ The `buildx.Image` resource delegates all caching behavior to Docker.
|
|||||||
Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
|
|
||||||
Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
If multiple tags were pushed this uses one at random.
|
If multiple tags were pushed this uses one at random.
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ Versions 3 and 4 of Pulumi Docker provider do not delete tags when the `Image` r
|
|||||||
The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
If any are missing a subsequent `update` will push them.
|
If any are missing a subsequent `update` will push them.
|
||||||
|
|
||||||
When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
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.
|
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.
|
||||||
|
|
||||||
@@ -81,11 +81,11 @@ Use the [`retainOnDelete: true`](https://www.pulumi.com/docs/concepts/options/re
|
|||||||
|
|
||||||
### Example migration
|
### Example migration
|
||||||
|
|
||||||
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.
|
Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
|
|
||||||
The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
|
|
||||||
The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
It it is shown with parameters similar to the `v3` example for completeness.
|
It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -136,8 +136,8 @@ const v3 = new docker.Image("v3-image", {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// v3 Image after migrating to buildx.Image
|
// v3 Image after migrating to dockerbuild.Image
|
||||||
const v3Migrated = new docker.buildx.Image("v3-to-buildx", {
|
const v3Migrated = new dockerbuild.Image("v3-to-buildx", {
|
||||||
tags: ["myregistry.com/user/repo:latest", "local-tag"],
|
tags: ["myregistry.com/user/repo:latest", "local-tag"],
|
||||||
push: true,
|
push: true,
|
||||||
dockerfile: {
|
dockerfile: {
|
||||||
@@ -195,8 +195,8 @@ const v4 = new docker.Image("v4-image", {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// v4 Image after migrating to buildx.Image
|
// v4 Image after migrating to dockerbuild.Image
|
||||||
const v4Migrated = new docker.buildx.Image("v4-to-buildx", {
|
const v4Migrated = new dockerbuild.Image("v4-to-buildx", {
|
||||||
tags: ["myregistry.com/user/repo:latest"],
|
tags: ["myregistry.com/user/repo:latest"],
|
||||||
push: true,
|
push: true,
|
||||||
dockerfile: {
|
dockerfile: {
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import * as pulumi from "@pulumi/pulumi";
|
import * as pulumi from "@pulumi/pulumi";
|
||||||
import * as docker from "@pulumi/docker";
|
import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
|
|
||||||
const amd64 = new docker.buildx.Image("amd64", {
|
const amd64 = new dockerbuild.Image("amd64", {
|
||||||
cacheFrom: [{
|
cacheFrom: [{
|
||||||
registry: {
|
registry: {
|
||||||
ref: "docker.io/pulumi/pulumi:cache-amd64",
|
ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
@@ -15,17 +15,17 @@ const amd64 = new docker.buildx.Image("amd64", {
|
|||||||
}],
|
}],
|
||||||
cacheTo: [{
|
cacheTo: [{
|
||||||
registry: {
|
registry: {
|
||||||
mode: docker.buildx.image.CacheMode.Max,
|
mode: dockerbuild.CacheMode.Max,
|
||||||
ref: "docker.io/pulumi/pulumi:cache-amd64",
|
ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
context: {
|
context: {
|
||||||
location: "app",
|
location: "app",
|
||||||
},
|
},
|
||||||
platforms: [docker.buildx.image.Platform.Linux_amd64],
|
platforms: [dockerbuild.Platform.Linux_amd64],
|
||||||
tags: ["docker.io/pulumi/pulumi:3.107.0-amd64"],
|
tags: ["docker.io/pulumi/pulumi:3.107.0-amd64"],
|
||||||
});
|
});
|
||||||
const arm64 = new docker.buildx.Image("arm64", {
|
const arm64 = new dockerbuild.Image("arm64", {
|
||||||
cacheFrom: [{
|
cacheFrom: [{
|
||||||
registry: {
|
registry: {
|
||||||
ref: "docker.io/pulumi/pulumi:cache-arm64",
|
ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
@@ -33,17 +33,17 @@ const arm64 = new docker.buildx.Image("arm64", {
|
|||||||
}],
|
}],
|
||||||
cacheTo: [{
|
cacheTo: [{
|
||||||
registry: {
|
registry: {
|
||||||
mode: docker.buildx.image.CacheMode.Max,
|
mode: dockerbuild.CacheMode.Max,
|
||||||
ref: "docker.io/pulumi/pulumi:cache-arm64",
|
ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
context: {
|
context: {
|
||||||
location: "app",
|
location: "app",
|
||||||
},
|
},
|
||||||
platforms: [docker.buildx.image.Platform.Linux_arm64],
|
platforms: [dockerbuild.Platform.Linux_arm64],
|
||||||
tags: ["docker.io/pulumi/pulumi:3.107.0-arm64"],
|
tags: ["docker.io/pulumi/pulumi:3.107.0-arm64"],
|
||||||
});
|
});
|
||||||
const index = new docker.buildx.Index("index", {
|
const index = new dockerbuild.Index("index", {
|
||||||
sources: [
|
sources: [
|
||||||
amd64.ref,
|
amd64.ref,
|
||||||
arm64.ref,
|
arm64.ref,
|
||||||
@@ -54,43 +54,43 @@ export const ref = index.ref;
|
|||||||
```
|
```
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
amd64 = docker.buildx.Image("amd64",
|
amd64 = dockerbuild.Image("amd64",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[docker.buildx.image.Platform.LINUX_AMD64],
|
platforms=[dockerbuild.Platform.LINUX_AMD64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||||
arm64 = docker.buildx.Image("arm64",
|
arm64 = dockerbuild.Image("arm64",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[docker.buildx.image.Platform.LINUX_ARM64],
|
platforms=[dockerbuild.Platform.LINUX_ARM64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||||
index = docker.buildx.Index("index",
|
index = dockerbuild.Index("index",
|
||||||
sources=[
|
sources=[
|
||||||
amd64.ref,
|
amd64.ref,
|
||||||
arm64.ref,
|
arm64.ref,
|
||||||
@@ -102,17 +102,17 @@ pulumi.export("ref", index.ref)
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Pulumi;
|
using Pulumi;
|
||||||
using Docker = Pulumi.Docker;
|
using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
|
|
||||||
return await Deployment.RunAsync(() =>
|
return await Deployment.RunAsync(() =>
|
||||||
{
|
{
|
||||||
var amd64 = new Docker.Buildx.Image("amd64", new()
|
var amd64 = new Dockerbuild.Image("amd64", new()
|
||||||
{
|
{
|
||||||
CacheFrom = new[]
|
CacheFrom = new[]
|
||||||
{
|
{
|
||||||
new Docker.Buildx.Inputs.CacheFromArgs
|
new Dockerbuild.Inputs.CacheFromArgs
|
||||||
{
|
{
|
||||||
Registry = new Docker.Buildx.Inputs.CacheFromRegistryArgs
|
Registry = new Dockerbuild.Inputs.CacheFromRegistryArgs
|
||||||
{
|
{
|
||||||
Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
},
|
},
|
||||||
@@ -120,22 +120,22 @@ return await Deployment.RunAsync(() =>
|
|||||||
},
|
},
|
||||||
CacheTo = new[]
|
CacheTo = new[]
|
||||||
{
|
{
|
||||||
new Docker.Buildx.Inputs.CacheToArgs
|
new Dockerbuild.Inputs.CacheToArgs
|
||||||
{
|
{
|
||||||
Registry = new Docker.Buildx.Inputs.CacheToRegistryArgs
|
Registry = new Dockerbuild.Inputs.CacheToRegistryArgs
|
||||||
{
|
{
|
||||||
Mode = Docker.Buildx.Image.CacheMode.Max,
|
Mode = Dockerbuild.CacheMode.Max,
|
||||||
Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Context = new Docker.Buildx.Inputs.BuildContextArgs
|
Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
{
|
{
|
||||||
Location = "app",
|
Location = "app",
|
||||||
},
|
},
|
||||||
Platforms = new[]
|
Platforms = new[]
|
||||||
{
|
{
|
||||||
Docker.Buildx.Image.Platform.Linux_amd64,
|
Dockerbuild.Platform.Linux_amd64,
|
||||||
},
|
},
|
||||||
Tags = new[]
|
Tags = new[]
|
||||||
{
|
{
|
||||||
@@ -143,13 +143,13 @@ return await Deployment.RunAsync(() =>
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
var arm64 = new Docker.Buildx.Image("arm64", new()
|
var arm64 = new Dockerbuild.Image("arm64", new()
|
||||||
{
|
{
|
||||||
CacheFrom = new[]
|
CacheFrom = new[]
|
||||||
{
|
{
|
||||||
new Docker.Buildx.Inputs.CacheFromArgs
|
new Dockerbuild.Inputs.CacheFromArgs
|
||||||
{
|
{
|
||||||
Registry = new Docker.Buildx.Inputs.CacheFromRegistryArgs
|
Registry = new Dockerbuild.Inputs.CacheFromRegistryArgs
|
||||||
{
|
{
|
||||||
Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
},
|
},
|
||||||
@@ -157,22 +157,22 @@ return await Deployment.RunAsync(() =>
|
|||||||
},
|
},
|
||||||
CacheTo = new[]
|
CacheTo = new[]
|
||||||
{
|
{
|
||||||
new Docker.Buildx.Inputs.CacheToArgs
|
new Dockerbuild.Inputs.CacheToArgs
|
||||||
{
|
{
|
||||||
Registry = new Docker.Buildx.Inputs.CacheToRegistryArgs
|
Registry = new Dockerbuild.Inputs.CacheToRegistryArgs
|
||||||
{
|
{
|
||||||
Mode = Docker.Buildx.Image.CacheMode.Max,
|
Mode = Dockerbuild.CacheMode.Max,
|
||||||
Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Context = new Docker.Buildx.Inputs.BuildContextArgs
|
Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
{
|
{
|
||||||
Location = "app",
|
Location = "app",
|
||||||
},
|
},
|
||||||
Platforms = new[]
|
Platforms = new[]
|
||||||
{
|
{
|
||||||
Docker.Buildx.Image.Platform.Linux_arm64,
|
Dockerbuild.Platform.Linux_arm64,
|
||||||
},
|
},
|
||||||
Tags = new[]
|
Tags = new[]
|
||||||
{
|
{
|
||||||
@@ -180,7 +180,7 @@ return await Deployment.RunAsync(() =>
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
var index = new Docker.Buildx.Index("index", new()
|
var index = new Dockerbuild.Index("index", new()
|
||||||
{
|
{
|
||||||
Sources = new[]
|
Sources = new[]
|
||||||
{
|
{
|
||||||
@@ -201,33 +201,33 @@ return await Deployment.RunAsync(() =>
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
"github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
pulumi.Run(func(ctx *pulumi.Context) error {
|
pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
amd64, err := buildx.NewImage(ctx, "amd64", &buildx.ImageArgs{
|
amd64, err := dockerbuild.NewImage(ctx, "amd64", &dockerbuild.ImageArgs{
|
||||||
CacheFrom: buildx.CacheFromArray{
|
CacheFrom: dockerbuild.CacheFromArray{
|
||||||
&buildx.CacheFromArgs{
|
&dockerbuild.CacheFromArgs{
|
||||||
Registry: &buildx.CacheFromRegistryArgs{
|
Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
CacheTo: buildx.CacheToArray{
|
CacheTo: dockerbuild.CacheToArray{
|
||||||
&buildx.CacheToArgs{
|
&dockerbuild.CacheToArgs{
|
||||||
Registry: &buildx.CacheToRegistryArgs{
|
Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
Mode: buildx.CacheModeMax,
|
Mode: dockerbuild.CacheModeMax,
|
||||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Context: &buildx.BuildContextArgs{
|
Context: &dockerbuild.BuildContextArgs{
|
||||||
Location: pulumi.String("app"),
|
Location: pulumi.String("app"),
|
||||||
},
|
},
|
||||||
Platforms: buildx.PlatformArray{
|
Platforms: dockerbuild.PlatformArray{
|
||||||
buildx.Platform_Linux_amd64,
|
dockerbuild.Platform_Linux_amd64,
|
||||||
},
|
},
|
||||||
Tags: pulumi.StringArray{
|
Tags: pulumi.StringArray{
|
||||||
pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
||||||
@@ -236,27 +236,27 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
arm64, err := buildx.NewImage(ctx, "arm64", &buildx.ImageArgs{
|
arm64, err := dockerbuild.NewImage(ctx, "arm64", &dockerbuild.ImageArgs{
|
||||||
CacheFrom: buildx.CacheFromArray{
|
CacheFrom: dockerbuild.CacheFromArray{
|
||||||
&buildx.CacheFromArgs{
|
&dockerbuild.CacheFromArgs{
|
||||||
Registry: &buildx.CacheFromRegistryArgs{
|
Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
CacheTo: buildx.CacheToArray{
|
CacheTo: dockerbuild.CacheToArray{
|
||||||
&buildx.CacheToArgs{
|
&dockerbuild.CacheToArgs{
|
||||||
Registry: &buildx.CacheToRegistryArgs{
|
Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
Mode: buildx.CacheModeMax,
|
Mode: dockerbuild.CacheModeMax,
|
||||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Context: &buildx.BuildContextArgs{
|
Context: &dockerbuild.BuildContextArgs{
|
||||||
Location: pulumi.String("app"),
|
Location: pulumi.String("app"),
|
||||||
},
|
},
|
||||||
Platforms: buildx.PlatformArray{
|
Platforms: dockerbuild.PlatformArray{
|
||||||
buildx.Platform_Linux_arm64,
|
dockerbuild.Platform_Linux_arm64,
|
||||||
},
|
},
|
||||||
Tags: pulumi.StringArray{
|
Tags: pulumi.StringArray{
|
||||||
pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
||||||
@@ -265,7 +265,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
index, err := buildx.NewIndex(ctx, "index", &buildx.IndexArgs{
|
index, err := dockerbuild.NewIndex(ctx, "index", &dockerbuild.IndexArgs{
|
||||||
Sources: pulumi.StringArray{
|
Sources: pulumi.StringArray{
|
||||||
amd64.Ref,
|
amd64.Ref,
|
||||||
arm64.Ref,
|
arm64.Ref,
|
||||||
@@ -301,7 +301,7 @@ resources:
|
|||||||
- linux/amd64
|
- linux/amd64
|
||||||
tags:
|
tags:
|
||||||
- docker.io/pulumi/pulumi:3.107.0-amd64
|
- docker.io/pulumi/pulumi:3.107.0-amd64
|
||||||
type: docker:buildx/image:Image
|
type: dockerbuild:Image
|
||||||
arm64:
|
arm64:
|
||||||
properties:
|
properties:
|
||||||
cacheFrom:
|
cacheFrom:
|
||||||
@@ -317,14 +317,14 @@ resources:
|
|||||||
- linux/arm64
|
- linux/arm64
|
||||||
tags:
|
tags:
|
||||||
- docker.io/pulumi/pulumi:3.107.0-arm64
|
- docker.io/pulumi/pulumi:3.107.0-arm64
|
||||||
type: docker:buildx/image:Image
|
type: dockerbuild:Image
|
||||||
index:
|
index:
|
||||||
properties:
|
properties:
|
||||||
sources:
|
sources:
|
||||||
- ${amd64.ref}
|
- ${amd64.ref}
|
||||||
- ${arm64.ref}
|
- ${arm64.ref}
|
||||||
tag: docker.io/pulumi/pulumi:3.107.0
|
tag: docker.io/pulumi/pulumi:3.107.0
|
||||||
type: docker:buildx/image:Index
|
type: dockerbuild:Index
|
||||||
runtime: yaml
|
runtime: yaml
|
||||||
```
|
```
|
||||||
```java
|
```java
|
||||||
@@ -333,15 +333,15 @@ package generated_program;
|
|||||||
import com.pulumi.Context;
|
import com.pulumi.Context;
|
||||||
import com.pulumi.Pulumi;
|
import com.pulumi.Pulumi;
|
||||||
import com.pulumi.core.Output;
|
import com.pulumi.core.Output;
|
||||||
import com.pulumi.docker.buildx.Image;
|
import com.pulumi.dockerbuild.Image;
|
||||||
import com.pulumi.docker.buildx.ImageArgs;
|
import com.pulumi.dockerbuild.ImageArgs;
|
||||||
import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||||
import com.pulumi.docker.buildx.inputs.CacheFromRegistryArgs;
|
import com.pulumi.dockerbuild.inputs.CacheFromRegistryArgs;
|
||||||
import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||||
import com.pulumi.docker.buildx.inputs.CacheToRegistryArgs;
|
import com.pulumi.dockerbuild.inputs.CacheToRegistryArgs;
|
||||||
import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
import com.pulumi.docker.buildx.Index;
|
import com.pulumi.dockerbuild.Index;
|
||||||
import com.pulumi.docker.buildx.IndexArgs;
|
import com.pulumi.dockerbuild.IndexArgs;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|||||||
136
sdk/dotnet/Image.cs
generated
136
sdk/dotnet/Image.cs
generated
@@ -28,12 +28,12 @@ namespace Pulumi.Dockerbuild
|
|||||||
///
|
///
|
||||||
/// ## Migrating v3 and v4 Image resources
|
/// ## Migrating v3 and v4 Image resources
|
||||||
///
|
///
|
||||||
/// The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
/// The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
/// Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
/// Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
///
|
///
|
||||||
/// ### Behavioral differences
|
/// ### Behavioral differences
|
||||||
///
|
///
|
||||||
/// There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
/// There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
///
|
///
|
||||||
/// #### Previews
|
/// #### Previews
|
||||||
///
|
///
|
||||||
@@ -44,8 +44,8 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
/// By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
/// Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
/// Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
///
|
///
|
||||||
/// The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
/// The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
/// By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
/// By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
/// Previews run in non-CI environments will not build images.
|
/// Previews run in non-CI environments will not build images.
|
||||||
/// This behavior is still configurable with `buildOnPreview`.
|
/// This behavior is still configurable with `buildOnPreview`.
|
||||||
///
|
///
|
||||||
@@ -54,7 +54,7 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
/// Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
/// They expose a `skipPush: true` option to disable pushing.
|
/// They expose a `skipPush: true` option to disable pushing.
|
||||||
///
|
///
|
||||||
/// The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
/// The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
///
|
///
|
||||||
/// 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`).
|
/// 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`).
|
||||||
/// 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.
|
/// 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.
|
||||||
@@ -65,7 +65,7 @@ namespace Pulumi.Dockerbuild
|
|||||||
///
|
///
|
||||||
/// Version `4.x` of the Pulumi Docker provider does not support secrets.
|
/// Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
///
|
///
|
||||||
/// The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
/// The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
/// Instead, they should be passed directly as values.
|
/// Instead, they should be passed directly as values.
|
||||||
/// (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
/// (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
/// Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
/// Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -80,7 +80,7 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
/// Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
/// This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
/// This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
///
|
///
|
||||||
/// The `buildx.Image` resource delegates all caching behavior to Docker.
|
/// The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
/// `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.
|
/// `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.
|
||||||
///
|
///
|
||||||
/// #### Outputs
|
/// #### Outputs
|
||||||
@@ -88,7 +88,7 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
/// Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
/// In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
/// In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
///
|
///
|
||||||
/// Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
/// Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
/// As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
/// As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
/// If multiple tags were pushed this uses one at random.
|
/// If multiple tags were pushed this uses one at random.
|
||||||
///
|
///
|
||||||
@@ -101,7 +101,7 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
/// The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
/// If any are missing a subsequent `update` will push them.
|
/// If any are missing a subsequent `update` will push them.
|
||||||
///
|
///
|
||||||
/// When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
/// When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
/// Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
/// Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
/// 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.
|
/// 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.
|
||||||
///
|
///
|
||||||
@@ -109,11 +109,11 @@ namespace Pulumi.Dockerbuild
|
|||||||
///
|
///
|
||||||
/// ### Example migration
|
/// ### Example migration
|
||||||
///
|
///
|
||||||
/// 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.
|
/// Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
///
|
///
|
||||||
/// The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
/// The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
/// After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
/// After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
/// In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
/// In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
///
|
///
|
||||||
/// The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
/// The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
/// It it is shown with parameters similar to the `v3` example for completeness.
|
/// It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -127,7 +127,7 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Aws = Pulumi.Aws;
|
/// using Aws = Pulumi.Aws;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
@@ -138,13 +138,13 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// RegistryId = ecrRepository.RegistryId,
|
/// RegistryId = ecrRepository.RegistryId,
|
||||||
/// });
|
/// });
|
||||||
///
|
///
|
||||||
/// var myImage = new Docker.Buildx.Image("my-image", new()
|
/// var myImage = new Dockerbuild.Image("my-image", new()
|
||||||
/// {
|
/// {
|
||||||
/// CacheFrom = new[]
|
/// CacheFrom = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheFromArgs
|
/// new Dockerbuild.Inputs.CacheFromArgs
|
||||||
/// {
|
/// {
|
||||||
/// Registry = new Docker.Buildx.Inputs.CacheFromRegistryArgs
|
/// Registry = new Dockerbuild.Inputs.CacheFromRegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// Ref = ecrRepository.RepositoryUrl.Apply(repositoryUrl => $"{repositoryUrl}:cache"),
|
/// Ref = ecrRepository.RepositoryUrl.Apply(repositoryUrl => $"{repositoryUrl}:cache"),
|
||||||
/// },
|
/// },
|
||||||
@@ -152,9 +152,9 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// },
|
/// },
|
||||||
/// CacheTo = new[]
|
/// CacheTo = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheToArgs
|
/// new Dockerbuild.Inputs.CacheToArgs
|
||||||
/// {
|
/// {
|
||||||
/// Registry = new Docker.Buildx.Inputs.CacheToRegistryArgs
|
/// Registry = new Dockerbuild.Inputs.CacheToRegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// ImageManifest = true,
|
/// ImageManifest = true,
|
||||||
/// OciMediaTypes = true,
|
/// OciMediaTypes = true,
|
||||||
@@ -162,14 +162,14 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "./app",
|
/// Location = "./app",
|
||||||
/// },
|
/// },
|
||||||
/// Push = true,
|
/// Push = true,
|
||||||
/// Registries = new[]
|
/// Registries = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.RegistryAuthArgs
|
/// new Dockerbuild.Inputs.RegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// Address = ecrRepository.RepositoryUrl,
|
/// Address = ecrRepository.RepositoryUrl,
|
||||||
/// Password = authToken.Apply(getAuthorizationTokenResult => getAuthorizationTokenResult.Password),
|
/// Password = authToken.Apply(getAuthorizationTokenResult => getAuthorizationTokenResult.Password),
|
||||||
@@ -194,20 +194,20 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
/// Platforms = new[]
|
/// Platforms = new[]
|
||||||
/// {
|
/// {
|
||||||
/// Docker.Buildx.Image.Platform.Plan9_amd64,
|
/// Dockerbuild.Platform.Plan9_amd64,
|
||||||
/// Docker.Buildx.Image.Platform.Plan9_386,
|
/// Dockerbuild.Platform.Plan9_386,
|
||||||
/// },
|
/// },
|
||||||
/// });
|
/// });
|
||||||
///
|
///
|
||||||
@@ -219,20 +219,20 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
/// Push = true,
|
/// Push = true,
|
||||||
/// Registries = new[]
|
/// Registries = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.RegistryAuthArgs
|
/// new Dockerbuild.Inputs.RegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// Address = "docker.io",
|
/// Address = "docker.io",
|
||||||
/// Password = dockerHubPassword,
|
/// Password = dockerHubPassword,
|
||||||
@@ -257,17 +257,17 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// CacheFrom = new[]
|
/// CacheFrom = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheFromArgs
|
/// new Dockerbuild.Inputs.CacheFromArgs
|
||||||
/// {
|
/// {
|
||||||
/// Local = new Docker.Buildx.Inputs.CacheFromLocalArgs
|
/// Local = new Dockerbuild.Inputs.CacheFromLocalArgs
|
||||||
/// {
|
/// {
|
||||||
/// Src = "tmp/cache",
|
/// Src = "tmp/cache",
|
||||||
/// },
|
/// },
|
||||||
@@ -275,16 +275,16 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// },
|
/// },
|
||||||
/// CacheTo = new[]
|
/// CacheTo = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheToArgs
|
/// new Dockerbuild.Inputs.CacheToArgs
|
||||||
/// {
|
/// {
|
||||||
/// Local = new Docker.Buildx.Inputs.CacheToLocalArgs
|
/// Local = new Dockerbuild.Inputs.CacheToLocalArgs
|
||||||
/// {
|
/// {
|
||||||
/// Dest = "tmp/cache",
|
/// Dest = "tmp/cache",
|
||||||
/// Mode = Docker.Buildx.Image.CacheMode.Max,
|
/// Mode = Dockerbuild.CacheMode.Max,
|
||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
@@ -298,17 +298,17 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Builder = new Docker.Buildx.Inputs.BuilderConfigArgs
|
/// Builder = new Dockerbuild.Inputs.BuilderConfigArgs
|
||||||
/// {
|
/// {
|
||||||
/// Name = "cloud-builder-name",
|
/// Name = "cloud-builder-name",
|
||||||
/// },
|
/// },
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
@@ -323,17 +323,17 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// BuildArgs =
|
/// BuildArgs =
|
||||||
/// {
|
/// {
|
||||||
/// { "SET_ME_TO_TRUE", "true" },
|
/// { "SET_ME_TO_TRUE", "true" },
|
||||||
/// },
|
/// },
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
@@ -347,13 +347,13 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
@@ -368,18 +368,18 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// Named =
|
/// Named =
|
||||||
/// {
|
/// {
|
||||||
/// { "golang:latest", new Docker.Buildx.Inputs.ContextArgs
|
/// { "golang:latest", new Dockerbuild.Inputs.ContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
/// Location = "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||||
/// } },
|
/// } },
|
||||||
@@ -395,13 +395,13 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
/// Location = "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
||||||
/// },
|
/// },
|
||||||
@@ -415,17 +415,17 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
/// Dockerfile = new Docker.Buildx.Inputs.DockerfileArgs
|
/// Dockerfile = new Dockerbuild.Inputs.DockerfileArgs
|
||||||
/// {
|
/// {
|
||||||
/// Inline = @"FROM busybox
|
/// Inline = @"FROM busybox
|
||||||
/// COPY hello.c ./
|
/// COPY hello.c ./
|
||||||
@@ -441,17 +441,17 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "https://github.com/docker-library/hello-world.git",
|
/// Location = "https://github.com/docker-library/hello-world.git",
|
||||||
/// },
|
/// },
|
||||||
/// Dockerfile = new Docker.Buildx.Inputs.DockerfileArgs
|
/// Dockerfile = new Dockerbuild.Inputs.DockerfileArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app/Dockerfile",
|
/// Location = "app/Dockerfile",
|
||||||
/// },
|
/// },
|
||||||
@@ -465,21 +465,21 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var image = new Docker.Buildx.Image("image", new()
|
/// var image = new Dockerbuild.Image("image", new()
|
||||||
/// {
|
/// {
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
/// Exports = new[]
|
/// Exports = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.ExportArgs
|
/// new Dockerbuild.Inputs.ExportArgs
|
||||||
/// {
|
/// {
|
||||||
/// Docker = new Docker.Buildx.Inputs.ExportDockerArgs
|
/// Docker = new Dockerbuild.Inputs.ExportDockerArgs
|
||||||
/// {
|
/// {
|
||||||
/// Tar = true,
|
/// Tar = true,
|
||||||
/// },
|
/// },
|
||||||
|
|||||||
36
sdk/dotnet/Index.cs
generated
36
sdk/dotnet/Index.cs
generated
@@ -24,17 +24,17 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// using System.Collections.Generic;
|
/// using System.Collections.Generic;
|
||||||
/// using System.Linq;
|
/// using System.Linq;
|
||||||
/// using Pulumi;
|
/// using Pulumi;
|
||||||
/// using Docker = Pulumi.Docker;
|
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||||
///
|
///
|
||||||
/// return await Deployment.RunAsync(() =>
|
/// return await Deployment.RunAsync(() =>
|
||||||
/// {
|
/// {
|
||||||
/// var amd64 = new Docker.Buildx.Image("amd64", new()
|
/// var amd64 = new Dockerbuild.Image("amd64", new()
|
||||||
/// {
|
/// {
|
||||||
/// CacheFrom = new[]
|
/// CacheFrom = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheFromArgs
|
/// new Dockerbuild.Inputs.CacheFromArgs
|
||||||
/// {
|
/// {
|
||||||
/// Registry = new Docker.Buildx.Inputs.CacheFromRegistryArgs
|
/// Registry = new Dockerbuild.Inputs.CacheFromRegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
/// Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
/// },
|
/// },
|
||||||
@@ -42,22 +42,22 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// },
|
/// },
|
||||||
/// CacheTo = new[]
|
/// CacheTo = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheToArgs
|
/// new Dockerbuild.Inputs.CacheToArgs
|
||||||
/// {
|
/// {
|
||||||
/// Registry = new Docker.Buildx.Inputs.CacheToRegistryArgs
|
/// Registry = new Dockerbuild.Inputs.CacheToRegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// Mode = Docker.Buildx.Image.CacheMode.Max,
|
/// Mode = Dockerbuild.CacheMode.Max,
|
||||||
/// Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
/// Ref = "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
/// Platforms = new[]
|
/// Platforms = new[]
|
||||||
/// {
|
/// {
|
||||||
/// Docker.Buildx.Image.Platform.Linux_amd64,
|
/// Dockerbuild.Platform.Linux_amd64,
|
||||||
/// },
|
/// },
|
||||||
/// Tags = new[]
|
/// Tags = new[]
|
||||||
/// {
|
/// {
|
||||||
@@ -65,13 +65,13 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// },
|
/// },
|
||||||
/// });
|
/// });
|
||||||
///
|
///
|
||||||
/// var arm64 = new Docker.Buildx.Image("arm64", new()
|
/// var arm64 = new Dockerbuild.Image("arm64", new()
|
||||||
/// {
|
/// {
|
||||||
/// CacheFrom = new[]
|
/// CacheFrom = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheFromArgs
|
/// new Dockerbuild.Inputs.CacheFromArgs
|
||||||
/// {
|
/// {
|
||||||
/// Registry = new Docker.Buildx.Inputs.CacheFromRegistryArgs
|
/// Registry = new Dockerbuild.Inputs.CacheFromRegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
/// Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
/// },
|
/// },
|
||||||
@@ -79,22 +79,22 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// },
|
/// },
|
||||||
/// CacheTo = new[]
|
/// CacheTo = new[]
|
||||||
/// {
|
/// {
|
||||||
/// new Docker.Buildx.Inputs.CacheToArgs
|
/// new Dockerbuild.Inputs.CacheToArgs
|
||||||
/// {
|
/// {
|
||||||
/// Registry = new Docker.Buildx.Inputs.CacheToRegistryArgs
|
/// Registry = new Dockerbuild.Inputs.CacheToRegistryArgs
|
||||||
/// {
|
/// {
|
||||||
/// Mode = Docker.Buildx.Image.CacheMode.Max,
|
/// Mode = Dockerbuild.CacheMode.Max,
|
||||||
/// Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
/// Ref = "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// },
|
/// },
|
||||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||||
/// {
|
/// {
|
||||||
/// Location = "app",
|
/// Location = "app",
|
||||||
/// },
|
/// },
|
||||||
/// Platforms = new[]
|
/// Platforms = new[]
|
||||||
/// {
|
/// {
|
||||||
/// Docker.Buildx.Image.Platform.Linux_arm64,
|
/// Dockerbuild.Platform.Linux_arm64,
|
||||||
/// },
|
/// },
|
||||||
/// Tags = new[]
|
/// Tags = new[]
|
||||||
/// {
|
/// {
|
||||||
@@ -102,7 +102,7 @@ namespace Pulumi.Dockerbuild
|
|||||||
/// },
|
/// },
|
||||||
/// });
|
/// });
|
||||||
///
|
///
|
||||||
/// var index = new Docker.Buildx.Index("index", new()
|
/// var index = new Dockerbuild.Index("index", new()
|
||||||
/// {
|
/// {
|
||||||
/// Sources = new[]
|
/// Sources = new[]
|
||||||
/// {
|
/// {
|
||||||
|
|||||||
154
sdk/go/dockerbuild/image.go
generated
154
sdk/go/dockerbuild/image.go
generated
@@ -30,12 +30,12 @@ import (
|
|||||||
//
|
//
|
||||||
// ## Migrating v3 and v4 Image resources
|
// ## Migrating v3 and v4 Image resources
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
// The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
// Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
// Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
//
|
//
|
||||||
// ### Behavioral differences
|
// ### Behavioral differences
|
||||||
//
|
//
|
||||||
// There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
// There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
//
|
//
|
||||||
// #### Previews
|
// #### Previews
|
||||||
//
|
//
|
||||||
@@ -46,8 +46,8 @@ import (
|
|||||||
// By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
// By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
// Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
// Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
//
|
//
|
||||||
// The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
// The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
// By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
// By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
// Previews run in non-CI environments will not build images.
|
// Previews run in non-CI environments will not build images.
|
||||||
// This behavior is still configurable with `buildOnPreview`.
|
// This behavior is still configurable with `buildOnPreview`.
|
||||||
//
|
//
|
||||||
@@ -56,7 +56,7 @@ import (
|
|||||||
// Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
// Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
// They expose a `skipPush: true` option to disable pushing.
|
// They expose a `skipPush: true` option to disable pushing.
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
// The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
//
|
//
|
||||||
// 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`).
|
// 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`).
|
||||||
// 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.
|
// 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.
|
||||||
@@ -67,7 +67,7 @@ import (
|
|||||||
//
|
//
|
||||||
// Version `4.x` of the Pulumi Docker provider does not support secrets.
|
// Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
// The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
// Instead, they should be passed directly as values.
|
// Instead, they should be passed directly as values.
|
||||||
// (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
// (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
// Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
// Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -82,7 +82,7 @@ import (
|
|||||||
// Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
// Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
// This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
// This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource delegates all caching behavior to Docker.
|
// The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
// `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.
|
// `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.
|
||||||
//
|
//
|
||||||
// #### Outputs
|
// #### Outputs
|
||||||
@@ -90,7 +90,7 @@ import (
|
|||||||
// Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
// Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
// In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
// In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
//
|
//
|
||||||
// Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
// Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
// As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
// As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
// If multiple tags were pushed this uses one at random.
|
// If multiple tags were pushed this uses one at random.
|
||||||
//
|
//
|
||||||
@@ -103,7 +103,7 @@ import (
|
|||||||
// The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
// The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
// If any are missing a subsequent `update` will push them.
|
// If any are missing a subsequent `update` will push them.
|
||||||
//
|
//
|
||||||
// When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
// When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
// Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
// Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
// 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.
|
// 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.
|
||||||
//
|
//
|
||||||
@@ -111,11 +111,11 @@ import (
|
|||||||
//
|
//
|
||||||
// ### Example migration
|
// ### Example migration
|
||||||
//
|
//
|
||||||
// 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.
|
// Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
//
|
//
|
||||||
// The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
// The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
// After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
// After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
// In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
// In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
//
|
//
|
||||||
// The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
// The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
// It it is shown with parameters similar to the `v3` example for completeness.
|
// It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -132,7 +132,7 @@ import (
|
|||||||
// "fmt"
|
// "fmt"
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecr"
|
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecr"
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
@@ -146,19 +146,19 @@ import (
|
|||||||
// authToken := ecr.GetAuthorizationTokenOutput(ctx, ecr.GetAuthorizationTokenOutputArgs{
|
// authToken := ecr.GetAuthorizationTokenOutput(ctx, ecr.GetAuthorizationTokenOutputArgs{
|
||||||
// RegistryId: ecrRepository.RegistryId,
|
// RegistryId: ecrRepository.RegistryId,
|
||||||
// }, nil)
|
// }, nil)
|
||||||
// myImage, err := buildx.NewImage(ctx, "my-image", &buildx.ImageArgs{
|
// myImage, err := dockerbuild.NewImage(ctx, "my-image", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Registry: &buildx.CacheFromRegistryArgs{
|
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||||
// return fmt.Sprintf("%v:cache", repositoryUrl), nil
|
// return fmt.Sprintf("%v:cache", repositoryUrl), nil
|
||||||
// }).(pulumi.StringOutput),
|
// }).(pulumi.StringOutput),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Registry: &buildx.CacheToRegistryArgs{
|
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
// ImageManifest: pulumi.Bool(true),
|
// ImageManifest: pulumi.Bool(true),
|
||||||
// OciMediaTypes: pulumi.Bool(true),
|
// OciMediaTypes: pulumi.Bool(true),
|
||||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||||
@@ -167,12 +167,12 @@ import (
|
|||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("./app"),
|
// Location: pulumi.String("./app"),
|
||||||
// },
|
// },
|
||||||
// Push: pulumi.Bool(true),
|
// Push: pulumi.Bool(true),
|
||||||
// Registries: buildx.RegistryAuthArray{
|
// Registries: dockerbuild.RegistryArray{
|
||||||
// &buildx.RegistryAuthArgs{
|
// &dockerbuild.RegistryArgs{
|
||||||
// Address: ecrRepository.RepositoryUrl,
|
// Address: ecrRepository.RepositoryUrl,
|
||||||
// Password: authToken.ApplyT(func(authToken ecr.GetAuthorizationTokenResult) (*string, error) {
|
// Password: authToken.ApplyT(func(authToken ecr.GetAuthorizationTokenResult) (*string, error) {
|
||||||
// return &authToken.Password, nil
|
// return &authToken.Password, nil
|
||||||
@@ -203,20 +203,20 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Platforms: buildx.PlatformArray{
|
// Platforms: dockerbuild.PlatformArray{
|
||||||
// buildx.Platform_Plan9_amd64,
|
// dockerbuild.Platform_Plan9_amd64,
|
||||||
// buildx.Platform_Plan9_386,
|
// dockerbuild.Platform_Plan9_386,
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
@@ -233,20 +233,20 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Push: pulumi.Bool(true),
|
// Push: pulumi.Bool(true),
|
||||||
// Registries: buildx.RegistryAuthArray{
|
// Registries: dockerbuild.RegistryArray{
|
||||||
// &buildx.RegistryAuthArgs{
|
// &dockerbuild.RegistryArgs{
|
||||||
// Address: pulumi.String("docker.io"),
|
// Address: pulumi.String("docker.io"),
|
||||||
// Password: pulumi.Any(dockerHubPassword),
|
// Password: pulumi.Any(dockerHubPassword),
|
||||||
// Username: pulumi.String("pulumibot"),
|
// Username: pulumi.String("pulumibot"),
|
||||||
@@ -271,30 +271,30 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Local: &buildx.CacheFromLocalArgs{
|
// Local: &dockerbuild.CacheFromLocalArgs{
|
||||||
// Src: pulumi.String("tmp/cache"),
|
// Src: pulumi.String("tmp/cache"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Local: &buildx.CacheToLocalArgs{
|
// Local: &dockerbuild.CacheToLocalArgs{
|
||||||
// Dest: pulumi.String("tmp/cache"),
|
// Dest: pulumi.String("tmp/cache"),
|
||||||
// Mode: buildx.CacheModeMax,
|
// Mode: dockerbuild.CacheModeMax,
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -312,18 +312,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Builder: &buildx.BuilderConfigArgs{
|
// Builder: &dockerbuild.BuilderConfigArgs{
|
||||||
// Name: pulumi.String("cloud-builder-name"),
|
// Name: pulumi.String("cloud-builder-name"),
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Exec: pulumi.Bool(true),
|
// Exec: pulumi.Bool(true),
|
||||||
@@ -342,18 +342,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// BuildArgs: pulumi.StringMap{
|
// BuildArgs: pulumi.StringMap{
|
||||||
// "SET_ME_TO_TRUE": pulumi.String("true"),
|
// "SET_ME_TO_TRUE": pulumi.String("true"),
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -371,15 +371,15 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Target: pulumi.String("build-me"),
|
// Target: pulumi.String("build-me"),
|
||||||
@@ -398,18 +398,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// Named: buildx.ContextMap{
|
// Named: dockerbuild.ContextMap{
|
||||||
// "golang:latest": &buildx.ContextArgs{
|
// "golang:latest": &dockerbuild.ContextArgs{
|
||||||
// Location: pulumi.String("docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"),
|
// Location: pulumi.String("docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
@@ -429,15 +429,15 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"),
|
// Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -455,18 +455,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Dockerfile: &buildx.DockerfileArgs{
|
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||||
// Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"),
|
// Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -484,18 +484,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("https://github.com/docker-library/hello-world.git"),
|
// Location: pulumi.String("https://github.com/docker-library/hello-world.git"),
|
||||||
// },
|
// },
|
||||||
// Dockerfile: &buildx.DockerfileArgs{
|
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||||
// Location: pulumi.String("app/Dockerfile"),
|
// Location: pulumi.String("app/Dockerfile"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -513,20 +513,20 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Exports: buildx.ExportArray{
|
// Exports: dockerbuild.ExportArray{
|
||||||
// &buildx.ExportArgs{
|
// &dockerbuild.ExportArgs{
|
||||||
// Docker: &buildx.ExportDockerArgs{
|
// Docker: &dockerbuild.ExportDockerArgs{
|
||||||
// Tar: pulumi.Bool(true),
|
// Tar: pulumi.Bool(true),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
|
|||||||
48
sdk/go/dockerbuild/index.go
generated
48
sdk/go/dockerbuild/index.go
generated
@@ -28,34 +28,34 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// amd64, err := buildx.NewImage(ctx, "amd64", &buildx.ImageArgs{
|
// amd64, err := dockerbuild.NewImage(ctx, "amd64", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Registry: &buildx.CacheFromRegistryArgs{
|
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Registry: &buildx.CacheToRegistryArgs{
|
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
// Mode: buildx.CacheModeMax,
|
// Mode: dockerbuild.CacheModeMax,
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Platforms: buildx.PlatformArray{
|
// Platforms: dockerbuild.PlatformArray{
|
||||||
// buildx.Platform_Linux_amd64,
|
// dockerbuild.Platform_Linux_amd64,
|
||||||
// },
|
// },
|
||||||
// Tags: pulumi.StringArray{
|
// Tags: pulumi.StringArray{
|
||||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
||||||
@@ -64,27 +64,27 @@ import (
|
|||||||
// if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
// }
|
// }
|
||||||
// arm64, err := buildx.NewImage(ctx, "arm64", &buildx.ImageArgs{
|
// arm64, err := dockerbuild.NewImage(ctx, "arm64", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Registry: &buildx.CacheFromRegistryArgs{
|
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Registry: &buildx.CacheToRegistryArgs{
|
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
// Mode: buildx.CacheModeMax,
|
// Mode: dockerbuild.CacheModeMax,
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Platforms: buildx.PlatformArray{
|
// Platforms: dockerbuild.PlatformArray{
|
||||||
// buildx.Platform_Linux_arm64,
|
// dockerbuild.Platform_Linux_arm64,
|
||||||
// },
|
// },
|
||||||
// Tags: pulumi.StringArray{
|
// Tags: pulumi.StringArray{
|
||||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
||||||
@@ -93,7 +93,7 @@ import (
|
|||||||
// if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
// }
|
// }
|
||||||
// index, err := buildx.NewIndex(ctx, "index", &buildx.IndexArgs{
|
// index, err := dockerbuild.NewIndex(ctx, "index", &dockerbuild.IndexArgs{
|
||||||
// Sources: pulumi.StringArray{
|
// Sources: pulumi.StringArray{
|
||||||
// amd64.Ref,
|
// amd64.Ref,
|
||||||
// arm64.Ref,
|
// arm64.Ref,
|
||||||
|
|||||||
154
sdk/go/dockerbuild/x/image.go
generated
154
sdk/go/dockerbuild/x/image.go
generated
@@ -30,12 +30,12 @@ import (
|
|||||||
//
|
//
|
||||||
// ## Migrating v3 and v4 Image resources
|
// ## Migrating v3 and v4 Image resources
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
// The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
// Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
// Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
//
|
//
|
||||||
// ### Behavioral differences
|
// ### Behavioral differences
|
||||||
//
|
//
|
||||||
// There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
// There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
//
|
//
|
||||||
// #### Previews
|
// #### Previews
|
||||||
//
|
//
|
||||||
@@ -46,8 +46,8 @@ import (
|
|||||||
// By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
// By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
// Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
// Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
//
|
//
|
||||||
// The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
// The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
// By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
// By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
// Previews run in non-CI environments will not build images.
|
// Previews run in non-CI environments will not build images.
|
||||||
// This behavior is still configurable with `buildOnPreview`.
|
// This behavior is still configurable with `buildOnPreview`.
|
||||||
//
|
//
|
||||||
@@ -56,7 +56,7 @@ import (
|
|||||||
// Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
// Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
// They expose a `skipPush: true` option to disable pushing.
|
// They expose a `skipPush: true` option to disable pushing.
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
// The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
//
|
//
|
||||||
// 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`).
|
// 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`).
|
||||||
// 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.
|
// 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.
|
||||||
@@ -67,7 +67,7 @@ import (
|
|||||||
//
|
//
|
||||||
// Version `4.x` of the Pulumi Docker provider does not support secrets.
|
// Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
// The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
// Instead, they should be passed directly as values.
|
// Instead, they should be passed directly as values.
|
||||||
// (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
// (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
// Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
// Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -82,7 +82,7 @@ import (
|
|||||||
// Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
// Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
// This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
// This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
//
|
//
|
||||||
// The `buildx.Image` resource delegates all caching behavior to Docker.
|
// The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
// `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.
|
// `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.
|
||||||
//
|
//
|
||||||
// #### Outputs
|
// #### Outputs
|
||||||
@@ -90,7 +90,7 @@ import (
|
|||||||
// Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
// Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
// In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
// In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
//
|
//
|
||||||
// Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
// Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
// As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
// As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
// If multiple tags were pushed this uses one at random.
|
// If multiple tags were pushed this uses one at random.
|
||||||
//
|
//
|
||||||
@@ -103,7 +103,7 @@ import (
|
|||||||
// The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
// The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
// If any are missing a subsequent `update` will push them.
|
// If any are missing a subsequent `update` will push them.
|
||||||
//
|
//
|
||||||
// When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
// When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
// Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
// Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
// 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.
|
// 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.
|
||||||
//
|
//
|
||||||
@@ -111,11 +111,11 @@ import (
|
|||||||
//
|
//
|
||||||
// ### Example migration
|
// ### Example migration
|
||||||
//
|
//
|
||||||
// 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.
|
// Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
//
|
//
|
||||||
// The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
// The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
// After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
// After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
// In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
// In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
//
|
//
|
||||||
// The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
// The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
// It it is shown with parameters similar to the `v3` example for completeness.
|
// It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -132,7 +132,7 @@ import (
|
|||||||
// "fmt"
|
// "fmt"
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecr"
|
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecr"
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
@@ -146,19 +146,19 @@ import (
|
|||||||
// authToken := ecr.GetAuthorizationTokenOutput(ctx, ecr.GetAuthorizationTokenOutputArgs{
|
// authToken := ecr.GetAuthorizationTokenOutput(ctx, ecr.GetAuthorizationTokenOutputArgs{
|
||||||
// RegistryId: ecrRepository.RegistryId,
|
// RegistryId: ecrRepository.RegistryId,
|
||||||
// }, nil)
|
// }, nil)
|
||||||
// myImage, err := buildx.NewImage(ctx, "my-image", &buildx.ImageArgs{
|
// myImage, err := dockerbuild.NewImage(ctx, "my-image", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Registry: &buildx.CacheFromRegistryArgs{
|
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||||
// return fmt.Sprintf("%v:cache", repositoryUrl), nil
|
// return fmt.Sprintf("%v:cache", repositoryUrl), nil
|
||||||
// }).(pulumi.StringOutput),
|
// }).(pulumi.StringOutput),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Registry: &buildx.CacheToRegistryArgs{
|
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
// ImageManifest: pulumi.Bool(true),
|
// ImageManifest: pulumi.Bool(true),
|
||||||
// OciMediaTypes: pulumi.Bool(true),
|
// OciMediaTypes: pulumi.Bool(true),
|
||||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||||
@@ -167,12 +167,12 @@ import (
|
|||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("./app"),
|
// Location: pulumi.String("./app"),
|
||||||
// },
|
// },
|
||||||
// Push: pulumi.Bool(true),
|
// Push: pulumi.Bool(true),
|
||||||
// Registries: buildx.RegistryAuthArray{
|
// Registries: dockerbuild.RegistryArray{
|
||||||
// &buildx.RegistryAuthArgs{
|
// &dockerbuild.RegistryArgs{
|
||||||
// Address: ecrRepository.RepositoryUrl,
|
// Address: ecrRepository.RepositoryUrl,
|
||||||
// Password: authToken.ApplyT(func(authToken ecr.GetAuthorizationTokenResult) (*string, error) {
|
// Password: authToken.ApplyT(func(authToken ecr.GetAuthorizationTokenResult) (*string, error) {
|
||||||
// return &authToken.Password, nil
|
// return &authToken.Password, nil
|
||||||
@@ -203,20 +203,20 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Platforms: buildx.PlatformArray{
|
// Platforms: dockerbuild.PlatformArray{
|
||||||
// buildx.Platform_Plan9_amd64,
|
// dockerbuild.Platform_Plan9_amd64,
|
||||||
// buildx.Platform_Plan9_386,
|
// dockerbuild.Platform_Plan9_386,
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
@@ -233,20 +233,20 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Push: pulumi.Bool(true),
|
// Push: pulumi.Bool(true),
|
||||||
// Registries: buildx.RegistryAuthArray{
|
// Registries: dockerbuild.RegistryArray{
|
||||||
// &buildx.RegistryAuthArgs{
|
// &dockerbuild.RegistryArgs{
|
||||||
// Address: pulumi.String("docker.io"),
|
// Address: pulumi.String("docker.io"),
|
||||||
// Password: pulumi.Any(dockerHubPassword),
|
// Password: pulumi.Any(dockerHubPassword),
|
||||||
// Username: pulumi.String("pulumibot"),
|
// Username: pulumi.String("pulumibot"),
|
||||||
@@ -271,30 +271,30 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Local: &buildx.CacheFromLocalArgs{
|
// Local: &dockerbuild.CacheFromLocalArgs{
|
||||||
// Src: pulumi.String("tmp/cache"),
|
// Src: pulumi.String("tmp/cache"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Local: &buildx.CacheToLocalArgs{
|
// Local: &dockerbuild.CacheToLocalArgs{
|
||||||
// Dest: pulumi.String("tmp/cache"),
|
// Dest: pulumi.String("tmp/cache"),
|
||||||
// Mode: buildx.CacheModeMax,
|
// Mode: dockerbuild.CacheModeMax,
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -312,18 +312,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Builder: &buildx.BuilderConfigArgs{
|
// Builder: &dockerbuild.BuilderConfigArgs{
|
||||||
// Name: pulumi.String("cloud-builder-name"),
|
// Name: pulumi.String("cloud-builder-name"),
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Exec: pulumi.Bool(true),
|
// Exec: pulumi.Bool(true),
|
||||||
@@ -342,18 +342,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// BuildArgs: pulumi.StringMap{
|
// BuildArgs: pulumi.StringMap{
|
||||||
// "SET_ME_TO_TRUE": pulumi.String("true"),
|
// "SET_ME_TO_TRUE": pulumi.String("true"),
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -371,15 +371,15 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Target: pulumi.String("build-me"),
|
// Target: pulumi.String("build-me"),
|
||||||
@@ -398,18 +398,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// Named: buildx.ContextMap{
|
// Named: dockerbuild.ContextMap{
|
||||||
// "golang:latest": &buildx.ContextArgs{
|
// "golang:latest": &dockerbuild.ContextArgs{
|
||||||
// Location: pulumi.String("docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"),
|
// Location: pulumi.String("docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
@@ -429,15 +429,15 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"),
|
// Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -455,18 +455,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Dockerfile: &buildx.DockerfileArgs{
|
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||||
// Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"),
|
// Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -484,18 +484,18 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("https://github.com/docker-library/hello-world.git"),
|
// Location: pulumi.String("https://github.com/docker-library/hello-world.git"),
|
||||||
// },
|
// },
|
||||||
// Dockerfile: &buildx.DockerfileArgs{
|
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||||
// Location: pulumi.String("app/Dockerfile"),
|
// Location: pulumi.String("app/Dockerfile"),
|
||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
@@ -513,20 +513,20 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Exports: buildx.ExportArray{
|
// Exports: dockerbuild.ExportArray{
|
||||||
// &buildx.ExportArgs{
|
// &dockerbuild.ExportArgs{
|
||||||
// Docker: &buildx.ExportDockerArgs{
|
// Docker: &dockerbuild.ExportDockerArgs{
|
||||||
// Tar: pulumi.Bool(true),
|
// Tar: pulumi.Bool(true),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
|
|||||||
48
sdk/go/dockerbuild/x/index.go
generated
48
sdk/go/dockerbuild/x/index.go
generated
@@ -28,34 +28,34 @@ import (
|
|||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
//
|
//
|
||||||
// "github.com/pulumi/pulumi-docker/sdk/v4/go/docker/buildx"
|
// "github.com/pulumi/pulumi-dockerbuild/sdk/go/dockerbuild"
|
||||||
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
|
||||||
//
|
//
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||||
// amd64, err := buildx.NewImage(ctx, "amd64", &buildx.ImageArgs{
|
// amd64, err := dockerbuild.NewImage(ctx, "amd64", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Registry: &buildx.CacheFromRegistryArgs{
|
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Registry: &buildx.CacheToRegistryArgs{
|
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
// Mode: buildx.CacheModeMax,
|
// Mode: dockerbuild.CacheModeMax,
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Platforms: buildx.PlatformArray{
|
// Platforms: dockerbuild.PlatformArray{
|
||||||
// buildx.Platform_Linux_amd64,
|
// dockerbuild.Platform_Linux_amd64,
|
||||||
// },
|
// },
|
||||||
// Tags: pulumi.StringArray{
|
// Tags: pulumi.StringArray{
|
||||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
||||||
@@ -64,27 +64,27 @@ import (
|
|||||||
// if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
// }
|
// }
|
||||||
// arm64, err := buildx.NewImage(ctx, "arm64", &buildx.ImageArgs{
|
// arm64, err := dockerbuild.NewImage(ctx, "arm64", &dockerbuild.ImageArgs{
|
||||||
// CacheFrom: buildx.CacheFromArray{
|
// CacheFrom: dockerbuild.CacheFromArray{
|
||||||
// &buildx.CacheFromArgs{
|
// &dockerbuild.CacheFromArgs{
|
||||||
// Registry: &buildx.CacheFromRegistryArgs{
|
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// CacheTo: buildx.CacheToArray{
|
// CacheTo: dockerbuild.CacheToArray{
|
||||||
// &buildx.CacheToArgs{
|
// &dockerbuild.CacheToArgs{
|
||||||
// Registry: &buildx.CacheToRegistryArgs{
|
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||||
// Mode: buildx.CacheModeMax,
|
// Mode: dockerbuild.CacheModeMax,
|
||||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// Context: &buildx.BuildContextArgs{
|
// Context: &dockerbuild.BuildContextArgs{
|
||||||
// Location: pulumi.String("app"),
|
// Location: pulumi.String("app"),
|
||||||
// },
|
// },
|
||||||
// Platforms: buildx.PlatformArray{
|
// Platforms: dockerbuild.PlatformArray{
|
||||||
// buildx.Platform_Linux_arm64,
|
// dockerbuild.Platform_Linux_arm64,
|
||||||
// },
|
// },
|
||||||
// Tags: pulumi.StringArray{
|
// Tags: pulumi.StringArray{
|
||||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
||||||
@@ -93,7 +93,7 @@ import (
|
|||||||
// if err != nil {
|
// if err != nil {
|
||||||
// return err
|
// return err
|
||||||
// }
|
// }
|
||||||
// index, err := buildx.NewIndex(ctx, "index", &buildx.IndexArgs{
|
// index, err := dockerbuild.NewIndex(ctx, "index", &dockerbuild.IndexArgs{
|
||||||
// Sources: pulumi.StringArray{
|
// Sources: pulumi.StringArray{
|
||||||
// amd64.Ref,
|
// amd64.Ref,
|
||||||
// arm64.Ref,
|
// arm64.Ref,
|
||||||
|
|||||||
132
sdk/java/src/main/java/com/pulumi/dockerbuild/Image.java
generated
132
sdk/java/src/main/java/com/pulumi/dockerbuild/Image.java
generated
@@ -44,12 +44,12 @@ import javax.annotation.Nullable;
|
|||||||
*
|
*
|
||||||
* ## Migrating v3 and v4 Image resources
|
* ## Migrating v3 and v4 Image resources
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
* The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
* Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
* Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
*
|
*
|
||||||
* ### Behavioral differences
|
* ### Behavioral differences
|
||||||
*
|
*
|
||||||
* There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
* There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
*
|
*
|
||||||
* #### Previews
|
* #### Previews
|
||||||
*
|
*
|
||||||
@@ -60,8 +60,8 @@ import javax.annotation.Nullable;
|
|||||||
* By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
* By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
* Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
* Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
*
|
*
|
||||||
* The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
* The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
* By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
* By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
* Previews run in non-CI environments will not build images.
|
* Previews run in non-CI environments will not build images.
|
||||||
* This behavior is still configurable with `buildOnPreview`.
|
* This behavior is still configurable with `buildOnPreview`.
|
||||||
*
|
*
|
||||||
@@ -70,7 +70,7 @@ import javax.annotation.Nullable;
|
|||||||
* Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
* Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
* They expose a `skipPush: true` option to disable pushing.
|
* They expose a `skipPush: true` option to disable pushing.
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
* The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
*
|
*
|
||||||
* 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`).
|
* 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`).
|
||||||
* 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.
|
* 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.
|
||||||
@@ -81,7 +81,7 @@ import javax.annotation.Nullable;
|
|||||||
*
|
*
|
||||||
* Version `4.x` of the Pulumi Docker provider does not support secrets.
|
* Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
* The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
* Instead, they should be passed directly as values.
|
* Instead, they should be passed directly as values.
|
||||||
* (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
* (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
* Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
* Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -96,7 +96,7 @@ import javax.annotation.Nullable;
|
|||||||
* Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
* Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
* This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
* This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource delegates all caching behavior to Docker.
|
* The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
* `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.
|
* `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.
|
||||||
*
|
*
|
||||||
* #### Outputs
|
* #### Outputs
|
||||||
@@ -104,7 +104,7 @@ import javax.annotation.Nullable;
|
|||||||
* Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
* Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
* In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
* In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
*
|
*
|
||||||
* Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
* Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
* As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
* As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
* If multiple tags were pushed this uses one at random.
|
* If multiple tags were pushed this uses one at random.
|
||||||
*
|
*
|
||||||
@@ -117,7 +117,7 @@ import javax.annotation.Nullable;
|
|||||||
* The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
* The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
* If any are missing a subsequent `update` will push them.
|
* If any are missing a subsequent `update` will push them.
|
||||||
*
|
*
|
||||||
* When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
* When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
* Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
* Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
* 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.
|
* 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.
|
||||||
*
|
*
|
||||||
@@ -125,11 +125,11 @@ import javax.annotation.Nullable;
|
|||||||
*
|
*
|
||||||
* ### Example migration
|
* ### Example migration
|
||||||
*
|
*
|
||||||
* 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.
|
* Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
*
|
*
|
||||||
* The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
* The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
* After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
* After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
* In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
* In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
*
|
*
|
||||||
* The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
* The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
* It it is shown with parameters similar to the `v3` example for completeness.
|
* It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -147,14 +147,14 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.aws.ecr.Repository;
|
* import com.pulumi.aws.ecr.Repository;
|
||||||
* import com.pulumi.aws.ecr.EcrFunctions;
|
* import com.pulumi.aws.ecr.EcrFunctions;
|
||||||
* import com.pulumi.aws.ecr.inputs.GetAuthorizationTokenArgs;
|
* import com.pulumi.aws.ecr.inputs.GetAuthorizationTokenArgs;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheFromRegistryArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheFromRegistryArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheToRegistryArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheToRegistryArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.RegistryAuthArgs;
|
* import com.pulumi.dockerbuild.inputs.RegistryArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -191,7 +191,7 @@ import javax.annotation.Nullable;
|
|||||||
* .location("./app")
|
* .location("./app")
|
||||||
* .build())
|
* .build())
|
||||||
* .push(true)
|
* .push(true)
|
||||||
* .registries(RegistryAuthArgs.builder()
|
* .registries(RegistryArgs.builder()
|
||||||
* .address(ecrRepository.repositoryUrl())
|
* .address(ecrRepository.repositoryUrl())
|
||||||
* .password(authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult).applyValue(authToken -> authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult.password())))
|
* .password(authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult).applyValue(authToken -> authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult.password())))
|
||||||
* .username(authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult).applyValue(authToken -> authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult.userName())))
|
* .username(authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult).applyValue(authToken -> authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult.userName())))
|
||||||
@@ -210,9 +210,9 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -245,10 +245,10 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.RegistryAuthArgs;
|
* import com.pulumi.dockerbuild.inputs.RegistryArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -267,7 +267,7 @@ import javax.annotation.Nullable;
|
|||||||
* .location("app")
|
* .location("app")
|
||||||
* .build())
|
* .build())
|
||||||
* .push(true)
|
* .push(true)
|
||||||
* .registries(RegistryAuthArgs.builder()
|
* .registries(RegistryArgs.builder()
|
||||||
* .address("docker.io")
|
* .address("docker.io")
|
||||||
* .password(dockerHubPassword)
|
* .password(dockerHubPassword)
|
||||||
* .username("pulumibot")
|
* .username("pulumibot")
|
||||||
@@ -286,13 +286,13 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheFromLocalArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheFromLocalArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheToLocalArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheToLocalArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -333,10 +333,10 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuilderConfigArgs;
|
* import com.pulumi.dockerbuild.inputs.BuilderConfigArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -370,9 +370,9 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -403,9 +403,9 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -436,9 +436,9 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -469,9 +469,9 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -501,10 +501,10 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.DockerfileArgs;
|
* import com.pulumi.dockerbuild.inputs.DockerfileArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -540,10 +540,10 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.DockerfileArgs;
|
* import com.pulumi.dockerbuild.inputs.DockerfileArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
@@ -576,11 +576,11 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.ExportArgs;
|
* import com.pulumi.dockerbuild.inputs.ExportArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.ExportDockerArgs;
|
* import com.pulumi.dockerbuild.inputs.ExportDockerArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
|
|||||||
@@ -33,15 +33,15 @@ import javax.annotation.Nullable;
|
|||||||
* import com.pulumi.Context;
|
* import com.pulumi.Context;
|
||||||
* import com.pulumi.Pulumi;
|
* import com.pulumi.Pulumi;
|
||||||
* import com.pulumi.core.Output;
|
* import com.pulumi.core.Output;
|
||||||
* import com.pulumi.docker.buildx.Image;
|
* import com.pulumi.dockerbuild.Image;
|
||||||
* import com.pulumi.docker.buildx.ImageArgs;
|
* import com.pulumi.dockerbuild.ImageArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheFromRegistryArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheFromRegistryArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.CacheToRegistryArgs;
|
* import com.pulumi.dockerbuild.inputs.CacheToRegistryArgs;
|
||||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||||
* import com.pulumi.docker.buildx.Index;
|
* import com.pulumi.dockerbuild.Index;
|
||||||
* import com.pulumi.docker.buildx.IndexArgs;
|
* import com.pulumi.dockerbuild.IndexArgs;
|
||||||
* import java.util.List;
|
* import java.util.List;
|
||||||
* import java.util.ArrayList;
|
* import java.util.ArrayList;
|
||||||
* import java.util.Map;
|
* import java.util.Map;
|
||||||
|
|||||||
88
sdk/nodejs/image.ts
generated
88
sdk/nodejs/image.ts
generated
@@ -26,12 +26,12 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ## Migrating v3 and v4 Image resources
|
* ## Migrating v3 and v4 Image resources
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
* The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
* Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
* Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
*
|
*
|
||||||
* ### Behavioral differences
|
* ### Behavioral differences
|
||||||
*
|
*
|
||||||
* There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
* There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
*
|
*
|
||||||
* #### Previews
|
* #### Previews
|
||||||
*
|
*
|
||||||
@@ -42,8 +42,8 @@ import * as utilities from "./utilities";
|
|||||||
* By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
* By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
* Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
* Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
*
|
*
|
||||||
* The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
* The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
* By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
* By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
* Previews run in non-CI environments will not build images.
|
* Previews run in non-CI environments will not build images.
|
||||||
* This behavior is still configurable with `buildOnPreview`.
|
* This behavior is still configurable with `buildOnPreview`.
|
||||||
*
|
*
|
||||||
@@ -52,7 +52,7 @@ import * as utilities from "./utilities";
|
|||||||
* Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
* Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
* They expose a `skipPush: true` option to disable pushing.
|
* They expose a `skipPush: true` option to disable pushing.
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
* The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
*
|
*
|
||||||
* 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`).
|
* 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`).
|
||||||
* 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.
|
* 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.
|
||||||
@@ -63,7 +63,7 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* Version `4.x` of the Pulumi Docker provider does not support secrets.
|
* Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
* The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
* Instead, they should be passed directly as values.
|
* Instead, they should be passed directly as values.
|
||||||
* (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
* (Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
* Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
* Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -78,7 +78,7 @@ import * as utilities from "./utilities";
|
|||||||
* Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
* Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
* This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
* This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
*
|
*
|
||||||
* The `buildx.Image` resource delegates all caching behavior to Docker.
|
* The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
* `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.
|
* `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.
|
||||||
*
|
*
|
||||||
* #### Outputs
|
* #### Outputs
|
||||||
@@ -86,7 +86,7 @@ import * as utilities from "./utilities";
|
|||||||
* Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
* Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
* In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
* In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
*
|
*
|
||||||
* Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
* Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
* As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
* As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
* If multiple tags were pushed this uses one at random.
|
* If multiple tags were pushed this uses one at random.
|
||||||
*
|
*
|
||||||
@@ -99,7 +99,7 @@ import * as utilities from "./utilities";
|
|||||||
* The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
* The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
* If any are missing a subsequent `update` will push them.
|
* If any are missing a subsequent `update` will push them.
|
||||||
*
|
*
|
||||||
* When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
* When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
* Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
* Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
* 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.
|
* 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.
|
||||||
*
|
*
|
||||||
@@ -107,11 +107,11 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ### Example migration
|
* ### Example migration
|
||||||
*
|
*
|
||||||
* 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.
|
* Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
*
|
*
|
||||||
* The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
* The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
* After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
* After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
* In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
* In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
*
|
*
|
||||||
* The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
* The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
* It it is shown with parameters similar to the `v3` example for completeness.
|
* It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -160,8 +160,8 @@ import * as utilities from "./utilities";
|
|||||||
* },
|
* },
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* // v3 Image after migrating to buildx.Image
|
* // v3 Image after migrating to dockerbuild.Image
|
||||||
* const v3Migrated = new docker.buildx.Image("v3-to-buildx", {
|
* const v3Migrated = new dockerbuild.Image("v3-to-buildx", {
|
||||||
* tags: ["myregistry.com/user/repo:latest", "local-tag"],
|
* tags: ["myregistry.com/user/repo:latest", "local-tag"],
|
||||||
* push: true,
|
* push: true,
|
||||||
* dockerfile: {
|
* dockerfile: {
|
||||||
@@ -219,8 +219,8 @@ import * as utilities from "./utilities";
|
|||||||
* },
|
* },
|
||||||
* });
|
* });
|
||||||
*
|
*
|
||||||
* // v4 Image after migrating to buildx.Image
|
* // v4 Image after migrating to dockerbuild.Image
|
||||||
* const v4Migrated = new docker.buildx.Image("v4-to-buildx", {
|
* const v4Migrated = new dockerbuild.Image("v4-to-buildx", {
|
||||||
* tags: ["myregistry.com/user/repo:latest"],
|
* tags: ["myregistry.com/user/repo:latest"],
|
||||||
* push: true,
|
* push: true,
|
||||||
* dockerfile: {
|
* dockerfile: {
|
||||||
@@ -253,13 +253,13 @@ import * as utilities from "./utilities";
|
|||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as aws from "@pulumi/aws";
|
* import * as aws from "@pulumi/aws";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const ecrRepository = new aws.ecr.Repository("ecr-repository", {});
|
* const ecrRepository = new aws.ecr.Repository("ecr-repository", {});
|
||||||
* const authToken = aws.ecr.getAuthorizationTokenOutput({
|
* const authToken = aws.ecr.getAuthorizationTokenOutput({
|
||||||
* registryId: ecrRepository.registryId,
|
* registryId: ecrRepository.registryId,
|
||||||
* });
|
* });
|
||||||
* const myImage = new docker.buildx.Image("my-image", {
|
* const myImage = new dockerbuild.Image("my-image", {
|
||||||
* cacheFrom: [{
|
* cacheFrom: [{
|
||||||
* registry: {
|
* registry: {
|
||||||
* ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
|
* ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
|
||||||
@@ -289,15 +289,15 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* context: {
|
* context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* },
|
* },
|
||||||
* platforms: [
|
* platforms: [
|
||||||
* docker.buildx.image.Platform.Plan9_amd64,
|
* dockerbuild.Platform.Plan9_amd64,
|
||||||
* docker.buildx.image.Platform.Plan9_386,
|
* dockerbuild.Platform.Plan9_386,
|
||||||
* ],
|
* ],
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
@@ -305,9 +305,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* context: {
|
* context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* },
|
* },
|
||||||
@@ -325,9 +325,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* cacheFrom: [{
|
* cacheFrom: [{
|
||||||
* local: {
|
* local: {
|
||||||
* src: "tmp/cache",
|
* src: "tmp/cache",
|
||||||
@@ -336,7 +336,7 @@ import * as utilities from "./utilities";
|
|||||||
* cacheTo: [{
|
* cacheTo: [{
|
||||||
* local: {
|
* local: {
|
||||||
* dest: "tmp/cache",
|
* dest: "tmp/cache",
|
||||||
* mode: docker.buildx.image.CacheMode.Max,
|
* mode: dockerbuild.CacheMode.Max,
|
||||||
* },
|
* },
|
||||||
* }],
|
* }],
|
||||||
* context: {
|
* context: {
|
||||||
@@ -348,9 +348,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* builder: {
|
* builder: {
|
||||||
* name: "cloud-builder-name",
|
* name: "cloud-builder-name",
|
||||||
* },
|
* },
|
||||||
@@ -364,9 +364,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* buildArgs: {
|
* buildArgs: {
|
||||||
* SET_ME_TO_TRUE: "true",
|
* SET_ME_TO_TRUE: "true",
|
||||||
* },
|
* },
|
||||||
@@ -379,9 +379,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* context: {
|
* context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* },
|
* },
|
||||||
@@ -392,9 +392,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {context: {
|
* const image = new dockerbuild.Image("image", {context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* named: {
|
* named: {
|
||||||
* "golang:latest": {
|
* "golang:latest": {
|
||||||
@@ -407,9 +407,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {context: {
|
* const image = new dockerbuild.Image("image", {context: {
|
||||||
* location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
* location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
||||||
* }});
|
* }});
|
||||||
* ```
|
* ```
|
||||||
@@ -417,9 +417,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* context: {
|
* context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* },
|
* },
|
||||||
@@ -434,9 +434,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* context: {
|
* context: {
|
||||||
* location: "https://github.com/docker-library/hello-world.git",
|
* location: "https://github.com/docker-library/hello-world.git",
|
||||||
* },
|
* },
|
||||||
@@ -449,9 +449,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const image = new docker.buildx.Image("image", {
|
* const image = new dockerbuild.Image("image", {
|
||||||
* context: {
|
* context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* },
|
* },
|
||||||
|
|||||||
16
sdk/nodejs/index_.ts
generated
16
sdk/nodejs/index_.ts
generated
@@ -21,9 +21,9 @@ import * as utilities from "./utilities";
|
|||||||
*
|
*
|
||||||
* ```typescript
|
* ```typescript
|
||||||
* import * as pulumi from "@pulumi/pulumi";
|
* import * as pulumi from "@pulumi/pulumi";
|
||||||
* import * as docker from "@pulumi/docker";
|
* import * as dockerbuild from "@pulumi/dockerbuild";
|
||||||
*
|
*
|
||||||
* const amd64 = new docker.buildx.Image("amd64", {
|
* const amd64 = new dockerbuild.Image("amd64", {
|
||||||
* cacheFrom: [{
|
* cacheFrom: [{
|
||||||
* registry: {
|
* registry: {
|
||||||
* ref: "docker.io/pulumi/pulumi:cache-amd64",
|
* ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
@@ -31,17 +31,17 @@ import * as utilities from "./utilities";
|
|||||||
* }],
|
* }],
|
||||||
* cacheTo: [{
|
* cacheTo: [{
|
||||||
* registry: {
|
* registry: {
|
||||||
* mode: docker.buildx.image.CacheMode.Max,
|
* mode: dockerbuild.CacheMode.Max,
|
||||||
* ref: "docker.io/pulumi/pulumi:cache-amd64",
|
* ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||||
* },
|
* },
|
||||||
* }],
|
* }],
|
||||||
* context: {
|
* context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* },
|
* },
|
||||||
* platforms: [docker.buildx.image.Platform.Linux_amd64],
|
* platforms: [dockerbuild.Platform.Linux_amd64],
|
||||||
* tags: ["docker.io/pulumi/pulumi:3.107.0-amd64"],
|
* tags: ["docker.io/pulumi/pulumi:3.107.0-amd64"],
|
||||||
* });
|
* });
|
||||||
* const arm64 = new docker.buildx.Image("arm64", {
|
* const arm64 = new dockerbuild.Image("arm64", {
|
||||||
* cacheFrom: [{
|
* cacheFrom: [{
|
||||||
* registry: {
|
* registry: {
|
||||||
* ref: "docker.io/pulumi/pulumi:cache-arm64",
|
* ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
@@ -49,17 +49,17 @@ import * as utilities from "./utilities";
|
|||||||
* }],
|
* }],
|
||||||
* cacheTo: [{
|
* cacheTo: [{
|
||||||
* registry: {
|
* registry: {
|
||||||
* mode: docker.buildx.image.CacheMode.Max,
|
* mode: dockerbuild.CacheMode.Max,
|
||||||
* ref: "docker.io/pulumi/pulumi:cache-arm64",
|
* ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||||
* },
|
* },
|
||||||
* }],
|
* }],
|
||||||
* context: {
|
* context: {
|
||||||
* location: "app",
|
* location: "app",
|
||||||
* },
|
* },
|
||||||
* platforms: [docker.buildx.image.Platform.Linux_arm64],
|
* platforms: [dockerbuild.Platform.Linux_arm64],
|
||||||
* tags: ["docker.io/pulumi/pulumi:3.107.0-arm64"],
|
* tags: ["docker.io/pulumi/pulumi:3.107.0-arm64"],
|
||||||
* });
|
* });
|
||||||
* const index = new docker.buildx.Index("index", {
|
* const index = new dockerbuild.Index("index", {
|
||||||
* sources: [
|
* sources: [
|
||||||
* amd64.ref,
|
* amd64.ref,
|
||||||
* arm64.ref,
|
* arm64.ref,
|
||||||
|
|||||||
264
sdk/python/pulumi_dockerbuild/image.py
generated
264
sdk/python/pulumi_dockerbuild/image.py
generated
@@ -629,12 +629,12 @@ class Image(pulumi.CustomResource):
|
|||||||
|
|
||||||
## Migrating v3 and v4 Image resources
|
## Migrating v3 and v4 Image resources
|
||||||
|
|
||||||
The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
|
|
||||||
### Behavioral differences
|
### Behavioral differences
|
||||||
|
|
||||||
There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
|
|
||||||
#### Previews
|
#### Previews
|
||||||
|
|
||||||
@@ -645,8 +645,8 @@ class Image(pulumi.CustomResource):
|
|||||||
By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
|
|
||||||
The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
Previews run in non-CI environments will not build images.
|
Previews run in non-CI environments will not build images.
|
||||||
This behavior is still configurable with `buildOnPreview`.
|
This behavior is still configurable with `buildOnPreview`.
|
||||||
|
|
||||||
@@ -655,7 +655,7 @@ class Image(pulumi.CustomResource):
|
|||||||
Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
They expose a `skipPush: true` option to disable pushing.
|
They expose a `skipPush: true` option to disable pushing.
|
||||||
|
|
||||||
The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
|
|
||||||
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`).
|
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`).
|
||||||
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.
|
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.
|
||||||
@@ -666,7 +666,7 @@ class Image(pulumi.CustomResource):
|
|||||||
|
|
||||||
Version `4.x` of the Pulumi Docker provider does not support secrets.
|
Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
|
|
||||||
The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
Instead, they should be passed directly as values.
|
Instead, they should be passed directly as values.
|
||||||
(Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
(Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -681,7 +681,7 @@ class Image(pulumi.CustomResource):
|
|||||||
Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
|
|
||||||
The `buildx.Image` resource delegates all caching behavior to Docker.
|
The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
`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.
|
`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.
|
||||||
|
|
||||||
#### Outputs
|
#### Outputs
|
||||||
@@ -689,7 +689,7 @@ class Image(pulumi.CustomResource):
|
|||||||
Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
|
|
||||||
Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
If multiple tags were pushed this uses one at random.
|
If multiple tags were pushed this uses one at random.
|
||||||
|
|
||||||
@@ -702,7 +702,7 @@ class Image(pulumi.CustomResource):
|
|||||||
The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
If any are missing a subsequent `update` will push them.
|
If any are missing a subsequent `update` will push them.
|
||||||
|
|
||||||
When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
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.
|
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.
|
||||||
|
|
||||||
@@ -710,11 +710,11 @@ class Image(pulumi.CustomResource):
|
|||||||
|
|
||||||
### Example migration
|
### Example migration
|
||||||
|
|
||||||
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.
|
Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
|
|
||||||
The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
|
|
||||||
The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
It it is shown with parameters similar to the `v3` example for completeness.
|
It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -726,28 +726,28 @@ class Image(pulumi.CustomResource):
|
|||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_aws as aws
|
import pulumi_aws as aws
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
ecr_repository = aws.ecr.Repository("ecr-repository")
|
ecr_repository = aws.ecr.Repository("ecr-repository")
|
||||||
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
||||||
my_image = docker.buildx.Image("my-image",
|
my_image = dockerbuild.Image("my-image",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
image_manifest=True,
|
image_manifest=True,
|
||||||
oci_media_types=True,
|
oci_media_types=True,
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="./app",
|
location="./app",
|
||||||
),
|
),
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker.buildx.RegistryAuthArgs(
|
registries=[dockerbuild.RegistryArgs(
|
||||||
address=ecr_repository.repository_url,
|
address=ecr_repository.repository_url,
|
||||||
password=auth_token.password,
|
password=auth_token.password,
|
||||||
username=auth_token.user_name,
|
username=auth_token.user_name,
|
||||||
@@ -758,28 +758,28 @@ class Image(pulumi.CustomResource):
|
|||||||
### Multi-platform image
|
### Multi-platform image
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[
|
platforms=[
|
||||||
docker.buildx.image.Platform.PLAN9_AMD64,
|
dockerbuild.Platform.PLAN9_AMD64,
|
||||||
docker.buildx.image.Platform.PLAN9_386,
|
dockerbuild.Platform.PLAN9_386,
|
||||||
])
|
])
|
||||||
```
|
```
|
||||||
### Registry export
|
### Registry export
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker.buildx.RegistryAuthArgs(
|
registries=[dockerbuild.RegistryArgs(
|
||||||
address="docker.io",
|
address="docker.io",
|
||||||
password=docker_hub_password,
|
password=docker_hub_password,
|
||||||
username="pulumibot",
|
username="pulumibot",
|
||||||
@@ -790,34 +790,34 @@ class Image(pulumi.CustomResource):
|
|||||||
### Caching
|
### Caching
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
local=docker.buildx.CacheFromLocalArgs(
|
local=dockerbuild.CacheFromLocalArgs(
|
||||||
src="tmp/cache",
|
src="tmp/cache",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
local=docker.buildx.CacheToLocalArgs(
|
local=dockerbuild.CacheToLocalArgs(
|
||||||
dest="tmp/cache",
|
dest="tmp/cache",
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Docker Build Cloud
|
### Docker Build Cloud
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
builder=docker.buildx.BuilderConfigArgs(
|
builder=dockerbuild.BuilderConfigArgs(
|
||||||
name="cloud-builder-name",
|
name="cloud-builder-name",
|
||||||
),
|
),
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
exec_=True)
|
exec_=True)
|
||||||
@@ -825,23 +825,23 @@ class Image(pulumi.CustomResource):
|
|||||||
### Build arguments
|
### Build arguments
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
build_args={
|
build_args={
|
||||||
"SET_ME_TO_TRUE": "true",
|
"SET_ME_TO_TRUE": "true",
|
||||||
},
|
},
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Build target
|
### Build target
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
target="build-me")
|
target="build-me")
|
||||||
@@ -849,12 +849,12 @@ class Image(pulumi.CustomResource):
|
|||||||
### Named contexts
|
### Named contexts
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image", context=docker.buildx.BuildContextArgs(
|
image = dockerbuild.Image("image", context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
named={
|
named={
|
||||||
"golang:latest": docker.buildx.ContextArgs(
|
"golang:latest": dockerbuild.ContextArgs(
|
||||||
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -863,22 +863,22 @@ class Image(pulumi.CustomResource):
|
|||||||
### Remote context
|
### Remote context
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image", context=docker.buildx.BuildContextArgs(
|
image = dockerbuild.Image("image", context=dockerbuild.BuildContextArgs(
|
||||||
location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Inline Dockerfile
|
### Inline Dockerfile
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
dockerfile=docker.buildx.DockerfileArgs(
|
dockerfile=dockerbuild.DockerfileArgs(
|
||||||
inline=\"\"\"FROM busybox
|
inline=\"\"\"FROM busybox
|
||||||
COPY hello.c ./
|
COPY hello.c ./
|
||||||
\"\"\",
|
\"\"\",
|
||||||
@@ -887,27 +887,27 @@ class Image(pulumi.CustomResource):
|
|||||||
### Remote context
|
### Remote context
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="https://github.com/docker-library/hello-world.git",
|
location="https://github.com/docker-library/hello-world.git",
|
||||||
),
|
),
|
||||||
dockerfile=docker.buildx.DockerfileArgs(
|
dockerfile=dockerbuild.DockerfileArgs(
|
||||||
location="app/Dockerfile",
|
location="app/Dockerfile",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Local export
|
### Local export
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
exports=[docker.buildx.ExportArgs(
|
exports=[dockerbuild.ExportArgs(
|
||||||
docker=docker.buildx.ExportDockerArgs(
|
docker=dockerbuild.ExportDockerArgs(
|
||||||
tar=True,
|
tar=True,
|
||||||
),
|
),
|
||||||
)])
|
)])
|
||||||
@@ -1066,12 +1066,12 @@ class Image(pulumi.CustomResource):
|
|||||||
|
|
||||||
## Migrating v3 and v4 Image resources
|
## Migrating v3 and v4 Image resources
|
||||||
|
|
||||||
The `buildx.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
The `dockerbuild.Image` resource provides a superset of functionality over the `Image` resources available in versions 3 and 4 of the Pulumi Docker provider.
|
||||||
Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
Existing `Image` resources can be converted to `dockerbuild.Image` resources with minor modifications.
|
||||||
|
|
||||||
### Behavioral differences
|
### Behavioral differences
|
||||||
|
|
||||||
There are several key behavioral differences to keep in mind when transitioning images to the new `buildx.Image` resource.
|
There are several key behavioral differences to keep in mind when transitioning images to the new `dockerbuild.Image` resource.
|
||||||
|
|
||||||
#### Previews
|
#### Previews
|
||||||
|
|
||||||
@@ -1082,8 +1082,8 @@ class Image(pulumi.CustomResource):
|
|||||||
By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
By default, `v4.x` `Image` resources do _not_ build during previews, but this behavior can be toggled with the `buildOnPreview` option.
|
||||||
Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
Some users felt this made previews in CI less helpful because they no longer detected bad images by default.
|
||||||
|
|
||||||
The default behavior of the `buildx.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
The default behavior of the `dockerbuild.Image` resource has been changed to strike a better balance between CI use cases and manual updates.
|
||||||
By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
By default, Pulumi will now only build `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||||
Previews run in non-CI environments will not build images.
|
Previews run in non-CI environments will not build images.
|
||||||
This behavior is still configurable with `buildOnPreview`.
|
This behavior is still configurable with `buildOnPreview`.
|
||||||
|
|
||||||
@@ -1092,7 +1092,7 @@ class Image(pulumi.CustomResource):
|
|||||||
Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
Versions `3.x` and `4.x` of the Pulumi Docker provider attempt to push images to remote registries by default.
|
||||||
They expose a `skipPush: true` option to disable pushing.
|
They expose a `skipPush: true` option to disable pushing.
|
||||||
|
|
||||||
The `buildx.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
The `dockerbuild.Image` resource matches the Docker CLI's behavior and does not push images anywhere by default.
|
||||||
|
|
||||||
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`).
|
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`).
|
||||||
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.
|
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.
|
||||||
@@ -1103,7 +1103,7 @@ class Image(pulumi.CustomResource):
|
|||||||
|
|
||||||
Version `4.x` of the Pulumi Docker provider does not support secrets.
|
Version `4.x` of the Pulumi Docker provider does not support secrets.
|
||||||
|
|
||||||
The `buildx.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
The `dockerbuild.Image` resource supports secrets but does not require those secrets to exist on-disk or in environment variables.
|
||||||
Instead, they should be passed directly as values.
|
Instead, they should be passed directly as values.
|
||||||
(Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
(Please be sure to familiarize yourself with Pulumi's [native secret handling](https://www.pulumi.com/docs/concepts/secrets/).)
|
||||||
Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
Pulumi also provides [ESC](https://www.pulumi.com/product/esc/) to make it easier to share secrets across stacks and environments.
|
||||||
@@ -1118,7 +1118,7 @@ class Image(pulumi.CustomResource):
|
|||||||
Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
Both versions 3 and 4 require specific environment variables to be set and deviate from Docker's native caching behavior.
|
||||||
This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
This can result in inefficient builds due to unnecessary image pulls, repeated file transfers, etc.
|
||||||
|
|
||||||
The `buildx.Image` resource delegates all caching behavior to Docker.
|
The `dockerbuild.Image` resource delegates all caching behavior to Docker.
|
||||||
`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.
|
`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.
|
||||||
|
|
||||||
#### Outputs
|
#### Outputs
|
||||||
@@ -1126,7 +1126,7 @@ class Image(pulumi.CustomResource):
|
|||||||
Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
Versions `3.x` and `4.x` of the provider exposed a `repoDigest` output which was a fully qualified tag with digest.
|
||||||
In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
In `4.x` this could also be a single sha256 hash if the image wasn't pushed.
|
||||||
|
|
||||||
Unlike earlier providers the `buildx.Image` resource can push multiple tags.
|
Unlike earlier providers the `dockerbuild.Image` resource can push multiple tags.
|
||||||
As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
As a convenience, it exposes a `ref` output consisting of a tag with digest as long as the image was pushed.
|
||||||
If multiple tags were pushed this uses one at random.
|
If multiple tags were pushed this uses one at random.
|
||||||
|
|
||||||
@@ -1139,7 +1139,7 @@ class Image(pulumi.CustomResource):
|
|||||||
The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
The `buidx.Image` will query your registries during `refresh` to ensure the expected tags exist.
|
||||||
If any are missing a subsequent `update` will push them.
|
If any are missing a subsequent `update` will push them.
|
||||||
|
|
||||||
When a `buildx.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
When a `dockerbuild.Image` is deleted, it will _attempt_ to also delete any pushed tags.
|
||||||
Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
Deletion of remote tags is not guaranteed because not all registries support the manifest `DELETE` API (`docker.io` in particular).
|
||||||
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.
|
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.
|
||||||
|
|
||||||
@@ -1147,11 +1147,11 @@ class Image(pulumi.CustomResource):
|
|||||||
|
|
||||||
### Example migration
|
### Example migration
|
||||||
|
|
||||||
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.
|
Examples of "fully-featured" `v3` and `v4` `Image` resources are shown below, along with an example `dockerbuild.Image` resource showing how they would look after migration.
|
||||||
|
|
||||||
The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
The `v3` resource leverages `buildx` via a `DOCKER_BUILDKIT` environment variable and CLI flags passed in with `extraOption`.
|
||||||
After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
After migration, the environment variable is no longer needed and CLI flags are now properties on the `dockerbuild.Image`.
|
||||||
In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
In almost all cases, properties of `dockerbuild.Image` are named after the Docker CLI flag they correspond to.
|
||||||
|
|
||||||
The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
The `v4` resource is less functional than its `v3` counterpart because it lacks the flexibility of `extraOptions`.
|
||||||
It it is shown with parameters similar to the `v3` example for completeness.
|
It it is shown with parameters similar to the `v3` example for completeness.
|
||||||
@@ -1163,28 +1163,28 @@ class Image(pulumi.CustomResource):
|
|||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_aws as aws
|
import pulumi_aws as aws
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
ecr_repository = aws.ecr.Repository("ecr-repository")
|
ecr_repository = aws.ecr.Repository("ecr-repository")
|
||||||
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
||||||
my_image = docker.buildx.Image("my-image",
|
my_image = dockerbuild.Image("my-image",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
image_manifest=True,
|
image_manifest=True,
|
||||||
oci_media_types=True,
|
oci_media_types=True,
|
||||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="./app",
|
location="./app",
|
||||||
),
|
),
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker.buildx.RegistryAuthArgs(
|
registries=[dockerbuild.RegistryArgs(
|
||||||
address=ecr_repository.repository_url,
|
address=ecr_repository.repository_url,
|
||||||
password=auth_token.password,
|
password=auth_token.password,
|
||||||
username=auth_token.user_name,
|
username=auth_token.user_name,
|
||||||
@@ -1195,28 +1195,28 @@ class Image(pulumi.CustomResource):
|
|||||||
### Multi-platform image
|
### Multi-platform image
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[
|
platforms=[
|
||||||
docker.buildx.image.Platform.PLAN9_AMD64,
|
dockerbuild.Platform.PLAN9_AMD64,
|
||||||
docker.buildx.image.Platform.PLAN9_386,
|
dockerbuild.Platform.PLAN9_386,
|
||||||
])
|
])
|
||||||
```
|
```
|
||||||
### Registry export
|
### Registry export
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
push=True,
|
push=True,
|
||||||
registries=[docker.buildx.RegistryAuthArgs(
|
registries=[dockerbuild.RegistryArgs(
|
||||||
address="docker.io",
|
address="docker.io",
|
||||||
password=docker_hub_password,
|
password=docker_hub_password,
|
||||||
username="pulumibot",
|
username="pulumibot",
|
||||||
@@ -1227,34 +1227,34 @@ class Image(pulumi.CustomResource):
|
|||||||
### Caching
|
### Caching
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
local=docker.buildx.CacheFromLocalArgs(
|
local=dockerbuild.CacheFromLocalArgs(
|
||||||
src="tmp/cache",
|
src="tmp/cache",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
local=docker.buildx.CacheToLocalArgs(
|
local=dockerbuild.CacheToLocalArgs(
|
||||||
dest="tmp/cache",
|
dest="tmp/cache",
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Docker Build Cloud
|
### Docker Build Cloud
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
builder=docker.buildx.BuilderConfigArgs(
|
builder=dockerbuild.BuilderConfigArgs(
|
||||||
name="cloud-builder-name",
|
name="cloud-builder-name",
|
||||||
),
|
),
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
exec_=True)
|
exec_=True)
|
||||||
@@ -1262,23 +1262,23 @@ class Image(pulumi.CustomResource):
|
|||||||
### Build arguments
|
### Build arguments
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
build_args={
|
build_args={
|
||||||
"SET_ME_TO_TRUE": "true",
|
"SET_ME_TO_TRUE": "true",
|
||||||
},
|
},
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Build target
|
### Build target
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
target="build-me")
|
target="build-me")
|
||||||
@@ -1286,12 +1286,12 @@ class Image(pulumi.CustomResource):
|
|||||||
### Named contexts
|
### Named contexts
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image", context=docker.buildx.BuildContextArgs(
|
image = dockerbuild.Image("image", context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
named={
|
named={
|
||||||
"golang:latest": docker.buildx.ContextArgs(
|
"golang:latest": dockerbuild.ContextArgs(
|
||||||
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -1300,22 +1300,22 @@ class Image(pulumi.CustomResource):
|
|||||||
### Remote context
|
### Remote context
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image", context=docker.buildx.BuildContextArgs(
|
image = dockerbuild.Image("image", context=dockerbuild.BuildContextArgs(
|
||||||
location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Inline Dockerfile
|
### Inline Dockerfile
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
dockerfile=docker.buildx.DockerfileArgs(
|
dockerfile=dockerbuild.DockerfileArgs(
|
||||||
inline=\"\"\"FROM busybox
|
inline=\"\"\"FROM busybox
|
||||||
COPY hello.c ./
|
COPY hello.c ./
|
||||||
\"\"\",
|
\"\"\",
|
||||||
@@ -1324,27 +1324,27 @@ class Image(pulumi.CustomResource):
|
|||||||
### Remote context
|
### Remote context
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="https://github.com/docker-library/hello-world.git",
|
location="https://github.com/docker-library/hello-world.git",
|
||||||
),
|
),
|
||||||
dockerfile=docker.buildx.DockerfileArgs(
|
dockerfile=dockerbuild.DockerfileArgs(
|
||||||
location="app/Dockerfile",
|
location="app/Dockerfile",
|
||||||
))
|
))
|
||||||
```
|
```
|
||||||
### Local export
|
### Local export
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
image = docker.buildx.Image("image",
|
image = dockerbuild.Image("image",
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
exports=[docker.buildx.ExportArgs(
|
exports=[dockerbuild.ExportArgs(
|
||||||
docker=docker.buildx.ExportDockerArgs(
|
docker=dockerbuild.ExportDockerArgs(
|
||||||
tar=True,
|
tar=True,
|
||||||
),
|
),
|
||||||
)])
|
)])
|
||||||
|
|||||||
72
sdk/python/pulumi_dockerbuild/index.py
generated
72
sdk/python/pulumi_dockerbuild/index.py
generated
@@ -116,43 +116,43 @@ class Index(pulumi.CustomResource):
|
|||||||
### Multi-platform registry caching
|
### Multi-platform registry caching
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
amd64 = docker.buildx.Image("amd64",
|
amd64 = dockerbuild.Image("amd64",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[docker.buildx.image.Platform.LINUX_AMD64],
|
platforms=[dockerbuild.Platform.LINUX_AMD64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||||
arm64 = docker.buildx.Image("arm64",
|
arm64 = dockerbuild.Image("arm64",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[docker.buildx.image.Platform.LINUX_ARM64],
|
platforms=[dockerbuild.Platform.LINUX_ARM64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||||
index = docker.buildx.Index("index",
|
index = dockerbuild.Index("index",
|
||||||
sources=[
|
sources=[
|
||||||
amd64.ref,
|
amd64.ref,
|
||||||
arm64.ref,
|
arm64.ref,
|
||||||
@@ -191,43 +191,43 @@ class Index(pulumi.CustomResource):
|
|||||||
### Multi-platform registry caching
|
### Multi-platform registry caching
|
||||||
```python
|
```python
|
||||||
import pulumi
|
import pulumi
|
||||||
import pulumi_docker as docker
|
import pulumi_dockerbuild as dockerbuild
|
||||||
|
|
||||||
amd64 = docker.buildx.Image("amd64",
|
amd64 = dockerbuild.Image("amd64",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[docker.buildx.image.Platform.LINUX_AMD64],
|
platforms=[dockerbuild.Platform.LINUX_AMD64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||||
arm64 = docker.buildx.Image("arm64",
|
arm64 = dockerbuild.Image("arm64",
|
||||||
cache_from=[docker.buildx.CacheFromArgs(
|
cache_from=[dockerbuild.CacheFromArgs(
|
||||||
registry=docker.buildx.CacheFromRegistryArgs(
|
registry=dockerbuild.CacheFromRegistryArgs(
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
cache_to=[docker.buildx.CacheToArgs(
|
cache_to=[dockerbuild.CacheToArgs(
|
||||||
registry=docker.buildx.CacheToRegistryArgs(
|
registry=dockerbuild.CacheToRegistryArgs(
|
||||||
mode=docker.buildx.image.CacheMode.MAX,
|
mode=dockerbuild.CacheMode.MAX,
|
||||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||||
),
|
),
|
||||||
)],
|
)],
|
||||||
context=docker.buildx.BuildContextArgs(
|
context=dockerbuild.BuildContextArgs(
|
||||||
location="app",
|
location="app",
|
||||||
),
|
),
|
||||||
platforms=[docker.buildx.image.Platform.LINUX_ARM64],
|
platforms=[dockerbuild.Platform.LINUX_ARM64],
|
||||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||||
index = docker.buildx.Index("index",
|
index = dockerbuild.Index("index",
|
||||||
sources=[
|
sources=[
|
||||||
amd64.ref,
|
amd64.ref,
|
||||||
arm64.ref,
|
arm64.ref,
|
||||||
|
|||||||
Reference in New Issue
Block a user