How a platform mismatch surfaces#
A task definition states the platform its tasks run on in runtimePlatform: cpuArchitecture is X86_64 or ARM64, and operatingSystemFamily is LINUX or a Windows Server value. On Fargate, X86_64 and LINUX are the defaults when the revision leaves them out. A build on an ARM laptop or a CI runner of another architecture can push an image for a platform the task does not run. RuntimePlatform · Specifying the ARM architecture
The image can take two shapes, and they fail in different places:
- An image index (an OCI image index or a Docker manifest list) points to one manifest per platform. The client picks the entry that matches its platform. If no entry matches, there is nothing to pull. Operators report the task stopping with
TaskFailedToStartand aCannotPullContainerErrorthat says no descriptor or manifest matched the platform. OCI image index · Multi-architecture images in ECR · A Fargate report on re:Post - A single image manifest offers no choice. When the runtime pulls it, the process cannot execute on the task's CPU. AWS describes this as an exec format error: the essential container exits right away and the task stops with
EssentialContainerExited. Exec format error on ECS
On Windows, an image whose base OS does not match the host fails when the container starts, with a reason that says the container operating system does not match the host. Stopped Windows tasks
Two neighbors leave similar records. A missing tag also produces CannotPullContainerError, with a not-found reason; see image not found. A command that does not exist in the image also exits at once; see command not found.
Read the task and its revision#
Use a read-only profile and replace the uppercase placeholders.
aws ecs describe-tasks \
--profile PROFILE --region REGION --cluster CLUSTER --tasks TASK_ARN \
--query 'tasks[].{definition:taskDefinitionArn,launch:launchType,platform:platformVersion,code:stopCode,reason:stoppedReason,started:startedAt,containers:containers[].{name:name,image:image,digest:imageDigest,exit:exitCode,reason:reason}}' \
--output json --no-cli-pager
aws ecs describe-task-definition \
--profile PROFILE --region REGION --task-definition TASK_DEFINITION_ARN \
--query 'taskDefinition.{runtime:runtimePlatform,compat:requiresCompatibilities,containers:containerDefinitions[].{name:name,image:image}}' \
--output json --no-cli-pager
A null runtime on a Fargate revision means the defaults apply: Linux on X86_64. A container digest on a task that exited tells you which manifest ECS pulled; it may name an index, so use it to look up the image in ECR and read the platform from there. Task fields · Container fields
Read the platforms the image contains#
Start with ECR, which says whether the tag names an index or a single manifest.
aws ecr describe-images \
--profile PROFILE --region IMAGE_REGION --registry-id IMAGE_ACCOUNT \
--repository-name REPOSITORY --image-ids imageTag=TAG \
--query 'imageDetails[].{digest:imageDigest,tags:imageTags,manifestType:imageManifestMediaType,artifactType:artifactMediaType,pushed:imagePushedAt}' \
--output json --no-cli-pager
application/vnd.oci.image.index.v1+json or application/vnd.docker.distribution.manifest.list.v2+json in manifestType means an index. An image manifest type such as application/vnd.oci.image.manifest.v1+json or application/vnd.docker.distribution.manifest.v2+json means one platform. ImageDetail · OCI image index media type
The platform names live inside the manifests, which the ECR API returns as raw JSON. Read them with Docker after aws ecr get-login-password signs your Docker client in to the registry. These commands download manifests, and the last one downloads the whole image. Registry authentication
# Index: one entry per platform, each with platform.os and platform.architecture
docker manifest inspect IMAGE_ACCOUNT.dkr.ecr.IMAGE_REGION.amazonaws.com/REPOSITORY:TAG
# Single manifest: pull that exact digest and read its config
docker pull IMAGE_ACCOUNT.dkr.ecr.IMAGE_REGION.amazonaws.com/REPOSITORY@sha256:DIGEST
docker image inspect --format '{{.Os}}/{{.Architecture}}' \
IMAGE_ACCOUNT.dkr.ecr.IMAGE_REGION.amazonaws.com/REPOSITORY@sha256:DIGEST
Image platforms use Go's names: amd64 corresponds to ECS X86_64, and arm64 to ARM64. An index entry may also carry a variant, such as v8 for arm64. OCI platform fields · docker manifest inspect · docker image inspect
What each combination means#
| Task record | Image shape | Image platforms | Reading | Change |
|---|---|---|---|---|
TaskFailedToStart, pull reason about the platform | Index | No entry for the task's OS and architecture | The build published other platforms only | Build and push the missing platform into the index, or set runtimePlatform to a platform the index has |
EssentialContainerExited, startedAt set, logs or reason mention an exec format error | Single manifest | Another architecture | The image pulled and could not execute | Rebuild for the task's architecture, or register a revision whose cpuArchitecture matches the image |
EssentialContainerExited | Single manifest | Matches the task | The platform is not the cause | Read the exit code and logs; see command not found |
TaskFailedToStart, not-found reason | Any | Any | The reference, not the platform | See image not found |
Changing cpuArchitecture registers a new task definition revision, and a service needs a deployment to use it. All task definitions used in one service must share the same cpuArchitecture and operatingSystemFamily, according to AWS's task definition reference. On EC2, an ARM64 revision needs ARM container instances in the cluster; without them, expect a placement failure in the service events and no stopped task. Task definition parameters
An illustrative release, two outcomes#
These records are fictional. orders:58 runs on Fargate with no runtimePlatform, so it runs Linux on X86_64. Its image tag 2026-11-20.3 was built on a developer's ARM laptop after the CI runner was down.
| Outcome | Task record | ECR and Docker reads | Reading |
|---|---|---|---|
| A | TaskFailedToStart; the pull reason says no manifest matched linux/amd64 | manifestType is an OCI index; docker manifest inspect lists one entry, linux/arm64, plus an entry with unknown platform | The laptop's builder published an index with only the ARM image. Rebuild with both platforms, or for linux/amd64 only. |
| B | EssentialContainerExited, startedAt set, exit code 1, the log stream shows an exec format error | manifestType is a single Docker v2 manifest; docker image inspect reports linux/arm64 | The pull succeeded and the binary could not run. Same fix; the record just appears one layer later. |
The entry with an unknown platform in outcome A is an attestation manifest. Docker's builder adds these to an index with platform unknown/unknown so that runtimes do not pull them as images. Do not count it as a platform. Attestation storage
Confirm on the replacement#
A replacement task should reach RUNNING with a startedAt, and its essential container should stay up past the point where the old one exited. Read the platforms of the new tag the same way before you deploy it, and keep the docker manifest inspect output with the incident record, since a tag can be pushed again later.
Where this check misleads#
Docker selects the entry for its own host when you pull a tag that names an index, so docker pull TAG on an ARM laptop succeeds against an index that has no amd64 entry. Read the index itself, or pull a digest. Multi-architecture images in ECR
A runtime can also refuse a single-platform manifest for the wrong platform at pull time instead of running it and failing at exec. Either record points at the same cause, and the image's platform settles it. The exit code that a wrong-architecture binary produces depends on how the runtime reports the failed exec, so do not identify this failure by exit code alone; the image's platform is the evidence. The stopped reason is free text that AWS rewords from time to time; the signature table sorts on stop codes for that reason.
Questions#
What is the default CPU architecture for an ECS Fargate task?
X86_64 on Linux. A revision with no runtimePlatform runs there, so an image built only for arm64 fails on it.
How do I tell which architectures an ECR image supports?
Check imageManifestMediaType from aws ecr describe-images. For an index, docker manifest inspect lists each entry's platform.os and platform.architecture; for a single manifest, pull the digest and read .Os and .Architecture with docker image inspect.
Can one ECS service run both ARM64 and X86_64 tasks?
AWS's task definition reference says the task definitions a service uses must share one cpuArchitecture. A multi-platform image lets the same tag serve services of either architecture, but each service still states its own.