https://pulumi.com logo
#typescript
Title
# typescript
b

bland-gpu-78760

12/06/2023, 5:29 AM
Hi everyone! Hope you guys are well. I'm having some issues with getting Pulumi to create an amd64 build of my docker file within the index.ts. I'm running an Apple M1 Pro. I could use docker buildx outside of Pulumi, but how do I do it within Pulumi itself?
Copy code
const myImage = new docker.Image(customImage, {
    imageName: pulumi.interpolate`${registry.loginServer}/${customImage}:v1.0.0`,
    build: { context: `./${customImage}`, args: { "platform": "linux/amd64" } },
    registry: {
        server: registry.loginServer,
        username: adminUsername,
        password: adminPassword,
    },
});
b

billions-xylophone-85957

12/06/2023, 1:09 PM
this should work
Copy code
const image = new docker.Image(
            this.pulumiName,
            {
                imageName: args.destinationFqn,
                build: {
                    dockerfile: cfg.dockerfile,
                    args: cfg.args,
                    context: cfg.context,
                    platform: 'linux/amd64',
                },
                registry: {
                    server: opts.address,
                    username: opts.username,
                    password: opts.password,
                },
            },
            { parent: this, retainOnDelete: true, dependsOn: opts.dependsOn },
        )