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}
|
||||
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))
|
||||
|
||||
bin/pulumi-gen-${PACK}: # Required by CI
|
||||
touch bin/pulumi-gen-${PACK}
|
||||
|
||||
$(shell find . -name '*.go'):
|
||||
|
||||
go.mod: $(shell find . -name '*.go')
|
||||
go.sum: go.mod
|
||||
go mod tidy
|
||||
@@ -245,6 +243,6 @@ sdk/java: $(PULUMI) bin/${PROVIDER}
|
||||
cd ${TMPDIR}/java/ && gradle --console=plain build
|
||||
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
|
||||
@touch docs
|
||||
|
||||
@@ -6,7 +6,7 @@ resources:
|
||||
ecr-repository:
|
||||
type: aws:ecr:Repository
|
||||
my-image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
tags:
|
||||
- ${ecr-repository.repositoryUrl}:latest
|
||||
@@ -36,7 +36,7 @@ runtime: yaml
|
||||
description: Multi-platform image
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
@@ -49,7 +49,7 @@ runtime: yaml
|
||||
description: Registry export
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
tags:
|
||||
- "docker.io/pulumi/pulumi:3.107.0"
|
||||
@@ -68,7 +68,7 @@ runtime: yaml
|
||||
description: Caching
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
@@ -85,7 +85,7 @@ runtime: yaml
|
||||
description: Docker Build Cloud
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
@@ -98,7 +98,7 @@ runtime: yaml
|
||||
description: Build arguments
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
@@ -110,7 +110,7 @@ runtime: yaml
|
||||
description: Build target
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
@@ -121,7 +121,7 @@ runtime: yaml
|
||||
description: Named contexts
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: app
|
||||
@@ -134,7 +134,7 @@ runtime: yaml
|
||||
description: Remote context
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"
|
||||
@@ -145,7 +145,7 @@ runtime: yaml
|
||||
description: Inline Dockerfile
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
inline: |
|
||||
@@ -159,7 +159,7 @@ runtime: yaml
|
||||
description: Remote context
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
location: app/Dockerfile
|
||||
@@ -171,7 +171,7 @@ runtime: yaml
|
||||
description: Local export
|
||||
resources:
|
||||
image:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
|
||||
@@ -3,7 +3,7 @@ description: Multi-platform registry caching
|
||||
runtime: yaml
|
||||
resources:
|
||||
arm64:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
@@ -20,7 +20,7 @@ resources:
|
||||
ref: "docker.io/pulumi/pulumi:cache-arm64"
|
||||
|
||||
amd64:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "app"
|
||||
@@ -37,7 +37,7 @@ resources:
|
||||
ref: "docker.io/pulumi/pulumi:cache-amd64"
|
||||
|
||||
index:
|
||||
type: dockerbuild:index:Index
|
||||
type: dockerbuild:Index
|
||||
properties:
|
||||
tag: "docker.io/pulumi/pulumi:3.107.0"
|
||||
sources:
|
||||
|
||||
@@ -8,7 +8,7 @@ plugins:
|
||||
resources:
|
||||
# docker buildx build -f app/Dockerfile.multiPlatform --platform plan9/amd64,plan9/386 app
|
||||
multiPlatform:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
location: "./app/Dockerfile.multiPlatform"
|
||||
@@ -20,7 +20,7 @@ resources:
|
||||
|
||||
# docker buildx build --output=type=registry app
|
||||
registryPush:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
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
|
||||
cached:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "./app"
|
||||
@@ -50,7 +50,7 @@ resources:
|
||||
|
||||
# docker buildx build -f app/Dockerfile.buildArgs --build-arg SET_ME_TO_TRUE=true app
|
||||
buildArgs:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
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
|
||||
extraHosts:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
location: "./app/Dockerfile.extraHosts"
|
||||
@@ -72,7 +72,7 @@ resources:
|
||||
|
||||
# docker buildx build -f app/Dockerfile.sshMount --ssh default app
|
||||
sshMount:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
location: "./app/Dockerfile.sshMount"
|
||||
@@ -83,7 +83,7 @@ resources:
|
||||
|
||||
# PASSWORD=hunter2 docker buildx build -f app/Dockerfile.secrets --secret id=password,env=PASSWORD app
|
||||
secrets:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
location: "./app/Dockerfile.secrets"
|
||||
@@ -94,7 +94,7 @@ resources:
|
||||
|
||||
# docker buildx build --label "description=This image will get a descriptive label 👍" app
|
||||
labels:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "./app"
|
||||
@@ -103,7 +103,7 @@ resources:
|
||||
|
||||
# docker buildx build -f app/Dockerfile.target --target build-me app
|
||||
target:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
location: "./app/Dockerfile.target"
|
||||
@@ -114,7 +114,7 @@ resources:
|
||||
# docker buildx build -f app/Dockerfile.namedContexts \
|
||||
# --build-context golang:latest=docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984 app
|
||||
namedContexts:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
location: "./app/Dockerfile.namedContexts"
|
||||
@@ -126,7 +126,7 @@ resources:
|
||||
|
||||
# docker buildx build https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile
|
||||
remoteContext:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"
|
||||
@@ -136,7 +136,7 @@ resources:
|
||||
# COPY hello.c ./
|
||||
# EOF
|
||||
remoteContextWithInline:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
inline: |
|
||||
@@ -147,7 +147,7 @@ resources:
|
||||
|
||||
# echo "FROM alpine" | docker buildx build -f - .
|
||||
inline:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
dockerfile:
|
||||
inline: |
|
||||
@@ -158,7 +158,7 @@ resources:
|
||||
|
||||
# docker buildx build --load .
|
||||
dockerLoad:
|
||||
type: dockerbuild:index:Image
|
||||
type: dockerbuild:Image
|
||||
properties:
|
||||
context:
|
||||
location: "./app"
|
||||
@@ -168,7 +168,7 @@ resources:
|
||||
|
||||
# docker buildx build - < app/Dockerfile.emptyContext
|
||||
#emptyContext:
|
||||
# type: dockerbuild:index:Image
|
||||
# type: dockerbuild:Image
|
||||
# properties:
|
||||
# file: "app/Dockerfile.emptyContext"
|
||||
# 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
|
||||
|
||||
The `buildx.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.
|
||||
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 `dockerbuild.Image` resources with minor modifications.
|
||||
|
||||
### 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
|
||||
|
||||
@@ -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.
|
||||
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.
|
||||
By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
Previews run in non-CI environments will not build images.
|
||||
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.
|
||||
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`).
|
||||
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.
|
||||
|
||||
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.
|
||||
(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.
|
||||
@@ -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.
|
||||
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.
|
||||
|
||||
#### 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.
|
||||
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.
|
||||
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.
|
||||
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).
|
||||
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
|
||||
|
||||
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`.
|
||||
After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
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 `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`.
|
||||
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
|
||||
const v3Migrated = new docker.buildx.Image("v3-to-buildx", {
|
||||
// v3 Image after migrating to dockerbuild.Image
|
||||
const v3Migrated = new dockerbuild.Image("v3-to-buildx", {
|
||||
tags: ["myregistry.com/user/repo:latest", "local-tag"],
|
||||
push: true,
|
||||
dockerfile: {
|
||||
@@ -195,8 +195,8 @@ const v4 = new docker.Image("v4-image", {
|
||||
},
|
||||
});
|
||||
|
||||
// v4 Image after migrating to buildx.Image
|
||||
const v4Migrated = new docker.buildx.Image("v4-to-buildx", {
|
||||
// v4 Image after migrating to dockerbuild.Image
|
||||
const v4Migrated = new dockerbuild.Image("v4-to-buildx", {
|
||||
tags: ["myregistry.com/user/repo:latest"],
|
||||
push: true,
|
||||
dockerfile: {
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
```typescript
|
||||
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: [{
|
||||
registry: {
|
||||
ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||
@@ -15,17 +15,17 @@ const amd64 = new docker.buildx.Image("amd64", {
|
||||
}],
|
||||
cacheTo: [{
|
||||
registry: {
|
||||
mode: docker.buildx.image.CacheMode.Max,
|
||||
mode: dockerbuild.CacheMode.Max,
|
||||
ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||
},
|
||||
}],
|
||||
context: {
|
||||
location: "app",
|
||||
},
|
||||
platforms: [docker.buildx.image.Platform.Linux_amd64],
|
||||
platforms: [dockerbuild.Platform.Linux_amd64],
|
||||
tags: ["docker.io/pulumi/pulumi:3.107.0-amd64"],
|
||||
});
|
||||
const arm64 = new docker.buildx.Image("arm64", {
|
||||
const arm64 = new dockerbuild.Image("arm64", {
|
||||
cacheFrom: [{
|
||||
registry: {
|
||||
ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||
@@ -33,17 +33,17 @@ const arm64 = new docker.buildx.Image("arm64", {
|
||||
}],
|
||||
cacheTo: [{
|
||||
registry: {
|
||||
mode: docker.buildx.image.CacheMode.Max,
|
||||
mode: dockerbuild.CacheMode.Max,
|
||||
ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||
},
|
||||
}],
|
||||
context: {
|
||||
location: "app",
|
||||
},
|
||||
platforms: [docker.buildx.image.Platform.Linux_arm64],
|
||||
platforms: [dockerbuild.Platform.Linux_arm64],
|
||||
tags: ["docker.io/pulumi/pulumi:3.107.0-arm64"],
|
||||
});
|
||||
const index = new docker.buildx.Index("index", {
|
||||
const index = new dockerbuild.Index("index", {
|
||||
sources: [
|
||||
amd64.ref,
|
||||
arm64.ref,
|
||||
@@ -54,43 +54,43 @@ export const ref = index.ref;
|
||||
```
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
amd64 = docker.buildx.Image("amd64",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
amd64 = dockerbuild.Image("amd64",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
platforms=[docker.buildx.image.Platform.LINUX_AMD64],
|
||||
platforms=[dockerbuild.Platform.LINUX_AMD64],
|
||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||
arm64 = docker.buildx.Image("arm64",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
arm64 = dockerbuild.Image("arm64",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
platforms=[docker.buildx.image.Platform.LINUX_ARM64],
|
||||
platforms=[dockerbuild.Platform.LINUX_ARM64],
|
||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||
index = docker.buildx.Index("index",
|
||||
index = dockerbuild.Index("index",
|
||||
sources=[
|
||||
amd64.ref,
|
||||
arm64.ref,
|
||||
@@ -102,17 +102,17 @@ pulumi.export("ref", index.ref)
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Pulumi;
|
||||
using Docker = Pulumi.Docker;
|
||||
using Dockerbuild = Pulumi.Dockerbuild;
|
||||
|
||||
return await Deployment.RunAsync(() =>
|
||||
{
|
||||
var amd64 = new Docker.Buildx.Image("amd64", new()
|
||||
var amd64 = new Dockerbuild.Image("amd64", 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",
|
||||
},
|
||||
@@ -120,22 +120,22 @@ return await Deployment.RunAsync(() =>
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
{
|
||||
Location = "app",
|
||||
},
|
||||
Platforms = new[]
|
||||
{
|
||||
Docker.Buildx.Image.Platform.Linux_amd64,
|
||||
Dockerbuild.Platform.Linux_amd64,
|
||||
},
|
||||
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[]
|
||||
{
|
||||
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",
|
||||
},
|
||||
@@ -157,22 +157,22 @@ return await Deployment.RunAsync(() =>
|
||||
},
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
{
|
||||
Location = "app",
|
||||
},
|
||||
Platforms = new[]
|
||||
{
|
||||
Docker.Buildx.Image.Platform.Linux_arm64,
|
||||
Dockerbuild.Platform.Linux_arm64,
|
||||
},
|
||||
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[]
|
||||
{
|
||||
@@ -201,33 +201,33 @@ return await Deployment.RunAsync(() =>
|
||||
package main
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
amd64, err := buildx.NewImage(ctx, "amd64", &buildx.ImageArgs{
|
||||
CacheFrom: buildx.CacheFromArray{
|
||||
&buildx.CacheFromArgs{
|
||||
Registry: &buildx.CacheFromRegistryArgs{
|
||||
amd64, err := dockerbuild.NewImage(ctx, "amd64", &dockerbuild.ImageArgs{
|
||||
CacheFrom: dockerbuild.CacheFromArray{
|
||||
&dockerbuild.CacheFromArgs{
|
||||
Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||
},
|
||||
},
|
||||
},
|
||||
CacheTo: buildx.CacheToArray{
|
||||
&buildx.CacheToArgs{
|
||||
Registry: &buildx.CacheToRegistryArgs{
|
||||
Mode: buildx.CacheModeMax,
|
||||
CacheTo: dockerbuild.CacheToArray{
|
||||
&dockerbuild.CacheToArgs{
|
||||
Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
Mode: dockerbuild.CacheModeMax,
|
||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Context: &buildx.BuildContextArgs{
|
||||
Context: &dockerbuild.BuildContextArgs{
|
||||
Location: pulumi.String("app"),
|
||||
},
|
||||
Platforms: buildx.PlatformArray{
|
||||
buildx.Platform_Linux_amd64,
|
||||
Platforms: dockerbuild.PlatformArray{
|
||||
dockerbuild.Platform_Linux_amd64,
|
||||
},
|
||||
Tags: pulumi.StringArray{
|
||||
pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
||||
@@ -236,27 +236,27 @@ func main() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
arm64, err := buildx.NewImage(ctx, "arm64", &buildx.ImageArgs{
|
||||
CacheFrom: buildx.CacheFromArray{
|
||||
&buildx.CacheFromArgs{
|
||||
Registry: &buildx.CacheFromRegistryArgs{
|
||||
arm64, err := dockerbuild.NewImage(ctx, "arm64", &dockerbuild.ImageArgs{
|
||||
CacheFrom: dockerbuild.CacheFromArray{
|
||||
&dockerbuild.CacheFromArgs{
|
||||
Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||
},
|
||||
},
|
||||
},
|
||||
CacheTo: buildx.CacheToArray{
|
||||
&buildx.CacheToArgs{
|
||||
Registry: &buildx.CacheToRegistryArgs{
|
||||
Mode: buildx.CacheModeMax,
|
||||
CacheTo: dockerbuild.CacheToArray{
|
||||
&dockerbuild.CacheToArgs{
|
||||
Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
Mode: dockerbuild.CacheModeMax,
|
||||
Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||
},
|
||||
},
|
||||
},
|
||||
Context: &buildx.BuildContextArgs{
|
||||
Context: &dockerbuild.BuildContextArgs{
|
||||
Location: pulumi.String("app"),
|
||||
},
|
||||
Platforms: buildx.PlatformArray{
|
||||
buildx.Platform_Linux_arm64,
|
||||
Platforms: dockerbuild.PlatformArray{
|
||||
dockerbuild.Platform_Linux_arm64,
|
||||
},
|
||||
Tags: pulumi.StringArray{
|
||||
pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
||||
@@ -265,7 +265,7 @@ func main() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
index, err := buildx.NewIndex(ctx, "index", &buildx.IndexArgs{
|
||||
index, err := dockerbuild.NewIndex(ctx, "index", &dockerbuild.IndexArgs{
|
||||
Sources: pulumi.StringArray{
|
||||
amd64.Ref,
|
||||
arm64.Ref,
|
||||
@@ -301,7 +301,7 @@ resources:
|
||||
- linux/amd64
|
||||
tags:
|
||||
- docker.io/pulumi/pulumi:3.107.0-amd64
|
||||
type: docker:buildx/image:Image
|
||||
type: dockerbuild:Image
|
||||
arm64:
|
||||
properties:
|
||||
cacheFrom:
|
||||
@@ -317,14 +317,14 @@ resources:
|
||||
- linux/arm64
|
||||
tags:
|
||||
- docker.io/pulumi/pulumi:3.107.0-arm64
|
||||
type: docker:buildx/image:Image
|
||||
type: dockerbuild:Image
|
||||
index:
|
||||
properties:
|
||||
sources:
|
||||
- ${amd64.ref}
|
||||
- ${arm64.ref}
|
||||
tag: docker.io/pulumi/pulumi:3.107.0
|
||||
type: docker:buildx/image:Index
|
||||
type: dockerbuild:Index
|
||||
runtime: yaml
|
||||
```
|
||||
```java
|
||||
@@ -333,15 +333,15 @@ package generated_program;
|
||||
import com.pulumi.Context;
|
||||
import com.pulumi.Pulumi;
|
||||
import com.pulumi.core.Output;
|
||||
import com.pulumi.docker.buildx.Image;
|
||||
import com.pulumi.docker.buildx.ImageArgs;
|
||||
import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
||||
import com.pulumi.docker.buildx.inputs.CacheFromRegistryArgs;
|
||||
import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
||||
import com.pulumi.docker.buildx.inputs.CacheToRegistryArgs;
|
||||
import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
import com.pulumi.docker.buildx.Index;
|
||||
import com.pulumi.docker.buildx.IndexArgs;
|
||||
import com.pulumi.dockerbuild.Image;
|
||||
import com.pulumi.dockerbuild.ImageArgs;
|
||||
import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||
import com.pulumi.dockerbuild.inputs.CacheFromRegistryArgs;
|
||||
import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||
import com.pulumi.dockerbuild.inputs.CacheToRegistryArgs;
|
||||
import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
import com.pulumi.dockerbuild.Index;
|
||||
import com.pulumi.dockerbuild.IndexArgs;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
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
|
||||
///
|
||||
/// The `buildx.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.
|
||||
/// 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 `dockerbuild.Image` resources with minor modifications.
|
||||
///
|
||||
/// ### 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
|
||||
///
|
||||
@@ -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.
|
||||
/// 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.
|
||||
/// By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
/// 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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
/// Previews run in non-CI environments will not build images.
|
||||
/// 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.
|
||||
/// 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`).
|
||||
/// 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.
|
||||
///
|
||||
/// 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.
|
||||
/// (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.
|
||||
@@ -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.
|
||||
/// 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.
|
||||
///
|
||||
/// #### 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.
|
||||
/// 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.
|
||||
/// 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.
|
||||
/// 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).
|
||||
/// 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
|
||||
///
|
||||
/// 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`.
|
||||
/// After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
/// In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
/// 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 `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`.
|
||||
/// It it is shown with parameters similar to the `v3` example for completeness.
|
||||
@@ -127,7 +127,7 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Aws = Pulumi.Aws;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// return await Deployment.RunAsync(() =>
|
||||
/// {
|
||||
@@ -138,13 +138,13 @@ namespace Pulumi.Dockerbuild
|
||||
/// RegistryId = ecrRepository.RegistryId,
|
||||
/// });
|
||||
///
|
||||
/// var myImage = new Docker.Buildx.Image("my-image", new()
|
||||
/// var myImage = new Dockerbuild.Image("my-image", 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"),
|
||||
/// },
|
||||
@@ -152,9 +152,9 @@ namespace Pulumi.Dockerbuild
|
||||
/// },
|
||||
/// CacheTo = new[]
|
||||
/// {
|
||||
/// new Docker.Buildx.Inputs.CacheToArgs
|
||||
/// new Dockerbuild.Inputs.CacheToArgs
|
||||
/// {
|
||||
/// Registry = new Docker.Buildx.Inputs.CacheToRegistryArgs
|
||||
/// Registry = new Dockerbuild.Inputs.CacheToRegistryArgs
|
||||
/// {
|
||||
/// ImageManifest = true,
|
||||
/// OciMediaTypes = true,
|
||||
@@ -162,14 +162,14 @@ namespace Pulumi.Dockerbuild
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "./app",
|
||||
/// },
|
||||
/// Push = true,
|
||||
/// Registries = new[]
|
||||
/// {
|
||||
/// new Docker.Buildx.Inputs.RegistryAuthArgs
|
||||
/// new Dockerbuild.Inputs.RegistryArgs
|
||||
/// {
|
||||
/// Address = ecrRepository.RepositoryUrl,
|
||||
/// Password = authToken.Apply(getAuthorizationTokenResult => getAuthorizationTokenResult.Password),
|
||||
@@ -194,20 +194,20 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
/// Platforms = new[]
|
||||
/// {
|
||||
/// Docker.Buildx.Image.Platform.Plan9_amd64,
|
||||
/// Docker.Buildx.Image.Platform.Plan9_386,
|
||||
/// Dockerbuild.Platform.Plan9_amd64,
|
||||
/// Dockerbuild.Platform.Plan9_386,
|
||||
/// },
|
||||
/// });
|
||||
///
|
||||
@@ -219,20 +219,20 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
/// Push = true,
|
||||
/// Registries = new[]
|
||||
/// {
|
||||
/// new Docker.Buildx.Inputs.RegistryAuthArgs
|
||||
/// new Dockerbuild.Inputs.RegistryArgs
|
||||
/// {
|
||||
/// Address = "docker.io",
|
||||
/// Password = dockerHubPassword,
|
||||
@@ -257,17 +257,17 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// return await Deployment.RunAsync(() =>
|
||||
/// {
|
||||
/// var image = new Docker.Buildx.Image("image", new()
|
||||
/// var image = new Dockerbuild.Image("image", 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",
|
||||
/// },
|
||||
@@ -275,16 +275,16 @@ namespace Pulumi.Dockerbuild
|
||||
/// },
|
||||
/// 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",
|
||||
/// Mode = Docker.Buildx.Image.CacheMode.Max,
|
||||
/// Mode = Dockerbuild.CacheMode.Max,
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "app",
|
||||
/// },
|
||||
@@ -298,17 +298,17 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "app",
|
||||
/// },
|
||||
@@ -323,17 +323,17 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// return await Deployment.RunAsync(() =>
|
||||
/// {
|
||||
/// var image = new Docker.Buildx.Image("image", new()
|
||||
/// var image = new Dockerbuild.Image("image", new()
|
||||
/// {
|
||||
/// BuildArgs =
|
||||
/// {
|
||||
/// { "SET_ME_TO_TRUE", "true" },
|
||||
/// },
|
||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "app",
|
||||
/// },
|
||||
@@ -347,13 +347,13 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
@@ -368,18 +368,18 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// Named =
|
||||
/// {
|
||||
/// { "golang:latest", new Docker.Buildx.Inputs.ContextArgs
|
||||
/// { "golang:latest", new Dockerbuild.Inputs.ContextArgs
|
||||
/// {
|
||||
/// Location = "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||
/// } },
|
||||
@@ -395,13 +395,13 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
@@ -415,17 +415,17 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
/// Dockerfile = new Docker.Buildx.Inputs.DockerfileArgs
|
||||
/// Dockerfile = new Dockerbuild.Inputs.DockerfileArgs
|
||||
/// {
|
||||
/// Inline = @"FROM busybox
|
||||
/// COPY hello.c ./
|
||||
@@ -441,17 +441,17 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
/// Dockerfile = new Docker.Buildx.Inputs.DockerfileArgs
|
||||
/// Dockerfile = new Dockerbuild.Inputs.DockerfileArgs
|
||||
/// {
|
||||
/// Location = "app/Dockerfile",
|
||||
/// },
|
||||
@@ -465,21 +465,21 @@ namespace Pulumi.Dockerbuild
|
||||
/// using System.Collections.Generic;
|
||||
/// using System.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// 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",
|
||||
/// },
|
||||
/// Exports = new[]
|
||||
/// {
|
||||
/// new Docker.Buildx.Inputs.ExportArgs
|
||||
/// new Dockerbuild.Inputs.ExportArgs
|
||||
/// {
|
||||
/// Docker = new Docker.Buildx.Inputs.ExportDockerArgs
|
||||
/// Docker = new Dockerbuild.Inputs.ExportDockerArgs
|
||||
/// {
|
||||
/// 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.Linq;
|
||||
/// using Pulumi;
|
||||
/// using Docker = Pulumi.Docker;
|
||||
/// using Dockerbuild = Pulumi.Dockerbuild;
|
||||
///
|
||||
/// return await Deployment.RunAsync(() =>
|
||||
/// {
|
||||
/// var amd64 = new Docker.Buildx.Image("amd64", new()
|
||||
/// var amd64 = new Dockerbuild.Image("amd64", 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",
|
||||
/// },
|
||||
@@ -42,22 +42,22 @@ namespace Pulumi.Dockerbuild
|
||||
/// },
|
||||
/// 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",
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "app",
|
||||
/// },
|
||||
/// Platforms = new[]
|
||||
/// {
|
||||
/// Docker.Buildx.Image.Platform.Linux_amd64,
|
||||
/// Dockerbuild.Platform.Linux_amd64,
|
||||
/// },
|
||||
/// 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[]
|
||||
/// {
|
||||
/// 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",
|
||||
/// },
|
||||
@@ -79,22 +79,22 @@ namespace Pulumi.Dockerbuild
|
||||
/// },
|
||||
/// 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",
|
||||
/// },
|
||||
/// },
|
||||
/// },
|
||||
/// Context = new Docker.Buildx.Inputs.BuildContextArgs
|
||||
/// Context = new Dockerbuild.Inputs.BuildContextArgs
|
||||
/// {
|
||||
/// Location = "app",
|
||||
/// },
|
||||
/// Platforms = new[]
|
||||
/// {
|
||||
/// Docker.Buildx.Image.Platform.Linux_arm64,
|
||||
/// Dockerbuild.Platform.Linux_arm64,
|
||||
/// },
|
||||
/// 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[]
|
||||
/// {
|
||||
|
||||
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
|
||||
//
|
||||
// The `buildx.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.
|
||||
// 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 `dockerbuild.Image` resources with minor modifications.
|
||||
//
|
||||
// ### 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
|
||||
//
|
||||
@@ -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.
|
||||
// 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.
|
||||
// By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
// 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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
// Previews run in non-CI environments will not build images.
|
||||
// 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.
|
||||
// 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`).
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
// (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.
|
||||
@@ -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.
|
||||
// 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.
|
||||
//
|
||||
// #### 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.
|
||||
// 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.
|
||||
// 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.
|
||||
// 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).
|
||||
// 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
|
||||
//
|
||||
// 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`.
|
||||
// After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
// In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
// 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 `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`.
|
||||
// It it is shown with parameters similar to the `v3` example for completeness.
|
||||
@@ -132,7 +132,7 @@ import (
|
||||
// "fmt"
|
||||
//
|
||||
// "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"
|
||||
//
|
||||
// )
|
||||
@@ -146,19 +146,19 @@ import (
|
||||
// authToken := ecr.GetAuthorizationTokenOutput(ctx, ecr.GetAuthorizationTokenOutputArgs{
|
||||
// RegistryId: ecrRepository.RegistryId,
|
||||
// }, nil)
|
||||
// myImage, err := buildx.NewImage(ctx, "my-image", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Registry: &buildx.CacheFromRegistryArgs{
|
||||
// myImage, err := dockerbuild.NewImage(ctx, "my-image", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||
// return fmt.Sprintf("%v:cache", repositoryUrl), nil
|
||||
// }).(pulumi.StringOutput),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Registry: &buildx.CacheToRegistryArgs{
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
// ImageManifest: pulumi.Bool(true),
|
||||
// OciMediaTypes: pulumi.Bool(true),
|
||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||
@@ -167,12 +167,12 @@ import (
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("./app"),
|
||||
// },
|
||||
// Push: pulumi.Bool(true),
|
||||
// Registries: buildx.RegistryAuthArray{
|
||||
// &buildx.RegistryAuthArgs{
|
||||
// Registries: dockerbuild.RegistryArray{
|
||||
// &dockerbuild.RegistryArgs{
|
||||
// Address: ecrRepository.RepositoryUrl,
|
||||
// Password: authToken.ApplyT(func(authToken ecr.GetAuthorizationTokenResult) (*string, error) {
|
||||
// return &authToken.Password, nil
|
||||
@@ -203,20 +203,20 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Platforms: buildx.PlatformArray{
|
||||
// buildx.Platform_Plan9_amd64,
|
||||
// buildx.Platform_Plan9_386,
|
||||
// Platforms: dockerbuild.PlatformArray{
|
||||
// dockerbuild.Platform_Plan9_amd64,
|
||||
// dockerbuild.Platform_Plan9_386,
|
||||
// },
|
||||
// })
|
||||
// if err != nil {
|
||||
@@ -233,20 +233,20 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Push: pulumi.Bool(true),
|
||||
// Registries: buildx.RegistryAuthArray{
|
||||
// &buildx.RegistryAuthArgs{
|
||||
// Registries: dockerbuild.RegistryArray{
|
||||
// &dockerbuild.RegistryArgs{
|
||||
// Address: pulumi.String("docker.io"),
|
||||
// Password: pulumi.Any(dockerHubPassword),
|
||||
// Username: pulumi.String("pulumibot"),
|
||||
@@ -271,30 +271,30 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Local: &buildx.CacheFromLocalArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Local: &dockerbuild.CacheFromLocalArgs{
|
||||
// Src: pulumi.String("tmp/cache"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Local: &buildx.CacheToLocalArgs{
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Local: &dockerbuild.CacheToLocalArgs{
|
||||
// Dest: pulumi.String("tmp/cache"),
|
||||
// Mode: buildx.CacheModeMax,
|
||||
// Mode: dockerbuild.CacheModeMax,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// })
|
||||
@@ -312,18 +312,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Builder: &buildx.BuilderConfigArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Builder: &dockerbuild.BuilderConfigArgs{
|
||||
// Name: pulumi.String("cloud-builder-name"),
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Exec: pulumi.Bool(true),
|
||||
@@ -342,18 +342,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// BuildArgs: pulumi.StringMap{
|
||||
// "SET_ME_TO_TRUE": pulumi.String("true"),
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// })
|
||||
@@ -371,15 +371,15 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Target: pulumi.String("build-me"),
|
||||
@@ -398,18 +398,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// Named: buildx.ContextMap{
|
||||
// "golang:latest": &buildx.ContextArgs{
|
||||
// Named: dockerbuild.ContextMap{
|
||||
// "golang:latest": &dockerbuild.ContextArgs{
|
||||
// Location: pulumi.String("docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"),
|
||||
// },
|
||||
// },
|
||||
@@ -429,15 +429,15 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"),
|
||||
// },
|
||||
// })
|
||||
@@ -455,18 +455,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Dockerfile: &buildx.DockerfileArgs{
|
||||
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||
// Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"),
|
||||
// },
|
||||
// })
|
||||
@@ -484,18 +484,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("https://github.com/docker-library/hello-world.git"),
|
||||
// },
|
||||
// Dockerfile: &buildx.DockerfileArgs{
|
||||
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||
// Location: pulumi.String("app/Dockerfile"),
|
||||
// },
|
||||
// })
|
||||
@@ -513,20 +513,20 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Exports: buildx.ExportArray{
|
||||
// &buildx.ExportArgs{
|
||||
// Docker: &buildx.ExportDockerArgs{
|
||||
// Exports: dockerbuild.ExportArray{
|
||||
// &dockerbuild.ExportArgs{
|
||||
// Docker: &dockerbuild.ExportDockerArgs{
|
||||
// Tar: pulumi.Bool(true),
|
||||
// },
|
||||
// },
|
||||
|
||||
48
sdk/go/dockerbuild/index.go
generated
48
sdk/go/dockerbuild/index.go
generated
@@ -28,34 +28,34 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// amd64, err := buildx.NewImage(ctx, "amd64", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Registry: &buildx.CacheFromRegistryArgs{
|
||||
// amd64, err := dockerbuild.NewImage(ctx, "amd64", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Registry: &buildx.CacheToRegistryArgs{
|
||||
// Mode: buildx.CacheModeMax,
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
// Mode: dockerbuild.CacheModeMax,
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Platforms: buildx.PlatformArray{
|
||||
// buildx.Platform_Linux_amd64,
|
||||
// Platforms: dockerbuild.PlatformArray{
|
||||
// dockerbuild.Platform_Linux_amd64,
|
||||
// },
|
||||
// Tags: pulumi.StringArray{
|
||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
||||
@@ -64,27 +64,27 @@ import (
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// arm64, err := buildx.NewImage(ctx, "arm64", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Registry: &buildx.CacheFromRegistryArgs{
|
||||
// arm64, err := dockerbuild.NewImage(ctx, "arm64", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Registry: &buildx.CacheToRegistryArgs{
|
||||
// Mode: buildx.CacheModeMax,
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
// Mode: dockerbuild.CacheModeMax,
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Platforms: buildx.PlatformArray{
|
||||
// buildx.Platform_Linux_arm64,
|
||||
// Platforms: dockerbuild.PlatformArray{
|
||||
// dockerbuild.Platform_Linux_arm64,
|
||||
// },
|
||||
// Tags: pulumi.StringArray{
|
||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
||||
@@ -93,7 +93,7 @@ import (
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// index, err := buildx.NewIndex(ctx, "index", &buildx.IndexArgs{
|
||||
// index, err := dockerbuild.NewIndex(ctx, "index", &dockerbuild.IndexArgs{
|
||||
// Sources: pulumi.StringArray{
|
||||
// amd64.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
|
||||
//
|
||||
// The `buildx.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.
|
||||
// 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 `dockerbuild.Image` resources with minor modifications.
|
||||
//
|
||||
// ### 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
|
||||
//
|
||||
@@ -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.
|
||||
// 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.
|
||||
// By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
// 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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
// Previews run in non-CI environments will not build images.
|
||||
// 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.
|
||||
// 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`).
|
||||
// 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.
|
||||
//
|
||||
// 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.
|
||||
// (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.
|
||||
@@ -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.
|
||||
// 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.
|
||||
//
|
||||
// #### 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.
|
||||
// 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.
|
||||
// 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.
|
||||
// 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).
|
||||
// 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
|
||||
//
|
||||
// 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`.
|
||||
// After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
// In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
// 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 `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`.
|
||||
// It it is shown with parameters similar to the `v3` example for completeness.
|
||||
@@ -132,7 +132,7 @@ import (
|
||||
// "fmt"
|
||||
//
|
||||
// "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"
|
||||
//
|
||||
// )
|
||||
@@ -146,19 +146,19 @@ import (
|
||||
// authToken := ecr.GetAuthorizationTokenOutput(ctx, ecr.GetAuthorizationTokenOutputArgs{
|
||||
// RegistryId: ecrRepository.RegistryId,
|
||||
// }, nil)
|
||||
// myImage, err := buildx.NewImage(ctx, "my-image", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Registry: &buildx.CacheFromRegistryArgs{
|
||||
// myImage, err := dockerbuild.NewImage(ctx, "my-image", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||
// return fmt.Sprintf("%v:cache", repositoryUrl), nil
|
||||
// }).(pulumi.StringOutput),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Registry: &buildx.CacheToRegistryArgs{
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
// ImageManifest: pulumi.Bool(true),
|
||||
// OciMediaTypes: pulumi.Bool(true),
|
||||
// Ref: ecrRepository.RepositoryUrl.ApplyT(func(repositoryUrl string) (string, error) {
|
||||
@@ -167,12 +167,12 @@ import (
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("./app"),
|
||||
// },
|
||||
// Push: pulumi.Bool(true),
|
||||
// Registries: buildx.RegistryAuthArray{
|
||||
// &buildx.RegistryAuthArgs{
|
||||
// Registries: dockerbuild.RegistryArray{
|
||||
// &dockerbuild.RegistryArgs{
|
||||
// Address: ecrRepository.RepositoryUrl,
|
||||
// Password: authToken.ApplyT(func(authToken ecr.GetAuthorizationTokenResult) (*string, error) {
|
||||
// return &authToken.Password, nil
|
||||
@@ -203,20 +203,20 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Platforms: buildx.PlatformArray{
|
||||
// buildx.Platform_Plan9_amd64,
|
||||
// buildx.Platform_Plan9_386,
|
||||
// Platforms: dockerbuild.PlatformArray{
|
||||
// dockerbuild.Platform_Plan9_amd64,
|
||||
// dockerbuild.Platform_Plan9_386,
|
||||
// },
|
||||
// })
|
||||
// if err != nil {
|
||||
@@ -233,20 +233,20 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Push: pulumi.Bool(true),
|
||||
// Registries: buildx.RegistryAuthArray{
|
||||
// &buildx.RegistryAuthArgs{
|
||||
// Registries: dockerbuild.RegistryArray{
|
||||
// &dockerbuild.RegistryArgs{
|
||||
// Address: pulumi.String("docker.io"),
|
||||
// Password: pulumi.Any(dockerHubPassword),
|
||||
// Username: pulumi.String("pulumibot"),
|
||||
@@ -271,30 +271,30 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Local: &buildx.CacheFromLocalArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Local: &dockerbuild.CacheFromLocalArgs{
|
||||
// Src: pulumi.String("tmp/cache"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Local: &buildx.CacheToLocalArgs{
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Local: &dockerbuild.CacheToLocalArgs{
|
||||
// Dest: pulumi.String("tmp/cache"),
|
||||
// Mode: buildx.CacheModeMax,
|
||||
// Mode: dockerbuild.CacheModeMax,
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// })
|
||||
@@ -312,18 +312,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Builder: &buildx.BuilderConfigArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Builder: &dockerbuild.BuilderConfigArgs{
|
||||
// Name: pulumi.String("cloud-builder-name"),
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Exec: pulumi.Bool(true),
|
||||
@@ -342,18 +342,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// BuildArgs: pulumi.StringMap{
|
||||
// "SET_ME_TO_TRUE": pulumi.String("true"),
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// })
|
||||
@@ -371,15 +371,15 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Target: pulumi.String("build-me"),
|
||||
@@ -398,18 +398,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// Named: buildx.ContextMap{
|
||||
// "golang:latest": &buildx.ContextArgs{
|
||||
// Named: dockerbuild.ContextMap{
|
||||
// "golang:latest": &dockerbuild.ContextArgs{
|
||||
// Location: pulumi.String("docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"),
|
||||
// },
|
||||
// },
|
||||
@@ -429,15 +429,15 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"),
|
||||
// },
|
||||
// })
|
||||
@@ -455,18 +455,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Dockerfile: &buildx.DockerfileArgs{
|
||||
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||
// Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"),
|
||||
// },
|
||||
// })
|
||||
@@ -484,18 +484,18 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("https://github.com/docker-library/hello-world.git"),
|
||||
// },
|
||||
// Dockerfile: &buildx.DockerfileArgs{
|
||||
// Dockerfile: &dockerbuild.DockerfileArgs{
|
||||
// Location: pulumi.String("app/Dockerfile"),
|
||||
// },
|
||||
// })
|
||||
@@ -513,20 +513,20 @@ 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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// _, err := buildx.NewImage(ctx, "image", &buildx.ImageArgs{
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// _, err := dockerbuild.NewImage(ctx, "image", &dockerbuild.ImageArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Exports: buildx.ExportArray{
|
||||
// &buildx.ExportArgs{
|
||||
// Docker: &buildx.ExportDockerArgs{
|
||||
// Exports: dockerbuild.ExportArray{
|
||||
// &dockerbuild.ExportArgs{
|
||||
// Docker: &dockerbuild.ExportDockerArgs{
|
||||
// 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 (
|
||||
//
|
||||
// "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"
|
||||
//
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// pulumi.Run(func(ctx *pulumi.Context) error {
|
||||
// amd64, err := buildx.NewImage(ctx, "amd64", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Registry: &buildx.CacheFromRegistryArgs{
|
||||
// amd64, err := dockerbuild.NewImage(ctx, "amd64", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Registry: &buildx.CacheToRegistryArgs{
|
||||
// Mode: buildx.CacheModeMax,
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
// Mode: dockerbuild.CacheModeMax,
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-amd64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Platforms: buildx.PlatformArray{
|
||||
// buildx.Platform_Linux_amd64,
|
||||
// Platforms: dockerbuild.PlatformArray{
|
||||
// dockerbuild.Platform_Linux_amd64,
|
||||
// },
|
||||
// Tags: pulumi.StringArray{
|
||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-amd64"),
|
||||
@@ -64,27 +64,27 @@ import (
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// arm64, err := buildx.NewImage(ctx, "arm64", &buildx.ImageArgs{
|
||||
// CacheFrom: buildx.CacheFromArray{
|
||||
// &buildx.CacheFromArgs{
|
||||
// Registry: &buildx.CacheFromRegistryArgs{
|
||||
// arm64, err := dockerbuild.NewImage(ctx, "arm64", &dockerbuild.ImageArgs{
|
||||
// CacheFrom: dockerbuild.CacheFromArray{
|
||||
// &dockerbuild.CacheFromArgs{
|
||||
// Registry: &dockerbuild.CacheFromRegistryArgs{
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// CacheTo: buildx.CacheToArray{
|
||||
// &buildx.CacheToArgs{
|
||||
// Registry: &buildx.CacheToRegistryArgs{
|
||||
// Mode: buildx.CacheModeMax,
|
||||
// CacheTo: dockerbuild.CacheToArray{
|
||||
// &dockerbuild.CacheToArgs{
|
||||
// Registry: &dockerbuild.CacheToRegistryArgs{
|
||||
// Mode: dockerbuild.CacheModeMax,
|
||||
// Ref: pulumi.String("docker.io/pulumi/pulumi:cache-arm64"),
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// Context: &buildx.BuildContextArgs{
|
||||
// Context: &dockerbuild.BuildContextArgs{
|
||||
// Location: pulumi.String("app"),
|
||||
// },
|
||||
// Platforms: buildx.PlatformArray{
|
||||
// buildx.Platform_Linux_arm64,
|
||||
// Platforms: dockerbuild.PlatformArray{
|
||||
// dockerbuild.Platform_Linux_arm64,
|
||||
// },
|
||||
// Tags: pulumi.StringArray{
|
||||
// pulumi.String("docker.io/pulumi/pulumi:3.107.0-arm64"),
|
||||
@@ -93,7 +93,7 @@ import (
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
// index, err := buildx.NewIndex(ctx, "index", &buildx.IndexArgs{
|
||||
// index, err := dockerbuild.NewIndex(ctx, "index", &dockerbuild.IndexArgs{
|
||||
// Sources: pulumi.StringArray{
|
||||
// amd64.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
|
||||
*
|
||||
* The `buildx.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.
|
||||
* 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 `dockerbuild.Image` resources with minor modifications.
|
||||
*
|
||||
* ### 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
|
||||
*
|
||||
@@ -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.
|
||||
* 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.
|
||||
* By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
* 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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
* Previews run in non-CI environments will not build images.
|
||||
* 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.
|
||||
* 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`).
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* (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.
|
||||
@@ -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.
|
||||
* 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.
|
||||
*
|
||||
* #### 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.
|
||||
* 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.
|
||||
* 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.
|
||||
* 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).
|
||||
* 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
|
||||
*
|
||||
* 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`.
|
||||
* After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
* In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
* 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 `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`.
|
||||
* 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.EcrFunctions;
|
||||
* import com.pulumi.aws.ecr.inputs.GetAuthorizationTokenArgs;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheFromRegistryArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheToRegistryArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.RegistryAuthArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheFromRegistryArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheToRegistryArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.RegistryArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -191,7 +191,7 @@ import javax.annotation.Nullable;
|
||||
* .location("./app")
|
||||
* .build())
|
||||
* .push(true)
|
||||
* .registries(RegistryAuthArgs.builder()
|
||||
* .registries(RegistryArgs.builder()
|
||||
* .address(ecrRepository.repositoryUrl())
|
||||
* .password(authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult).applyValue(authToken -> authToken.applyValue(getAuthorizationTokenResult -> getAuthorizationTokenResult.password())))
|
||||
* .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.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -245,10 +245,10 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.RegistryAuthArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.RegistryArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -267,7 +267,7 @@ import javax.annotation.Nullable;
|
||||
* .location("app")
|
||||
* .build())
|
||||
* .push(true)
|
||||
* .registries(RegistryAuthArgs.builder()
|
||||
* .registries(RegistryArgs.builder()
|
||||
* .address("docker.io")
|
||||
* .password(dockerHubPassword)
|
||||
* .username("pulumibot")
|
||||
@@ -286,13 +286,13 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheFromLocalArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheToLocalArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheFromLocalArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheToLocalArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -333,10 +333,10 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuilderConfigArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuilderConfigArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -370,9 +370,9 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -403,9 +403,9 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -436,9 +436,9 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -469,9 +469,9 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -501,10 +501,10 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.DockerfileArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.DockerfileArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -540,10 +540,10 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.DockerfileArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.DockerfileArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
@@ -576,11 +576,11 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.ExportArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.ExportDockerArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.ExportArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.ExportDockerArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* import java.util.Map;
|
||||
|
||||
@@ -33,15 +33,15 @@ import javax.annotation.Nullable;
|
||||
* import com.pulumi.Context;
|
||||
* import com.pulumi.Pulumi;
|
||||
* import com.pulumi.core.Output;
|
||||
* import com.pulumi.docker.buildx.Image;
|
||||
* import com.pulumi.docker.buildx.ImageArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheFromArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheFromRegistryArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheToArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.CacheToRegistryArgs;
|
||||
* import com.pulumi.docker.buildx.inputs.BuildContextArgs;
|
||||
* import com.pulumi.docker.buildx.Index;
|
||||
* import com.pulumi.docker.buildx.IndexArgs;
|
||||
* import com.pulumi.dockerbuild.Image;
|
||||
* import com.pulumi.dockerbuild.ImageArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheFromArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheFromRegistryArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheToArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.CacheToRegistryArgs;
|
||||
* import com.pulumi.dockerbuild.inputs.BuildContextArgs;
|
||||
* import com.pulumi.dockerbuild.Index;
|
||||
* import com.pulumi.dockerbuild.IndexArgs;
|
||||
* import java.util.List;
|
||||
* import java.util.ArrayList;
|
||||
* 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
|
||||
*
|
||||
* The `buildx.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.
|
||||
* 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 `dockerbuild.Image` resources with minor modifications.
|
||||
*
|
||||
* ### 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
|
||||
*
|
||||
@@ -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.
|
||||
* 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.
|
||||
* By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
* 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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
* Previews run in non-CI environments will not build images.
|
||||
* 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.
|
||||
* 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`).
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
* (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.
|
||||
@@ -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.
|
||||
* 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.
|
||||
*
|
||||
* #### 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.
|
||||
* 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.
|
||||
* 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.
|
||||
* 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).
|
||||
* 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
|
||||
*
|
||||
* 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`.
|
||||
* After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
* In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
* 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 `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`.
|
||||
* 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
|
||||
* const v3Migrated = new docker.buildx.Image("v3-to-buildx", {
|
||||
* // v3 Image after migrating to dockerbuild.Image
|
||||
* const v3Migrated = new dockerbuild.Image("v3-to-buildx", {
|
||||
* tags: ["myregistry.com/user/repo:latest", "local-tag"],
|
||||
* push: true,
|
||||
* dockerfile: {
|
||||
@@ -219,8 +219,8 @@ import * as utilities from "./utilities";
|
||||
* },
|
||||
* });
|
||||
*
|
||||
* // v4 Image after migrating to buildx.Image
|
||||
* const v4Migrated = new docker.buildx.Image("v4-to-buildx", {
|
||||
* // v4 Image after migrating to dockerbuild.Image
|
||||
* const v4Migrated = new dockerbuild.Image("v4-to-buildx", {
|
||||
* tags: ["myregistry.com/user/repo:latest"],
|
||||
* push: true,
|
||||
* dockerfile: {
|
||||
@@ -253,13 +253,13 @@ import * as utilities from "./utilities";
|
||||
* ```typescript
|
||||
* import * as pulumi from "@pulumi/pulumi";
|
||||
* 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 authToken = aws.ecr.getAuthorizationTokenOutput({
|
||||
* registryId: ecrRepository.registryId,
|
||||
* });
|
||||
* const myImage = new docker.buildx.Image("my-image", {
|
||||
* const myImage = new dockerbuild.Image("my-image", {
|
||||
* cacheFrom: [{
|
||||
* registry: {
|
||||
* ref: pulumi.interpolate`${ecrRepository.repositoryUrl}:cache`,
|
||||
@@ -289,15 +289,15 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* location: "app",
|
||||
* },
|
||||
* platforms: [
|
||||
* docker.buildx.image.Platform.Plan9_amd64,
|
||||
* docker.buildx.image.Platform.Plan9_386,
|
||||
* dockerbuild.Platform.Plan9_amd64,
|
||||
* dockerbuild.Platform.Plan9_386,
|
||||
* ],
|
||||
* });
|
||||
* ```
|
||||
@@ -305,9 +305,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* location: "app",
|
||||
* },
|
||||
@@ -325,9 +325,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: [{
|
||||
* local: {
|
||||
* src: "tmp/cache",
|
||||
@@ -336,7 +336,7 @@ import * as utilities from "./utilities";
|
||||
* cacheTo: [{
|
||||
* local: {
|
||||
* dest: "tmp/cache",
|
||||
* mode: docker.buildx.image.CacheMode.Max,
|
||||
* mode: dockerbuild.CacheMode.Max,
|
||||
* },
|
||||
* }],
|
||||
* context: {
|
||||
@@ -348,9 +348,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* name: "cloud-builder-name",
|
||||
* },
|
||||
@@ -364,9 +364,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* SET_ME_TO_TRUE: "true",
|
||||
* },
|
||||
@@ -379,9 +379,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* location: "app",
|
||||
* },
|
||||
@@ -392,9 +392,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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",
|
||||
* named: {
|
||||
* "golang:latest": {
|
||||
@@ -407,9 +407,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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",
|
||||
* }});
|
||||
* ```
|
||||
@@ -417,9 +417,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* location: "app",
|
||||
* },
|
||||
@@ -434,9 +434,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* location: "https://github.com/docker-library/hello-world.git",
|
||||
* },
|
||||
@@ -449,9 +449,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: {
|
||||
* location: "app",
|
||||
* },
|
||||
|
||||
16
sdk/nodejs/index_.ts
generated
16
sdk/nodejs/index_.ts
generated
@@ -21,9 +21,9 @@ import * as utilities from "./utilities";
|
||||
*
|
||||
* ```typescript
|
||||
* 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: [{
|
||||
* registry: {
|
||||
* ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||
@@ -31,17 +31,17 @@ import * as utilities from "./utilities";
|
||||
* }],
|
||||
* cacheTo: [{
|
||||
* registry: {
|
||||
* mode: docker.buildx.image.CacheMode.Max,
|
||||
* mode: dockerbuild.CacheMode.Max,
|
||||
* ref: "docker.io/pulumi/pulumi:cache-amd64",
|
||||
* },
|
||||
* }],
|
||||
* context: {
|
||||
* location: "app",
|
||||
* },
|
||||
* platforms: [docker.buildx.image.Platform.Linux_amd64],
|
||||
* platforms: [dockerbuild.Platform.Linux_amd64],
|
||||
* tags: ["docker.io/pulumi/pulumi:3.107.0-amd64"],
|
||||
* });
|
||||
* const arm64 = new docker.buildx.Image("arm64", {
|
||||
* const arm64 = new dockerbuild.Image("arm64", {
|
||||
* cacheFrom: [{
|
||||
* registry: {
|
||||
* ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||
@@ -49,17 +49,17 @@ import * as utilities from "./utilities";
|
||||
* }],
|
||||
* cacheTo: [{
|
||||
* registry: {
|
||||
* mode: docker.buildx.image.CacheMode.Max,
|
||||
* mode: dockerbuild.CacheMode.Max,
|
||||
* ref: "docker.io/pulumi/pulumi:cache-arm64",
|
||||
* },
|
||||
* }],
|
||||
* context: {
|
||||
* location: "app",
|
||||
* },
|
||||
* platforms: [docker.buildx.image.Platform.Linux_arm64],
|
||||
* platforms: [dockerbuild.Platform.Linux_arm64],
|
||||
* tags: ["docker.io/pulumi/pulumi:3.107.0-arm64"],
|
||||
* });
|
||||
* const index = new docker.buildx.Index("index", {
|
||||
* const index = new dockerbuild.Index("index", {
|
||||
* sources: [
|
||||
* amd64.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
|
||||
|
||||
The `buildx.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.
|
||||
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 `dockerbuild.Image` resources with minor modifications.
|
||||
|
||||
### 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
|
||||
|
||||
@@ -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.
|
||||
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.
|
||||
By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
Previews run in non-CI environments will not build images.
|
||||
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.
|
||||
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`).
|
||||
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.
|
||||
|
||||
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.
|
||||
(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.
|
||||
@@ -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.
|
||||
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.
|
||||
|
||||
#### 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.
|
||||
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.
|
||||
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.
|
||||
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).
|
||||
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
|
||||
|
||||
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`.
|
||||
After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
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 `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`.
|
||||
It it is shown with parameters similar to the `v3` example for completeness.
|
||||
@@ -726,28 +726,28 @@ class Image(pulumi.CustomResource):
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_aws as aws
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
ecr_repository = aws.ecr.Repository("ecr-repository")
|
||||
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
||||
my_image = docker.buildx.Image("my-image",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
my_image = dockerbuild.Image("my-image",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
image_manifest=True,
|
||||
oci_media_types=True,
|
||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="./app",
|
||||
),
|
||||
push=True,
|
||||
registries=[docker.buildx.RegistryAuthArgs(
|
||||
registries=[dockerbuild.RegistryArgs(
|
||||
address=ecr_repository.repository_url,
|
||||
password=auth_token.password,
|
||||
username=auth_token.user_name,
|
||||
@@ -758,28 +758,28 @@ class Image(pulumi.CustomResource):
|
||||
### Multi-platform image
|
||||
```python
|
||||
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",
|
||||
),
|
||||
platforms=[
|
||||
docker.buildx.image.Platform.PLAN9_AMD64,
|
||||
docker.buildx.image.Platform.PLAN9_386,
|
||||
dockerbuild.Platform.PLAN9_AMD64,
|
||||
dockerbuild.Platform.PLAN9_386,
|
||||
])
|
||||
```
|
||||
### Registry export
|
||||
```python
|
||||
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",
|
||||
),
|
||||
push=True,
|
||||
registries=[docker.buildx.RegistryAuthArgs(
|
||||
registries=[dockerbuild.RegistryArgs(
|
||||
address="docker.io",
|
||||
password=docker_hub_password,
|
||||
username="pulumibot",
|
||||
@@ -790,34 +790,34 @@ class Image(pulumi.CustomResource):
|
||||
### Caching
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
image = docker.buildx.Image("image",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
local=docker.buildx.CacheFromLocalArgs(
|
||||
image = dockerbuild.Image("image",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
local=dockerbuild.CacheFromLocalArgs(
|
||||
src="tmp/cache",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
local=docker.buildx.CacheToLocalArgs(
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
local=dockerbuild.CacheToLocalArgs(
|
||||
dest="tmp/cache",
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
))
|
||||
```
|
||||
### Docker Build Cloud
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
image = docker.buildx.Image("image",
|
||||
builder=docker.buildx.BuilderConfigArgs(
|
||||
image = dockerbuild.Image("image",
|
||||
builder=dockerbuild.BuilderConfigArgs(
|
||||
name="cloud-builder-name",
|
||||
),
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
exec_=True)
|
||||
@@ -825,23 +825,23 @@ class Image(pulumi.CustomResource):
|
||||
### Build arguments
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
image = docker.buildx.Image("image",
|
||||
image = dockerbuild.Image("image",
|
||||
build_args={
|
||||
"SET_ME_TO_TRUE": "true",
|
||||
},
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
))
|
||||
```
|
||||
### Build target
|
||||
```python
|
||||
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",
|
||||
),
|
||||
target="build-me")
|
||||
@@ -849,12 +849,12 @@ class Image(pulumi.CustomResource):
|
||||
### Named contexts
|
||||
```python
|
||||
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",
|
||||
named={
|
||||
"golang:latest": docker.buildx.ContextArgs(
|
||||
"golang:latest": dockerbuild.ContextArgs(
|
||||
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||
),
|
||||
},
|
||||
@@ -863,22 +863,22 @@ class Image(pulumi.CustomResource):
|
||||
### Remote context
|
||||
```python
|
||||
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",
|
||||
))
|
||||
```
|
||||
### Inline Dockerfile
|
||||
```python
|
||||
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",
|
||||
),
|
||||
dockerfile=docker.buildx.DockerfileArgs(
|
||||
dockerfile=dockerbuild.DockerfileArgs(
|
||||
inline=\"\"\"FROM busybox
|
||||
COPY hello.c ./
|
||||
\"\"\",
|
||||
@@ -887,27 +887,27 @@ class Image(pulumi.CustomResource):
|
||||
### Remote context
|
||||
```python
|
||||
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://github.com/docker-library/hello-world.git",
|
||||
),
|
||||
dockerfile=docker.buildx.DockerfileArgs(
|
||||
dockerfile=dockerbuild.DockerfileArgs(
|
||||
location="app/Dockerfile",
|
||||
))
|
||||
```
|
||||
### Local export
|
||||
```python
|
||||
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",
|
||||
),
|
||||
exports=[docker.buildx.ExportArgs(
|
||||
docker=docker.buildx.ExportDockerArgs(
|
||||
exports=[dockerbuild.ExportArgs(
|
||||
docker=dockerbuild.ExportDockerArgs(
|
||||
tar=True,
|
||||
),
|
||||
)])
|
||||
@@ -1066,12 +1066,12 @@ class Image(pulumi.CustomResource):
|
||||
|
||||
## 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.
|
||||
Existing `Image` resources can be converted to `build.Image` resources with minor modifications.
|
||||
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 `dockerbuild.Image` resources with minor modifications.
|
||||
|
||||
### 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
|
||||
|
||||
@@ -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.
|
||||
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.
|
||||
By default, Pulumi will now only build `buildx.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
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 `dockerbuild.Image` resources during previews when it detects a CI environment like GitHub Actions.
|
||||
Previews run in non-CI environments will not build images.
|
||||
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.
|
||||
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`).
|
||||
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.
|
||||
|
||||
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.
|
||||
(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.
|
||||
@@ -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.
|
||||
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.
|
||||
|
||||
#### 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.
|
||||
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.
|
||||
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.
|
||||
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).
|
||||
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
|
||||
|
||||
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`.
|
||||
After migration, the environment variable is no longer needed and CLI flags are now properties on the `buildx.Image`.
|
||||
In almost all cases, properties of `buildx.Image` are named after the Docker CLI flag they correspond to.
|
||||
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 `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`.
|
||||
It it is shown with parameters similar to the `v3` example for completeness.
|
||||
@@ -1163,28 +1163,28 @@ class Image(pulumi.CustomResource):
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_aws as aws
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
ecr_repository = aws.ecr.Repository("ecr-repository")
|
||||
auth_token = aws.ecr.get_authorization_token_output(registry_id=ecr_repository.registry_id)
|
||||
my_image = docker.buildx.Image("my-image",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
my_image = dockerbuild.Image("my-image",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
image_manifest=True,
|
||||
oci_media_types=True,
|
||||
ref=ecr_repository.repository_url.apply(lambda repository_url: f"{repository_url}:cache"),
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="./app",
|
||||
),
|
||||
push=True,
|
||||
registries=[docker.buildx.RegistryAuthArgs(
|
||||
registries=[dockerbuild.RegistryArgs(
|
||||
address=ecr_repository.repository_url,
|
||||
password=auth_token.password,
|
||||
username=auth_token.user_name,
|
||||
@@ -1195,28 +1195,28 @@ class Image(pulumi.CustomResource):
|
||||
### Multi-platform image
|
||||
```python
|
||||
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",
|
||||
),
|
||||
platforms=[
|
||||
docker.buildx.image.Platform.PLAN9_AMD64,
|
||||
docker.buildx.image.Platform.PLAN9_386,
|
||||
dockerbuild.Platform.PLAN9_AMD64,
|
||||
dockerbuild.Platform.PLAN9_386,
|
||||
])
|
||||
```
|
||||
### Registry export
|
||||
```python
|
||||
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",
|
||||
),
|
||||
push=True,
|
||||
registries=[docker.buildx.RegistryAuthArgs(
|
||||
registries=[dockerbuild.RegistryArgs(
|
||||
address="docker.io",
|
||||
password=docker_hub_password,
|
||||
username="pulumibot",
|
||||
@@ -1227,34 +1227,34 @@ class Image(pulumi.CustomResource):
|
||||
### Caching
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
image = docker.buildx.Image("image",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
local=docker.buildx.CacheFromLocalArgs(
|
||||
image = dockerbuild.Image("image",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
local=dockerbuild.CacheFromLocalArgs(
|
||||
src="tmp/cache",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
local=docker.buildx.CacheToLocalArgs(
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
local=dockerbuild.CacheToLocalArgs(
|
||||
dest="tmp/cache",
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
))
|
||||
```
|
||||
### Docker Build Cloud
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
image = docker.buildx.Image("image",
|
||||
builder=docker.buildx.BuilderConfigArgs(
|
||||
image = dockerbuild.Image("image",
|
||||
builder=dockerbuild.BuilderConfigArgs(
|
||||
name="cloud-builder-name",
|
||||
),
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
exec_=True)
|
||||
@@ -1262,23 +1262,23 @@ class Image(pulumi.CustomResource):
|
||||
### Build arguments
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
image = docker.buildx.Image("image",
|
||||
image = dockerbuild.Image("image",
|
||||
build_args={
|
||||
"SET_ME_TO_TRUE": "true",
|
||||
},
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
))
|
||||
```
|
||||
### Build target
|
||||
```python
|
||||
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",
|
||||
),
|
||||
target="build-me")
|
||||
@@ -1286,12 +1286,12 @@ class Image(pulumi.CustomResource):
|
||||
### Named contexts
|
||||
```python
|
||||
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",
|
||||
named={
|
||||
"golang:latest": docker.buildx.ContextArgs(
|
||||
"golang:latest": dockerbuild.ContextArgs(
|
||||
location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984",
|
||||
),
|
||||
},
|
||||
@@ -1300,22 +1300,22 @@ class Image(pulumi.CustomResource):
|
||||
### Remote context
|
||||
```python
|
||||
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",
|
||||
))
|
||||
```
|
||||
### Inline Dockerfile
|
||||
```python
|
||||
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",
|
||||
),
|
||||
dockerfile=docker.buildx.DockerfileArgs(
|
||||
dockerfile=dockerbuild.DockerfileArgs(
|
||||
inline=\"\"\"FROM busybox
|
||||
COPY hello.c ./
|
||||
\"\"\",
|
||||
@@ -1324,27 +1324,27 @@ class Image(pulumi.CustomResource):
|
||||
### Remote context
|
||||
```python
|
||||
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://github.com/docker-library/hello-world.git",
|
||||
),
|
||||
dockerfile=docker.buildx.DockerfileArgs(
|
||||
dockerfile=dockerbuild.DockerfileArgs(
|
||||
location="app/Dockerfile",
|
||||
))
|
||||
```
|
||||
### Local export
|
||||
```python
|
||||
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",
|
||||
),
|
||||
exports=[docker.buildx.ExportArgs(
|
||||
docker=docker.buildx.ExportDockerArgs(
|
||||
exports=[dockerbuild.ExportArgs(
|
||||
docker=dockerbuild.ExportDockerArgs(
|
||||
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
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
amd64 = docker.buildx.Image("amd64",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
amd64 = dockerbuild.Image("amd64",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
platforms=[docker.buildx.image.Platform.LINUX_AMD64],
|
||||
platforms=[dockerbuild.Platform.LINUX_AMD64],
|
||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||
arm64 = docker.buildx.Image("arm64",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
arm64 = dockerbuild.Image("arm64",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
platforms=[docker.buildx.image.Platform.LINUX_ARM64],
|
||||
platforms=[dockerbuild.Platform.LINUX_ARM64],
|
||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||
index = docker.buildx.Index("index",
|
||||
index = dockerbuild.Index("index",
|
||||
sources=[
|
||||
amd64.ref,
|
||||
arm64.ref,
|
||||
@@ -191,43 +191,43 @@ class Index(pulumi.CustomResource):
|
||||
### Multi-platform registry caching
|
||||
```python
|
||||
import pulumi
|
||||
import pulumi_docker as docker
|
||||
import pulumi_dockerbuild as dockerbuild
|
||||
|
||||
amd64 = docker.buildx.Image("amd64",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
amd64 = dockerbuild.Image("amd64",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
ref="docker.io/pulumi/pulumi:cache-amd64",
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
platforms=[docker.buildx.image.Platform.LINUX_AMD64],
|
||||
platforms=[dockerbuild.Platform.LINUX_AMD64],
|
||||
tags=["docker.io/pulumi/pulumi:3.107.0-amd64"])
|
||||
arm64 = docker.buildx.Image("arm64",
|
||||
cache_from=[docker.buildx.CacheFromArgs(
|
||||
registry=docker.buildx.CacheFromRegistryArgs(
|
||||
arm64 = dockerbuild.Image("arm64",
|
||||
cache_from=[dockerbuild.CacheFromArgs(
|
||||
registry=dockerbuild.CacheFromRegistryArgs(
|
||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||
),
|
||||
)],
|
||||
cache_to=[docker.buildx.CacheToArgs(
|
||||
registry=docker.buildx.CacheToRegistryArgs(
|
||||
mode=docker.buildx.image.CacheMode.MAX,
|
||||
cache_to=[dockerbuild.CacheToArgs(
|
||||
registry=dockerbuild.CacheToRegistryArgs(
|
||||
mode=dockerbuild.CacheMode.MAX,
|
||||
ref="docker.io/pulumi/pulumi:cache-arm64",
|
||||
),
|
||||
)],
|
||||
context=docker.buildx.BuildContextArgs(
|
||||
context=dockerbuild.BuildContextArgs(
|
||||
location="app",
|
||||
),
|
||||
platforms=[docker.buildx.image.Platform.LINUX_ARM64],
|
||||
platforms=[dockerbuild.Platform.LINUX_ARM64],
|
||||
tags=["docker.io/pulumi/pulumi:3.107.0-arm64"])
|
||||
index = docker.buildx.Index("index",
|
||||
index = dockerbuild.Index("index",
|
||||
sources=[
|
||||
amd64.ref,
|
||||
arm64.ref,
|
||||
|
||||
Reference in New Issue
Block a user