我尝试通过运行任务(由任务定义定义)来使用 Amazon ECS 部署和运行简单的 Dockerized Ruby 后端,但它无法运行我的命令并返回以下错误:
CannotPullContainerError:API 错误 (400):参考格式无效
我尝试运行一个小的入口点命令echo "Hello"
但无论是 exec 形式还是 shell 形式,它都会返回相同的错误。我尝试在本地终端中运行此命令,它运行良好:
$ docker-compose run job echo 'HELLO_WORLD'
HELLO_WORLD
这是我的集群任务的“详细信息”部分中显示的错误消息:
Status reason CannotPullContainerError: API error (400): invalid reference format
Entry point ["echo","HELLO"]
这是我的任务定义 JSON(出于安全原因隐藏某些信息):
{
"executionRoleArn": null,
"containerDefinitions": [
{
"dnsSearchDomains": null,
"logConfiguration": null,
"entryPoint": [
"echo",
"HELLO"
],
"portMappings": [],
"command": [],
"linuxParameters": null,
"cpu": 0,
"environment": [
{
"name": "RAILS_ENV",
"value": "production"
}
],
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"dockerSecurityOptions": null,
"memory": 7000,
"memoryReservation": null,
"volumesFrom": [],
"image": "<ecs_image_arn>",
"disableNetworking": false,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"privileged": null,
"name": "<name>"
}
],
"memory": null,
"taskRoleArn": "arn:aws:iam::<id>:role/<name>",
"family": "<test-cluster>",
"requiresCompatibilities": [
"EC2"
],
"networkMode": null,
"cpu": null,
"volumes": [],
"placementConstraints": []
}
将入口点更改为使用命令也不起作用。
Status reason CannotPullContainerError: API error (400): invalid reference format
Command ["echo","HELLO"]
我是否遗漏了任何配置来制作简单的echo
指挥工作?