Set explicit arm64 platform on Docker image build #30

Merged
amoussa1229 merged 1 commit from fix/socket-mode-arm64-platform into main 2026-05-08 21:58:29 +00:00
amoussa1229 commented 2026-05-08 21:54:14 +00:00 (Migrated from github.com)

Summary

Fix the socket-mode ECS container crash caused by architecture mismatch. CDK's ContainerImage.fromAsset() builds for the host architecture by default — on x86_64 GitHub Actions runners, this produces an x86 image even with QEMU installed. The Fargate task definition requires ARM64, so the container fails with exec format error.

Adds platform: ecr_assets.Platform.LINUX_ARM64 to the fromAsset() call so Docker builds the image with --platform linux/arm64 via QEMU emulation.

Validation

  • Confirmed exec format error in CloudWatch logs (container starts and immediately exits with code 255)
  • Confirmed the ECS task definition requires ARM64 (runtimePlatform.cpuArchitecture: ARM64)
  • tsc --noEmit passes locally

Tests

Deploy will be validated on merge to main — CloudFormation will update the ECS service with the correctly-built arm64 image.

Notes

The CloudFormation stack is currently rolling back. Wait for UPDATE_ROLLBACK_COMPLETE before merging.

## Summary Fix the socket-mode ECS container crash caused by architecture mismatch. CDK's `ContainerImage.fromAsset()` builds for the host architecture by default — on x86_64 GitHub Actions runners, this produces an x86 image even with QEMU installed. The Fargate task definition requires ARM64, so the container fails with `exec format error`. Adds `platform: ecr_assets.Platform.LINUX_ARM64` to the `fromAsset()` call so Docker builds the image with `--platform linux/arm64` via QEMU emulation. ## Validation - Confirmed `exec format error` in CloudWatch logs (container starts and immediately exits with code 255) - Confirmed the ECS task definition requires ARM64 (`runtimePlatform.cpuArchitecture: ARM64`) - `tsc --noEmit` passes locally ## Tests Deploy will be validated on merge to main — CloudFormation will update the ECS service with the correctly-built arm64 image. ## Notes The CloudFormation stack is currently rolling back. Wait for `UPDATE_ROLLBACK_COMPLETE` before merging.
claude[bot] commented 2026-05-08 21:55:03 +00:00 (Migrated from github.com)

Looks good. Targeted fix for the architecture mismatch — adding Platform.LINUX_ARM64 to fromAsset() correctly matches the task definition's cpuArchitecture: ARM64 and resolves the exec format error from x86 images being run on ARM64 Fargate. No bugs, security, or convention concerns.

Looks good. Targeted fix for the architecture mismatch — adding `Platform.LINUX_ARM64` to `fromAsset()` correctly matches the task definition's `cpuArchitecture: ARM64` and resolves the `exec format error` from x86 images being run on ARM64 Fargate. No bugs, security, or convention concerns.
This repo is archived. You cannot comment on pull requests.
No description provided.