This message was deleted.
# general
s
This message was deleted.
s
hey! I double checked this code with all of the same tool versions, using a generic python dockerfile and cannot repro what you are seeing. This error makes me think that somehow in your plugin cache, or possibly your $PATH you are still on Docker v3, which did not have that resource. Can you look at the result of
pulumi about
? also, there's a couple quirks in your code that didn't work straightaway: • image names can't have all caps • your
platform
should go into a top-level
Platform
field, not into Docker build args. Something like this should work:
Copy code
package main

import (
	"<http://github.com/pulumi/pulumi-docker/sdk/v4/go/docker|github.com/pulumi/pulumi-docker/sdk/v4/go/docker>"
	"<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		demoImage, err := docker.NewImage(ctx, "DummyImage", &docker.ImageArgs{
			Build: &docker.DockerBuildArgs{
				Platform:   pulumi.String("linux/amd64"),
				Context:    pulumi.String("../service"),
				Dockerfile: pulumi.String("../service/Dockerfile"),
			},
			ImageName: pulumi.String("sample-image-name"),
			SkipPush:  pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		ctx.Export("demo-image", demoImage.ImageName)
		return nil
	})
}
To check and remove any plugins, you can run
pulumi plugin
and follow the help text to list and remove.
w
hi @shy-arm-32391 thank you for that, the problem was my plugin docker wasnt up to date... after updating everything went well šŸ™‚ thank you for the help!
šŸ™Œ 1
s
those things can be super sticky! glad you got it resolved šŸ™‚