gpt4 book ai didi

amazon-web-services - 将 Amazon ECS 与 google 容器注册表结合使用

转载 作者:行者123 更新时间:2023-12-02 10:06:59 29 4
gpt4 key购买 nike

当我尝试将 AWS ECS 与私有(private) google 容器注册表一起使用时,我的任务始终处于待处理状态。根据AWS文档,我在容器定义中添加环境变量

ECS_ENGINE_AUTH_TYPE=dockercfg
ECS_ENGINE_AUTH_DATA=
{"https://eu.gcr.io": {
"email": "not@val.id",
"auth": "some hash"
}}

但我收到此错误

"CannotPullContainerError: Error: image not found"

我的完整任务定义

{
"requiresAttributes": [],
"taskDefinitionArn": "arn:aws:ecs:eu-west-1:745964170259:task-definition/test:2",
"status": "ACTIVE",
"revision": 2,
"containerDefinitions": [
{
"volumesFrom": [],
"memory": 128,
"extraHosts": null,
"dnsServers": null,
"disableNetworking": null,
"dnsSearchDomains": null,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80,
"protocol": "tcp"
}
],
"hostname": null,
"essential": true,
"entryPoint": null,
"mountPoints": [],
"name": "nginx_test",
"ulimits": null,
"dockerSecurityOptions": null,
"environment": [
{
"name": "ECS_ENGINE_AUTH_TYPE",
"value": "dockercfg"
},
{
"name": "ECS_ENGINE_AUTH_DATA",
"value": "{\"https://eu.gcr.io\":{\"auth\":\"somehash\",\"email\":\"not@val.id\"}}"
}
],
"links": null,
"workingDirectory": null,
"readonlyRootFilesystem": null,
"image": "eu.gcr.io/project_id/image_name",
"command": null,
"user": null,
"dockerLabels": null,
"logConfiguration": null,
"cpu": 0,
"privileged": null
}
],
"volumes": [],
"family": "test"
}

对于这种情况,正确的任务定义是什么?

最佳答案

应为 ECS 代理指定 ECS_ENGINE_AUTH_TYPEECS_ENGINE_AUTH_DATA 环境变量,而不是在任务定义中指定。 documentation有关于如何使用私有(private)注册表的说明。

关于amazon-web-services - 将 Amazon ECS 与 google 容器注册表结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33598819/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com