From 7205f796a48656ed1e5d77f9483fead332da4b14 Mon Sep 17 00:00:00 2001 From: Michael Meyer <9434150+mtmeyer@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:31:36 +1000 Subject: [PATCH] fix: python docker build architecture --- platform/src/components/aws/function.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/src/components/aws/function.ts b/platform/src/components/aws/function.ts index 40ce7cfcf..1ed5ac265 100644 --- a/platform/src/components/aws/function.ts +++ b/platform/src/components/aws/function.ts @@ -1620,6 +1620,12 @@ export class Function extends Component implements Link.Linkable { registryId: bootstrapData.assetEcrRegistryId, }); + const archPlatformMap: Record = { + "arm64": "linux/arm64", + "x86_64": "linux/amd64" + } + + const platforms = architectures.apply((architectures) => architectures.map((arch) => archPlatformMap[arch])) // build image //aws-python-container::sst:aws:Function::MyPythonFunction return new Image( @@ -1658,7 +1664,7 @@ export class Function extends Component implements Link.Linkable { inline: {}, }, ], - /// TODO: walln - enable arm64 builds by using architecture args + platforms, push: true, registries: [ authToken.apply((authToken) => ({