问题描述
我有一个ECS回购,使用ecs-cli创建了一个集群 ecs-cli configure --region = us-west -2 --profile =<我的个人资料> --cluster = cluster-1
ecs-cli up --capability-iam --keypair = MY KEYPAIR>
但是,执行撰写文件的下一步是当它失败时
ecs-cli compose --file docker-compose.yml --project-name drafter-project service up
这是我的docker-compose.yml文件:
版本:'2'
服务:
兔子:
image:rabbitmq
主机名:rabbit1
端口:
- 5672:5672
- 15672:15672
drafter:
构建:。
depends_on:
- 兔子
我得到的错误是: p>
注册任务定义错误
error = ClientException:Container.image不应为空或为空。
创建任务定义失败
error = ClientException:Container.image不应为空或为空。
我不知道有什么任务定义或需要什么。
根据我的理解,ecs-cli对完整的Docker Compose文件语法的支持非常有限。例如,您应该看到有关 WARN [0000]的警告,跳过不受支持的YAML选项进行服务...选项名称=构建服务名称起草者
原因是您正在使用的ecs-cli的版本是期望所有服务都是图像。因此, drafter
需要一个图像,您可以通过 docker build
或传统的 docker生成图像 -
call(但是你需要保留两个版本的compose文件 - 传统的和ecs兼容的。
注意:它似乎可能计划在未来的构建
支持,至少根据我之前看到的一个github评论(对不起,已经关闭标签,所以可以' t链接到它)。
I have a repo on ECS, have created a cluster using ecs-cli
ecs-cli configure --region=us-west-2 --profile=<MY PROFILE> --cluster=cluster-1
ecs-cli up --capability-iam --keypair=<MY KEYPAIR>
but then the next step to execute the compose file is when it fails
ecs-cli compose --file docker-compose.yml --project-name drafter-project service up
Here's my docker-compose.yml file:
version: '2'
services:
rabbit:
image: rabbitmq
hostname: rabbit1
ports:
- 5672:5672
- 15672:15672
drafter:
build: .
depends_on:
- rabbit
the errors i get here are:
Error registering task definition
error=ClientException: Container.image should not be null or empty.
Create task definition failed
error=ClientException: Container.image should not be null or empty.
I'm not sure what task definitions are or what it needs.
From what I understand, ecs-cli has a very limited support of the complete Docker Compose file syntax. For example, you should see warnings about WARN[0000] Skipping unsupported YAML option for service... option name=build service name drafter
The reason is version of ecs-cli you're using is expecting all services to be images. Thus, drafter
needs an image, which you can generate via docker build
or a traditional docker-compose
call (but then you'll need to maintain two versions of the compose file -- the traditional one and the ecs compatible one.
Note: it sounds like they may plan for build
support in the future, at least according to one github comment I saw earlier (sorry, already closed the tab, so can't link to it).
这篇关于使用ecs-cli在AWS上部署泊坞窗问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!