在 Amazon ECS 任务定义中指定 ARM 架构
要使用 ARM 架构,请为 cpuArchitecture
任务定义参数指定 ARM64
。
在以下示例中,ARM 架构是在任务定义中指定的。该文件以 JSON 格式。
{
"runtimePlatform": {
"operatingSystemFamily": "LINUX",
"cpuArchitecture": "ARM64"
},
...
}
在以下示例中,ARM 架构的任务定义显示“hello world”。
{ "family": "arm64-testapp", "networkMode": "awsvpc", "containerDefinitions": [ { "name": "arm-container", "image": "public.ecr.aws/docker/library/busybox:latest", "cpu": 100, "memory": 100, "essential": true, "command": [ "echo hello world" ], "entryPoint": [ "sh", "-c" ] } ], "requiresCompatibilities": [ "EC2" ], "cpu": "256", "memory": "512", "runtimePlatform": { "operatingSystemFamily": "LINUX", "cpuArchitecture": "ARM64" }, "executionRoleArn": "arn:aws:iam::123456789012:role/ecsTaskExecutionRole" }