我正在尝试执行Cloud Foundry CLI命令:cf push并让它从我们的aws ecr存储库中提取docker图像。我一直收到以下错误消息:
Failed getting docker image by tag: unauthorized: access to the requested resource is not authorized
我已使用访问密钥ID和机密访问密钥通过aws配置命令登录aws,并已从“aws ecr get login”命令获得ecr登录。
我可以使用docker拉取图像:
docker pull 1234567.dkr.ecr.us-east-1.amazonaws.com/repo/example:17.5.0-SNAPSHOT
所以我知道我有有效的证件。但是,这是尝试cf push命令时出现的错误:
CF_DOCKER_PASSWORD=mypassword cf push example --docker-image 1234567.dkr.ecr.us-east-1.amazonaws.com/repo/example:17.5.0-SNAPSHOT --docker-username myusername
Using docker repository password from environment variable CF_DOCKER_PASSWORD.
....<snip>
Staging process started ...
Failed getting docker image by tag: unauthorized: access to the requested resource is not authorized Going to retry attempt: 1
Failed getting docker image by tag: unauthorized: access to the requested resource is not authorized Going to retry attempt: 2
Failed getting docker image by tag: unauthorized: access to the requested resource is not authorized Going to retry attempt: 3
Failed getting docker image by tag: unauthorized: access to the requested resource is not authorized
Staging process failed: Exit trace for group:
builder exited with error: failed to fetch metadata from [repo/example] with tag [17.5.0-SNAPSHOT] and insecure registries [] due to unauthorized: access to the requested resource is not authorized
Exit status 2
Staging Failed: Exited with status 2
Destroying container
Successfully destroyed container
...<snip>
我尝试了aws登录和密码,还尝试了访问密钥ID和秘密访问密钥。两者都返回相同的错误。
有没有关于如何将aws ecr与cf push集成的想法?