elegant-gigabyte-8733
06/21/2023, 3:30 PMawsx.ecr.Image
resource. I tried to set it with the args
but it seems like that didn’t work either
const plaidContainerImage = new awsx.ecr.Image("plaid-container-image", {
repositoryUrl: ecrRepositoryUrl,
path: "..",
args: {"platform": "linux/amd64"}
})
curved-kitchen-24115
06/21/2023, 3:35 PMelegant-gigabyte-8733
06/21/2023, 3:36 PMdocker.Image
allows you to build for a specific platform
Yes, you can set the platform architecture for a Docker image using the platform property of build in the docker.Image resource. Here's a Pulumi TypeScript program that demonstrates how to do this:
import * as pulumi from "@pulumi/pulumi";
import * as docker from "@pulumi/docker";
// Build a Docker image with a specific platform architecture
const myImage = new docker.Image("my-image", {
build: {
context: "./path/to/docker-context",
platform: "linux/arm64", // Set the platform architecture here
dockerfile: "./path/to/Dockerfile",
},
imageName: "my-docker-image",
// Set registry credentials if needed
// registry: {
// server: "my-docker-registry-server",
// username: "my-docker-registry-username",
// password: "my-docker-registry-password",
// },
});
curved-kitchen-24115
06/21/2023, 3:38 PMdocker.Image
not awsx.ecr.Image
elegant-gigabyte-8733
06/21/2023, 3:38 PMargs
is the wrong place those after reading the docs closerawsx.ecr.Image
will let you set this architecture. It seems like the answer is no--platform linux/arm64
here should workcurved-kitchen-24115
06/21/2023, 3:40 PMelegant-gigabyte-8733
06/21/2023, 3:42 PMpulumi up
from Github on an ubuntu machine it works fine because it builds a linux/amd64
image but if I do it from my Mac it breaks because I have an M1curved-kitchen-24115
06/21/2023, 3:44 PMelegant-gigabyte-8733
06/21/2023, 3:46 PMcurved-kitchen-24115
06/21/2023, 3:47 PMelegant-gigabyte-8733
06/21/2023, 3:49 PMcurved-kitchen-24115
06/21/2023, 3:49 PMelegant-gigabyte-8733
06/21/2023, 3:52 PMminiature-musician-31262
06/22/2023, 12:13 AMDOCKER_DEFAULT_PLATFORM="linux/amd64"
also works, either in the shell that runs pulumi
or as an environment variable on the Image
resource itself. I'll verify thoughconst image = new awsx.ecr.Image("image", {
repositoryUrl: repo.url,
path: "./app",
env: {
DOCKER_DEFAULT_PLATFORM: "linux/amd64",
}
});
elegant-gigabyte-8733
06/22/2023, 2:21 AM