aws ecs 403错误登录私有注册表

aws ecs 403 error to login private registry

我正在尝试使用 ECS 登录 Quay。
Quay 是一个私人注册表 docker。

我遵循了这个文档,但我也遇到了 403 错误:“{\"error\": \"Permission Denied\"}”。

我把这段代码放在 /etc/ecs/ecs.config:

ECS_ENGINE_AUTH_TYPE=docker
ECS_ENGINE_AUTH_DATA={"https://quay.io/": { "username": "xxxxxx","password":"xxxxx","email": "."}}

我已经重新启动了 ecs 服务,但它不起作用。

你有想法了吗?

The documentation 指出 /etc/ecs/ecs.conf 的内容略有不同:

ECS_ENGINE_AUTH_TYPE=dockercfg
ECS_ENGINE_AUTH_DATA={"https://quay.io": {"auth": "YOURAUTHTOKENFROMDOCKERCFG", "email": "user@example.com"}}

它使用 dockercfg 和一个标记而不是 username/password。

文档页面“I'm authorized but I'm still getting 403s”中描述了 dockercfg

docker stores the credentials it uses for push and pull in a file typically placed at $HOME/.dockercfg.

If you are executing docker in another environment (scripted docker build, virtual machine, makefile, virtualenv, etc), docker will not be able to find the .dockercfg file and will fail.

作为 OP Mathieu Perochon comments , this is also linked to the environment version of the Amazon Machine Image:

I have upgrade my AMI (Amazon ECS-Optimized Amazon Linux) and it's working

感谢@VonC 的回复。我已经解决了我的问题。我已经升级了我的 AMI(Amazon ECS-Optimized Amazon Linux)并且它正在运行。

Link 良好的 AMI:https://aws.amazon.com/marketplace/pp/B00U6QTYI2/