在 Amazon ECS 任務定義中指定 ARM 架構 - Amazon Elastic Container Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

在 Amazon ECS 任務定義中指定 ARM 架構

若要使用 ARM 架構,請為 cpuArchitecture 任務定義參數指定 ARM64

在以下範例中,ARM 架構是在任務定義中指定的。其為 JSON 格式。

{ "runtimePlatform": { "operatingSystemFamily": "LINUX", "cpuArchitecture": "ARM64" }, ... }

以下為顯示"hello world" 的 ARM 架構的任務定義範例。

{ "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" }