Interview Prep/AWS/ECS, EKS, ECR and Lambda

A container starts and immediately exits with `exec /usr/local/bin/app: exec format error` on the new Graviton nodes.

IntermediateTroubleshootingECS, EKS, ECR and Lambda
Answer

Likely causes → The image was built only for linux/amd64 and is running on an arm64 (Graviton) node, or the other way round.

Diagnose →

docker buildx imagetools inspect 111111111111.dkr.ecr.us-east-1.amazonaws.com/api:1.4
kubectl get nodes -L kubernetes.io/arch

Fix →

docker buildx build --platform linux/amd64,linux/arm64 \
  -t 111111111111.dkr.ecr.us-east-1.amazonaws.com/api:1.4 --push .

For a quick fix, pin the workload with nodeSelector: kubernetes.io/arch: amd64, or set ECS runtimePlatform.cpuArchitecture.

Prevent → Build multi-arch images in CI, and run arm64 smoke tests before you add Graviton capacity.

aws All AWS questions Roadmap: EKS, ECS & serverless on AWS

More on ECS, EKS, ECR and Lambda