From 13fb5b6158fe16e9ee0060c7f2d387cbb14e2af9 Mon Sep 17 00:00:00 2001 From: Bryce Lampe Date: Thu, 25 Apr 2024 09:51:24 -0700 Subject: [PATCH] Update examples and docs for required push --- docs/yaml/image-examples.yaml | 10 ++ examples/dotnet/Program.cs | 14 ++ examples/go/main.go | 14 ++ .../src/main/java/generated_program/App.java | 14 ++ examples/nodejs/index.ts | 22 +++- examples/python/__main__.py | 21 ++- examples/yaml/Pulumi.yaml | 14 ++ provider/internal/embed/image-examples.md | 120 ++++++++++++++---- 8 files changed, 196 insertions(+), 33 deletions(-) diff --git a/docs/yaml/image-examples.yaml b/docs/yaml/image-examples.yaml index 0958c3d..bed715e 100644 --- a/docs/yaml/image-examples.yaml +++ b/docs/yaml/image-examples.yaml @@ -43,6 +43,7 @@ resources: platforms: - plan9/amd64 - plan9/386 + push: false --- name: registry runtime: yaml @@ -79,6 +80,7 @@ resources: cacheFrom: - local: src: tmp/cache + push: false --- name: dbc runtime: yaml @@ -92,6 +94,7 @@ resources: exec: true builder: name: cloud-builder-name + push: false --- name: build-args runtime: yaml @@ -104,6 +107,7 @@ resources: location: "app" buildArgs: SET_ME_TO_TRUE: "true" + push: false --- name: build-target runtime: yaml @@ -115,6 +119,7 @@ resources: context: location: "app" target: "build-me" + push: false --- name: named-contexts runtime: yaml @@ -128,6 +133,7 @@ resources: named: "golang:latest": location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984" + push: false --- name: remote-context runtime: yaml @@ -138,6 +144,7 @@ resources: properties: context: location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile" + push: false --- name: inline @@ -153,6 +160,7 @@ resources: COPY hello.c ./ context: location: "app" + push: false --- name: remote-context runtime: yaml @@ -165,6 +173,7 @@ resources: location: app/Dockerfile context: location: "https://github.com/docker-library/hello-world.git" + push: false --- name: docker-load runtime: yaml @@ -178,3 +187,4 @@ resources: exports: - docker: tar: true + push: false diff --git a/examples/dotnet/Program.cs b/examples/dotnet/Program.cs index a8efada..6b5489b 100644 --- a/examples/dotnet/Program.cs +++ b/examples/dotnet/Program.cs @@ -9,6 +9,7 @@ return await Deployment.RunAsync(() => var dockerHubPassword = config.Require("dockerHubPassword"); var multiPlatform = new DockerBuild.Image("multiPlatform", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Location = "./app/Dockerfile.multiPlatform", @@ -26,6 +27,7 @@ return await Deployment.RunAsync(() => var registryPush = new DockerBuild.Image("registryPush", new() { + Push = false, Context = new DockerBuild.Inputs.BuildContextArgs { Location = "./app", @@ -58,6 +60,7 @@ return await Deployment.RunAsync(() => var cached = new DockerBuild.Image("cached", new() { + Push = false, Context = new DockerBuild.Inputs.BuildContextArgs { Location = "./app", @@ -87,6 +90,7 @@ return await Deployment.RunAsync(() => var buildArgs = new DockerBuild.Image("buildArgs", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Location = "./app/Dockerfile.buildArgs", @@ -103,6 +107,7 @@ return await Deployment.RunAsync(() => var extraHosts = new DockerBuild.Image("extraHosts", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Location = "./app/Dockerfile.extraHosts", @@ -119,6 +124,7 @@ return await Deployment.RunAsync(() => var sshMount = new DockerBuild.Image("sshMount", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Location = "./app/Dockerfile.sshMount", @@ -138,6 +144,7 @@ return await Deployment.RunAsync(() => var secrets = new DockerBuild.Image("secrets", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Location = "./app/Dockerfile.secrets", @@ -154,6 +161,7 @@ return await Deployment.RunAsync(() => var labels = new DockerBuild.Image("labels", new() { + Push = false, Context = new DockerBuild.Inputs.BuildContextArgs { Location = "./app", @@ -166,6 +174,7 @@ return await Deployment.RunAsync(() => var target = new DockerBuild.Image("target", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Location = "./app/Dockerfile.target", @@ -179,6 +188,7 @@ return await Deployment.RunAsync(() => var namedContexts = new DockerBuild.Image("namedContexts", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Location = "./app/Dockerfile.namedContexts", @@ -198,6 +208,7 @@ return await Deployment.RunAsync(() => var remoteContext = new DockerBuild.Image("remoteContext", new() { + Push = false, Context = new DockerBuild.Inputs.BuildContextArgs { Location = "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", @@ -206,6 +217,7 @@ return await Deployment.RunAsync(() => var remoteContextWithInline = new DockerBuild.Image("remoteContextWithInline", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Inline = @"FROM busybox @@ -220,6 +232,7 @@ COPY hello.c ./ var inline = new DockerBuild.Image("inline", new() { + Push = false, Dockerfile = new DockerBuild.Inputs.DockerfileArgs { Inline = @"FROM alpine @@ -234,6 +247,7 @@ RUN echo ""This uses an inline Dockerfile! 👍"" var dockerLoad = new DockerBuild.Image("dockerLoad", new() { + Push = false, Context = new DockerBuild.Inputs.BuildContextArgs { Location = "./app", diff --git a/examples/go/main.go b/examples/go/main.go index 6d918bd..ede0af9 100644 --- a/examples/go/main.go +++ b/examples/go/main.go @@ -11,6 +11,7 @@ func main() { cfg := config.New(ctx, "") dockerHubPassword := cfg.Require("dockerHubPassword") multiPlatform, err := dockerbuild.NewImage(ctx, "multiPlatform", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("./app/Dockerfile.multiPlatform"), }, @@ -26,6 +27,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "registryPush", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("./app"), }, @@ -52,6 +54,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "cached", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("./app"), }, @@ -75,6 +78,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "buildArgs", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("./app/Dockerfile.buildArgs"), }, @@ -89,6 +93,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "extraHosts", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("./app/Dockerfile.extraHosts"), }, @@ -103,6 +108,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "sshMount", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("./app/Dockerfile.sshMount"), }, @@ -119,6 +125,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "secrets", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("./app/Dockerfile.secrets"), }, @@ -133,6 +140,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "labels", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("./app"), }, @@ -144,6 +152,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "target", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("./app/Dockerfile.target"), }, @@ -156,6 +165,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "namedContexts", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("./app/Dockerfile.namedContexts"), }, @@ -172,6 +182,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "remoteContext", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"), }, @@ -180,6 +191,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "remoteContextWithInline", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"), }, @@ -191,6 +203,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "inline", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Dockerfile: &dockerbuild.DockerfileArgs{ Inline: pulumi.String("FROM alpine\nRUN echo \"This uses an inline Dockerfile! 👍\"\n"), }, @@ -202,6 +215,7 @@ func main() { return err } _, err = dockerbuild.NewImage(ctx, "dockerLoad", &dockerbuild.ImageArgs{ + Push: pulumi.Bool(false), Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("./app"), }, diff --git a/examples/java/src/main/java/generated_program/App.java b/examples/java/src/main/java/generated_program/App.java index 49aa2f2..e7e21ab 100644 --- a/examples/java/src/main/java/generated_program/App.java +++ b/examples/java/src/main/java/generated_program/App.java @@ -32,6 +32,7 @@ public class App { final var config = ctx.config(); final var dockerHubPassword = config.get("dockerHubPassword"); var multiPlatform = new Image("multiPlatform", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .location("./app/Dockerfile.multiPlatform") .build()) @@ -44,6 +45,7 @@ public class App { .build()); var registryPush = new Image("registryPush", ImageArgs.builder() + .push(false) .context(BuildContextArgs.builder() .location("./app") .build()) @@ -62,6 +64,7 @@ public class App { .build()); var cached = new Image("cached", ImageArgs.builder() + .push(false) .context(BuildContextArgs.builder() .location("./app") .build()) @@ -79,6 +82,7 @@ public class App { .build()); var buildArgs = new Image("buildArgs", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .location("./app/Dockerfile.buildArgs") .build()) @@ -89,6 +93,7 @@ public class App { .build()); var extraHosts = new Image("extraHosts", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .location("./app/Dockerfile.extraHosts") .build()) @@ -99,6 +104,7 @@ public class App { .build()); var sshMount = new Image("sshMount", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .location("./app/Dockerfile.sshMount") .build()) @@ -111,6 +117,7 @@ public class App { .build()); var secrets = new Image("secrets", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .location("./app/Dockerfile.secrets") .build()) @@ -121,6 +128,7 @@ public class App { .build()); var labels = new Image("labels", ImageArgs.builder() + .push(false) .context(BuildContextArgs.builder() .location("./app") .build()) @@ -128,6 +136,7 @@ public class App { .build()); var target = new Image("target", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .location("./app/Dockerfile.target") .build()) @@ -138,6 +147,7 @@ public class App { .build()); var namedContexts = new Image("namedContexts", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .location("./app/Dockerfile.namedContexts") .build()) @@ -148,12 +158,14 @@ public class App { .build()); var remoteContext = new Image("remoteContext", ImageArgs.builder() + .push(false) .context(BuildContextArgs.builder() .location("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile") .build()) .build()); var remoteContextWithInline = new Image("remoteContextWithInline", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .inline(""" FROM busybox @@ -166,6 +178,7 @@ COPY hello.c ./ .build()); var inline = new Image("inline", ImageArgs.builder() + .push(false) .dockerfile(DockerfileArgs.builder() .inline(""" FROM alpine @@ -178,6 +191,7 @@ RUN echo "This uses an inline Dockerfile! 👍" .build()); var dockerLoad = new Image("dockerLoad", ImageArgs.builder() + .push(false) .context(BuildContextArgs.builder() .location("./app") .build()) diff --git a/examples/nodejs/index.ts b/examples/nodejs/index.ts index 677d800..4a87b30 100644 --- a/examples/nodejs/index.ts +++ b/examples/nodejs/index.ts @@ -4,6 +4,7 @@ import * as docker_build from "@pulumi/docker-build"; const config = new pulumi.Config(); const dockerHubPassword = config.require("dockerHubPassword"); const multiPlatform = new docker_build.Image("multiPlatform", { + push: false, dockerfile: { location: "./app/Dockerfile.multiPlatform", }, @@ -16,6 +17,7 @@ const multiPlatform = new docker_build.Image("multiPlatform", { ], }); const registryPush = new docker_build.Image("registryPush", { + push: false, context: { location: "./app", }, @@ -33,6 +35,7 @@ const registryPush = new docker_build.Image("registryPush", { }], }); const cached = new docker_build.Image("cached", { + push: false, context: { location: "./app", }, @@ -49,6 +52,7 @@ const cached = new docker_build.Image("cached", { }], }); const buildArgs = new docker_build.Image("buildArgs", { + push: false, dockerfile: { location: "./app/Dockerfile.buildArgs", }, @@ -60,6 +64,7 @@ const buildArgs = new docker_build.Image("buildArgs", { }, }); const extraHosts = new docker_build.Image("extraHosts", { + push: false, dockerfile: { location: "./app/Dockerfile.extraHosts", }, @@ -69,6 +74,7 @@ const extraHosts = new docker_build.Image("extraHosts", { addHosts: ["metadata.google.internal:169.254.169.254"], }); const sshMount = new docker_build.Image("sshMount", { + push: false, dockerfile: { location: "./app/Dockerfile.sshMount", }, @@ -80,6 +86,7 @@ const sshMount = new docker_build.Image("sshMount", { }], }); const secrets = new docker_build.Image("secrets", { + push: false, dockerfile: { location: "./app/Dockerfile.secrets", }, @@ -91,6 +98,7 @@ const secrets = new docker_build.Image("secrets", { }, }); const labels = new docker_build.Image("labels", { + push: false, context: { location: "./app", }, @@ -99,6 +107,7 @@ const labels = new docker_build.Image("labels", { }, }); const target = new docker_build.Image("target", { + push: false, dockerfile: { location: "./app/Dockerfile.target", }, @@ -108,6 +117,7 @@ const target = new docker_build.Image("target", { target: "build-me", }); const namedContexts = new docker_build.Image("namedContexts", { + push: false, dockerfile: { location: "./app/Dockerfile.namedContexts", }, @@ -120,10 +130,14 @@ const namedContexts = new docker_build.Image("namedContexts", { }, }, }); -const remoteContext = new docker_build.Image("remoteContext", {context: { - location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", -}}); +const remoteContext = new docker_build.Image("remoteContext", { + push: false, + context: { + location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", + }, +}); const remoteContextWithInline = new docker_build.Image("remoteContextWithInline", { + push: false, dockerfile: { inline: `FROM busybox COPY hello.c ./ @@ -134,6 +148,7 @@ COPY hello.c ./ }, }); const inline = new docker_build.Image("inline", { + push: false, dockerfile: { inline: `FROM alpine RUN echo "This uses an inline Dockerfile! 👍" @@ -144,6 +159,7 @@ RUN echo "This uses an inline Dockerfile! 👍" }, }); const dockerLoad = new docker_build.Image("dockerLoad", { + push: false, context: { location: "./app", }, diff --git a/examples/python/__main__.py b/examples/python/__main__.py index 51f1f6d..8f1d0ae 100644 --- a/examples/python/__main__.py +++ b/examples/python/__main__.py @@ -4,6 +4,7 @@ import pulumi_docker_build as docker_build config = pulumi.Config() docker_hub_password = config.require("dockerHubPassword") multi_platform = docker_build.Image("multiPlatform", + push=False, dockerfile=docker_build.DockerfileArgs( location="./app/Dockerfile.multiPlatform", ), @@ -15,6 +16,7 @@ multi_platform = docker_build.Image("multiPlatform", docker_build.Platform.PLAN9_386, ]) registry_push = docker_build.Image("registryPush", + push=False, context=docker_build.BuildContextArgs( location="./app", ), @@ -31,6 +33,7 @@ registry_push = docker_build.Image("registryPush", password=docker_hub_password, )]) cached = docker_build.Image("cached", + push=False, context=docker_build.BuildContextArgs( location="./app", ), @@ -46,6 +49,7 @@ cached = docker_build.Image("cached", ), )]) build_args = docker_build.Image("buildArgs", + push=False, dockerfile=docker_build.DockerfileArgs( location="./app/Dockerfile.buildArgs", ), @@ -56,6 +60,7 @@ build_args = docker_build.Image("buildArgs", "SET_ME_TO_TRUE": "true", }) extra_hosts = docker_build.Image("extraHosts", + push=False, dockerfile=docker_build.DockerfileArgs( location="./app/Dockerfile.extraHosts", ), @@ -64,6 +69,7 @@ extra_hosts = docker_build.Image("extraHosts", ), add_hosts=["metadata.google.internal:169.254.169.254"]) ssh_mount = docker_build.Image("sshMount", + push=False, dockerfile=docker_build.DockerfileArgs( location="./app/Dockerfile.sshMount", ), @@ -74,6 +80,7 @@ ssh_mount = docker_build.Image("sshMount", id="default", )]) secrets = docker_build.Image("secrets", + push=False, dockerfile=docker_build.DockerfileArgs( location="./app/Dockerfile.secrets", ), @@ -84,6 +91,7 @@ secrets = docker_build.Image("secrets", "password": "hunter2", }) labels = docker_build.Image("labels", + push=False, context=docker_build.BuildContextArgs( location="./app", ), @@ -91,6 +99,7 @@ labels = docker_build.Image("labels", "description": "This image will get a descriptive label 👍", }) target = docker_build.Image("target", + push=False, dockerfile=docker_build.DockerfileArgs( location="./app/Dockerfile.target", ), @@ -99,6 +108,7 @@ target = docker_build.Image("target", ), target="build-me") named_contexts = docker_build.Image("namedContexts", + push=False, dockerfile=docker_build.DockerfileArgs( location="./app/Dockerfile.namedContexts", ), @@ -110,10 +120,13 @@ named_contexts = docker_build.Image("namedContexts", ), }, )) -remote_context = docker_build.Image("remoteContext", context=docker_build.BuildContextArgs( - location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", -)) +remote_context = docker_build.Image("remoteContext", + push=False, + context=docker_build.BuildContextArgs( + location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", + )) remote_context_with_inline = docker_build.Image("remoteContextWithInline", + push=False, dockerfile=docker_build.DockerfileArgs( inline="""FROM busybox COPY hello.c ./ @@ -123,6 +136,7 @@ COPY hello.c ./ location="https://github.com/docker-library/hello-world.git", )) inline = docker_build.Image("inline", + push=False, dockerfile=docker_build.DockerfileArgs( inline="""FROM alpine RUN echo "This uses an inline Dockerfile! 👍" @@ -132,6 +146,7 @@ RUN echo "This uses an inline Dockerfile! 👍" location="./app", )) docker_load = docker_build.Image("dockerLoad", + push=False, context=docker_build.BuildContextArgs( location="./app", ), diff --git a/examples/yaml/Pulumi.yaml b/examples/yaml/Pulumi.yaml index fdeee2c..5a0f0f2 100644 --- a/examples/yaml/Pulumi.yaml +++ b/examples/yaml/Pulumi.yaml @@ -10,6 +10,7 @@ resources: multiPlatform: type: docker-build:Image properties: + push: false dockerfile: location: "./app/Dockerfile.multiPlatform" context: @@ -22,6 +23,7 @@ resources: registryPush: type: docker-build:Image properties: + push: false context: location: "./app" tags: ["docker.io/pulumibot/buildkit-e2e:example"] @@ -38,6 +40,7 @@ resources: cached: type: docker-build:Image properties: + push: false context: location: "./app" cacheTo: @@ -52,6 +55,7 @@ resources: buildArgs: type: docker-build:Image properties: + push: false dockerfile: location: "./app/Dockerfile.buildArgs" context: @@ -63,6 +67,7 @@ resources: extraHosts: type: docker-build:Image properties: + push: false dockerfile: location: "./app/Dockerfile.extraHosts" context: @@ -74,6 +79,7 @@ resources: sshMount: type: docker-build:Image properties: + push: false dockerfile: location: "./app/Dockerfile.sshMount" context: @@ -85,6 +91,7 @@ resources: secrets: type: docker-build:Image properties: + push: false dockerfile: location: "./app/Dockerfile.secrets" context: @@ -96,6 +103,7 @@ resources: labels: type: docker-build:Image properties: + push: false context: location: "./app" labels: @@ -105,6 +113,7 @@ resources: target: type: docker-build:Image properties: + push: false dockerfile: location: "./app/Dockerfile.target" context: @@ -116,6 +125,7 @@ resources: namedContexts: type: docker-build:Image properties: + push: false dockerfile: location: "./app/Dockerfile.namedContexts" context: @@ -128,6 +138,7 @@ resources: remoteContext: type: docker-build:Image properties: + push: false context: location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile" @@ -138,6 +149,7 @@ resources: remoteContextWithInline: type: docker-build:Image properties: + push: false dockerfile: inline: | FROM busybox @@ -149,6 +161,7 @@ resources: inline: type: docker-build:Image properties: + push: false dockerfile: inline: | FROM alpine @@ -160,6 +173,7 @@ resources: dockerLoad: type: docker-build:Image properties: + push: false context: location: "./app" exports: diff --git a/provider/internal/embed/image-examples.md b/provider/internal/embed/image-examples.md index 99a44f5..c8723ea 100644 --- a/provider/internal/embed/image-examples.md +++ b/provider/internal/embed/image-examples.md @@ -322,6 +322,7 @@ const image = new docker_build.Image("image", { docker_build.Platform.Plan9_amd64, docker_build.Platform.Plan9_386, ], + push: false, }); ``` ```python @@ -335,7 +336,8 @@ image = docker_build.Image("image", platforms=[ docker_build.Platform.PLAN9_AMD64, docker_build.Platform.PLAN9_386, - ]) + ], + push=False) ``` ```csharp using System.Collections.Generic; @@ -356,6 +358,7 @@ return await Deployment.RunAsync(() => DockerBuild.Platform.Plan9_amd64, DockerBuild.Platform.Plan9_386, }, + Push = false, }); }); @@ -379,6 +382,7 @@ func main() { dockerbuild.Platform_Plan9_amd64, dockerbuild.Platform_Plan9_386, }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -398,6 +402,7 @@ resources: platforms: - plan9/amd64 - plan9/386 + push: false type: docker-build:Image runtime: yaml ``` @@ -430,6 +435,7 @@ public class App { .platforms( "plan9/amd64", "plan9/386") + .push(false) .build()); } @@ -628,6 +634,7 @@ const image = new docker_build.Image("image", { context: { location: "app", }, + push: false, }); ``` ```python @@ -648,7 +655,8 @@ image = docker_build.Image("image", )], context=docker_build.BuildContextArgs( location="app", - )) + ), + push=False) ``` ```csharp using System.Collections.Generic; @@ -685,6 +693,7 @@ return await Deployment.RunAsync(() => { Location = "app", }, + Push = false, }); }); @@ -719,6 +728,7 @@ func main() { Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("app"), }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -742,6 +752,7 @@ resources: mode: max context: location: app + push: false type: docker-build:Image runtime: yaml ``` @@ -786,6 +797,7 @@ public class App { .context(BuildContextArgs.builder() .location("app") .build()) + .push(false) .build()); } @@ -807,6 +819,7 @@ const image = new docker_build.Image("image", { location: "app", }, exec: true, + push: false, }); ``` ```python @@ -820,7 +833,8 @@ image = docker_build.Image("image", context=docker_build.BuildContextArgs( location="app", ), - exec_=True) + exec_=True, + push=False) ``` ```csharp using System.Collections.Generic; @@ -841,6 +855,7 @@ return await Deployment.RunAsync(() => Location = "app", }, Exec = true, + Push = false, }); }); @@ -864,6 +879,7 @@ func main() { Location: pulumi.String("app"), }, Exec: pulumi.Bool(true), + Push: pulumi.Bool(false), }) if err != nil { return err @@ -883,6 +899,7 @@ resources: context: location: app exec: true + push: false type: docker-build:Image runtime: yaml ``` @@ -917,6 +934,7 @@ public class App { .location("app") .build()) .exec(true) + .push(false) .build()); } @@ -937,6 +955,7 @@ const image = new docker_build.Image("image", { context: { location: "app", }, + push: false, }); ``` ```python @@ -949,7 +968,8 @@ image = docker_build.Image("image", }, context=docker_build.BuildContextArgs( location="app", - )) + ), + push=False) ``` ```csharp using System.Collections.Generic; @@ -969,6 +989,7 @@ return await Deployment.RunAsync(() => { Location = "app", }, + Push = false, }); }); @@ -991,6 +1012,7 @@ func main() { Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("app"), }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -1009,6 +1031,7 @@ resources: SET_ME_TO_TRUE: "true" context: location: app + push: false type: docker-build:Image runtime: yaml ``` @@ -1039,6 +1062,7 @@ public class App { .context(BuildContextArgs.builder() .location("app") .build()) + .push(false) .build()); } @@ -1056,6 +1080,7 @@ const image = new docker_build.Image("image", { context: { location: "app", }, + push: false, target: "build-me", }); ``` @@ -1067,6 +1092,7 @@ image = docker_build.Image("image", context=docker_build.BuildContextArgs( location="app", ), + push=False, target="build-me") ``` ```csharp @@ -1083,6 +1109,7 @@ return await Deployment.RunAsync(() => { Location = "app", }, + Push = false, Target = "build-me", }); @@ -1103,6 +1130,7 @@ func main() { Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("app"), }, + Push: pulumi.Bool(false), Target: pulumi.String("build-me"), }) if err != nil { @@ -1120,6 +1148,7 @@ resources: properties: context: location: app + push: false target: build-me type: docker-build:Image runtime: yaml @@ -1150,6 +1179,7 @@ public class App { .context(BuildContextArgs.builder() .location("app") .build()) + .push(false) .target("build-me") .build()); @@ -1164,27 +1194,32 @@ public class App { import * as pulumi from "@pulumi/pulumi"; import * as docker_build from "@pulumi/docker-build"; -const image = new docker_build.Image("image", {context: { - location: "app", - named: { - "golang:latest": { - location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984", +const image = new docker_build.Image("image", { + context: { + location: "app", + named: { + "golang:latest": { + location: "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984", + }, }, }, -}}); + push: false, +}); ``` ```python import pulumi import pulumi_docker_build as docker_build -image = docker_build.Image("image", context=docker_build.BuildContextArgs( - location="app", - named={ - "golang:latest": docker_build.ContextArgs( - location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984", - ), - }, -)) +image = docker_build.Image("image", + context=docker_build.BuildContextArgs( + location="app", + named={ + "golang:latest": docker_build.ContextArgs( + location="docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984", + ), + }, + ), + push=False) ``` ```csharp using System.Collections.Generic; @@ -1207,6 +1242,7 @@ return await Deployment.RunAsync(() => } }, }, }, + Push = false, }); }); @@ -1231,6 +1267,7 @@ func main() { }, }, }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -1250,6 +1287,7 @@ resources: named: golang:latest: location: docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984 + push: false type: docker-build:Image runtime: yaml ``` @@ -1280,6 +1318,7 @@ public class App { .location("app") .named(Map.of("golang:latest", Map.of("location", "docker-image://golang@sha256:b8e62cf593cdaff36efd90aa3a37de268e6781a2e68c6610940c48f7cdf36984"))) .build()) + .push(false) .build()); } @@ -1293,17 +1332,22 @@ public class App { import * as pulumi from "@pulumi/pulumi"; import * as docker_build from "@pulumi/docker-build"; -const image = new docker_build.Image("image", {context: { - location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", -}}); +const image = new docker_build.Image("image", { + context: { + location: "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", + }, + push: false, +}); ``` ```python import pulumi import pulumi_docker_build as docker_build -image = docker_build.Image("image", context=docker_build.BuildContextArgs( - location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", -)) +image = docker_build.Image("image", + context=docker_build.BuildContextArgs( + location="https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", + ), + push=False) ``` ```csharp using System.Collections.Generic; @@ -1319,6 +1363,7 @@ return await Deployment.RunAsync(() => { Location = "https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile", }, + Push = false, }); }); @@ -1338,6 +1383,7 @@ func main() { Context: &dockerbuild.BuildContextArgs{ Location: pulumi.String("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile"), }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -1354,6 +1400,7 @@ resources: properties: context: location: https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile + push: false type: docker-build:Image runtime: yaml ``` @@ -1383,6 +1430,7 @@ public class App { .context(BuildContextArgs.builder() .location("https://raw.githubusercontent.com/pulumi/pulumi-docker/api-types/provider/testdata/Dockerfile") .build()) + .push(false) .build()); } @@ -1405,6 +1453,7 @@ const image = new docker_build.Image("image", { COPY hello.c ./ `, }, + push: false, }); ``` ```python @@ -1419,7 +1468,8 @@ image = docker_build.Image("image", inline="""FROM busybox COPY hello.c ./ """, - )) + ), + push=False) ``` ```csharp using System.Collections.Generic; @@ -1441,6 +1491,7 @@ return await Deployment.RunAsync(() => COPY hello.c ./ ", }, + Push = false, }); }); @@ -1463,6 +1514,7 @@ func main() { Dockerfile: &dockerbuild.DockerfileArgs{ Inline: pulumi.String("FROM busybox\nCOPY hello.c ./\n"), }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -1483,6 +1535,7 @@ resources: inline: | FROM busybox COPY hello.c ./ + push: false type: docker-build:Image runtime: yaml ``` @@ -1519,6 +1572,7 @@ FROM busybox COPY hello.c ./ """) .build()) + .push(false) .build()); } @@ -1539,6 +1593,7 @@ const image = new docker_build.Image("image", { dockerfile: { location: "app/Dockerfile", }, + push: false, }); ``` ```python @@ -1551,7 +1606,8 @@ image = docker_build.Image("image", ), dockerfile=docker_build.DockerfileArgs( location="app/Dockerfile", - )) + ), + push=False) ``` ```csharp using System.Collections.Generic; @@ -1571,6 +1627,7 @@ return await Deployment.RunAsync(() => { Location = "app/Dockerfile", }, + Push = false, }); }); @@ -1593,6 +1650,7 @@ func main() { Dockerfile: &dockerbuild.DockerfileArgs{ Location: pulumi.String("app/Dockerfile"), }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -1611,6 +1669,7 @@ resources: location: https://github.com/docker-library/hello-world.git dockerfile: location: app/Dockerfile + push: false type: docker-build:Image runtime: yaml ``` @@ -1644,6 +1703,7 @@ public class App { .dockerfile(DockerfileArgs.builder() .location("app/Dockerfile") .build()) + .push(false) .build()); } @@ -1666,6 +1726,7 @@ const image = new docker_build.Image("image", { tar: true, }, }], + push: false, }); ``` ```python @@ -1680,7 +1741,8 @@ image = docker_build.Image("image", docker=docker_build.ExportDockerArgs( tar=True, ), - )]) + )], + push=False) ``` ```csharp using System.Collections.Generic; @@ -1706,6 +1768,7 @@ return await Deployment.RunAsync(() => }, }, }, + Push = false, }); }); @@ -1732,6 +1795,7 @@ func main() { }, }, }, + Push: pulumi.Bool(false), }) if err != nil { return err @@ -1751,6 +1815,7 @@ resources: exports: - docker: tar: true + push: false type: docker-build:Image runtime: yaml ``` @@ -1787,6 +1852,7 @@ public class App { .tar(true) .build()) .build()) + .push(false) .build()); }