Skip to content

Commit

Permalink
Fix platform example (#1030)
Browse files Browse the repository at this point in the history
The example was showing the equivalent of `--build-arg
platform=linux/amd64` but `--platform=linux/amd64` is more appropriate.
  • Loading branch information
blampe committed Mar 14, 2024
1 parent 3226ca6 commit dccb649
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 38 deletions.
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-resource-docker/schema.json

Large diffs are not rendered by default.

22 changes: 6 additions & 16 deletions provider/pkg/docs-gen/examples/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import * as docker from "@pulumi/docker";

const demoImage = new docker.Image("demo-image", {
build: {
args: {
platform: "linux/amd64",
},
context: ".",
dockerfile: "Dockerfile",
platform: "linux/amd64",
},
imageName: "username/image:tag1",
skipPush: true,
Expand All @@ -26,11 +24,9 @@ import pulumi_docker as docker

demo_image = docker.Image("demo-image",
build=docker.DockerBuildArgs(
args={
"platform": "linux/amd64",
},
context=".",
dockerfile="Dockerfile",
platform="linux/amd64",
),
image_name="username/image:tag1",
skip_push=True)
Expand All @@ -48,12 +44,9 @@ return await Deployment.RunAsync(() =>
{
Build = new Docker.Inputs.DockerBuildArgs
{
Args =
{
{ "platform", "linux/amd64" },
},
Context = ".",
Dockerfile = "Dockerfile",
Platform = "linux/amd64",
},
ImageName = "username/image:tag1",
SkipPush = true,
Expand All @@ -78,11 +71,9 @@ func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
demoImage, err := docker.NewImage(ctx, "demo-image", &docker.ImageArgs{
Build: &docker.DockerBuildArgs{
Args: pulumi.StringMap{
"platform": pulumi.String("linux/amd64"),
},
Context: pulumi.String("."),
Dockerfile: pulumi.String("Dockerfile"),
Platform: pulumi.String("linux/amd64"),
},
ImageName: pulumi.String("username/image:tag1"),
SkipPush: pulumi.Bool(true),
Expand All @@ -107,10 +98,9 @@ resources:
version: v4.4.0
properties:
build:
args:
platform: linux/amd64
context: .
dockerfile: Dockerfile
platform: linux/amd64
imageName: username/image:tag1
skipPush: true
type: docker:Image
Expand Down Expand Up @@ -141,9 +131,9 @@ public class App {
public static void stack(Context ctx) {
var demoImage = new Image("demoImage", ImageArgs.builder()
.build(DockerBuildArgs.builder()
.args(Map.of("platform", "linux/amd64"))
.context(".")
.dockerfile("Dockerfile")
.platform("linux/amd64")
.build())
.imageName("username/image:tag1")
.skipPush(true)
Expand Down
6 changes: 2 additions & 4 deletions provider/pkg/docs-gen/examples/yaml/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ resources:
build:
dockerfile: Dockerfile
context: .
args:
platform: linux/amd64
platform: linux/amd64
options:
version: v4.4.0
outputs:
Expand Down Expand Up @@ -66,8 +65,7 @@ resources:
registry:
server: ${ecr-repository.repositoryUrl}
password:
fn::secret:
${authToken.password}
fn::secret: ${authToken.password}
options:
version: v4.1.2
outputs:
Expand Down
5 changes: 1 addition & 4 deletions sdk/dotnet/Image.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions sdk/go/docker/image.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/java/src/main/java/com/pulumi/docker/Image.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions sdk/nodejs/image.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions sdk/python/pulumi_docker/image.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dccb649

Please sign in to comment.