小编Vic*_* L.的帖子

资源:尝试使用AWS CLI运行ECS任务时出现内存错误

我正在尝试使用AWS ECS和docker设置CI.我使用Codeship作为CI工具,但这并不重要.

我在shell脚本中执行以下步骤:

  • 用我的Dockerfile构建一个图像,
  • 将图像推送到ECS存储库,
  • 将task-definition.json推送到ECS aws ecs register-task-definition --family postgraphile --cli-input-json file:///deploy/ecs-task-def.json --region us-east-2
  • 运行ECS任务 aws ecs run-task --task-definition postgraphile --cluster testcluster --region us-east-2

Shell脚本成功运行,但是在我尝试运行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任务而没有错误.多次运行任务后,错误返回

amazon-ec2 amazon-web-services

8
推荐指数
1
解决办法
3276
查看次数

如何响应本地设备上的ios设备按钮按下?

我需要在我的本机应用程序中按一下音量按钮。在文档中找不到任何内容。

ios react-native

5
推荐指数
1
解决办法
858
查看次数