作者:是不是有谁代替我陪在你身旁 | 来源:互联网 | 2022-12-09 18:16
我尝试通过运行一个Task(由Task Definition定义)来使用Amazon ECS部署和运行一个简单的Dockerized Ruby后端,但是它无法运行我的命令并返回此错误:
CannotPullContainerError:API错误(400):无效的引用格式
我试图运行一个小的Entrypoint命令,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": "",
"disableNetworking": false,
"healthCheck": null,
"essential": true,
"links": null,
"hostname": null,
"extraHosts": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": null,
"privileged": null,
"name": ""
}
],
"memory": null,
"taskRoleArn": "arn:aws:iam:::role/",
"family": "",
"requiresCompatibilities": [
"EC2"
],
"networkMode": null,
"cpu": null,
"volumes": [],
"placementConstraints": []
}
将entryPoint更改为使用命令也无法正常工作。
Status reason CannotPullContainerError: API error (400): invalid reference format
Command ["echo","HELLO"]
我是否缺少任何配置以使简单echo
命令起作用?
1> BMitch..:
“无效的参考格式”表示泊坞窗试图解析的映像名称无效。在您的日志中:
"image": "",
图像名称确实无效,需要用有效的图像名称替换。如果您出于隐私目的在此问题中已替换了该字符串,则删除的部分就是您的错误所在。