我正在尝试使用AWS ECS和docker设置CI.我使用Codeship作为CI工具,但这并不重要.
我在shell脚本中执行以下步骤:
aws ecs register-task-definition --family postgraphile --cli-input-json file:///deploy/ecs-task-def.json --region us-east-2aws ecs run-task --task-definition postgraphile --cluster testcluster --region us-east-2Shell脚本成功运行,但是在我尝试运行ECS任务后,在输出中看到错误:
{
"tasks": [],
"failures": [
{
"arn": "arn:aws:ecs:us-east-2:99999999999:container-instance/050ab165-7669-45d5-8be7-d990cf4fff42",
"reason": "RESOURCE:MEMORY"
}
]
}
Run Code Online (Sandbox Code Playgroud)
我的ecs-task-def.json:
{
"containerDefinitions": [
{
"name": "postgraphile-container",
"image": "999999999999.dkr.ecr.us-east-2.amazonaws.com/test-repository",
"memory": 500,
"essential": true,
"portMappings": [
{
"hostPort": 5000,
"containerPort": 5000
}
]
}
],
"volumes": [],
"memory": "900",
"cpu": "128",
"placementConstraints": [],
"family": "postgraphile",
"taskRoleArn": ""
}
Run Code Online (Sandbox Code Playgroud)
我想我已经检查了所有内存限制..我错过了什么吗?
更新:在重新启动ec2实例后,我终于可以运行ecs任务而没有错误.多次运行任务后,错误返回