ECR任务定义:容器链接不应该有一个循环? [英] ECR Task definition: Container links should not have a cycle?

查看:110
本文介绍了ECR任务定义:容器链接不应该有一个循环?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AWS-CLI注册ECR任务定义.我的任务定义如下:

I'm using AWS-CLI to register an ECR task definition. My task definition is like follows:

{
"family": "",
"taskRoleArn": "",
"executionRoleArn": "",
"networkMode": "none",
"containerDefinitions": [
    {
        "name": "",
        "image": "",
        "cpu": 0,
        "memory": 0,
        "memoryReservation": 0,
        "links": [
            ""
        ],
        "portMappings": [
            {
                "hostPort": 80, 
                "protocol": "tcp", 
                "containerPort": 80
            }
        ],
        "essential": true,
        "entryPoint": [
            ""
        ],
        "command": [
            ""
        ],
        "environment": [
            {
                "name": "",
                "value": ""
            }
        ],
        "mountPoints": [
            {
                "sourceVolume": "",
                "containerPath": "",
                "readOnly": true
            }
        ],
        "volumesFrom": [
            {
                "sourceContainer": "",
                "readOnly": true
            }
        ],
        "linuxParameters": {
            "capabilities": {
                "add": [
                    ""
                ],
                "drop": [
                    ""
                ]
            },
            "devices": [
                {
                    "hostPath": "",
                    "containerPath": "",
                    "permissions": [
                        "mknod"
                    ]
                }
            ],
            "initProcessEnabled": true
        },
        "hostname": "",
        "user": "",
        "workingDirectory": "",
        "disableNetworking": true,
        "privileged": true,
        "readonlyRootFilesystem": true,
        "dnsServers": [
            ""
        ],
        "dnsSearchDomains": [
            ""
        ],
        "extraHosts": [
            {
                "hostname": "",
                "ipAddress": ""
            }
        ],
        "dockerSecurityOptions": [
            ""
        ],
        "dockerLabels": {
            "KeyName": ""
        },
        "ulimits": [
            {
                "name": "fsize",
                "softLimit": 0,
                "hardLimit": 0
            }
        ],
        "logConfiguration": {
            "logDriver": "syslog",
            "options": {
                "KeyName": ""
            }
        }
    }
],
"volumes": [
    {
        "name": "",
        "host": {
            "sourcePath": ""
        }
    }
],
"placementConstraints": [
    {
        "type": "memberOf",
        "expression": ""
    }
],
"requiresCompatibilities": [
    "EC2"
],
"cpu": "10",
"memory": "600"

} ,基本上与自动生成的骨架相同:

} , which is basically almost identical to the auto-generated skeleton:

 aws ecs register-task-definition --generate-cli-skeleton

但是看起来在使用命令时

But it looks that when using the command

aws ecs register-task-definition --family taskDef --cli-input-json taskDef-v1.json --region us-east-2

我明白了: 调用RegisterTaskDefinition操作时发生错误(ClientException):容器链接不应具有循环

我在做什么错了?

推荐答案

由于定义了空链接,导致了该特定错误:

That particular error is caused because you have empty links defined:

"links": [
  ""
]

CLI框架是您需要编辑的模板-它具有许多不需要的字段的空值.最小任务定义模板类似于:

The CLI skeleton is a template you need to edit - it has many empty values for fields that are not required. The minimum task definition template is something like:

{
  "containerDefinitions": [
    {
      "name": "my-task-name",
      "image": "my-registry/my-image",
      "memoryReservation": 256,
      "cpu": 256
    }
  ]
}

这篇关于ECR任务定义:容器链接不应该有一个循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆