簡體   English   中英

將cf push與Amazon ECR一起使用?

[英]Use cf push with Amazon ECR?

我正在嘗試執行Cloud Foundry CLI命令:cf push並使其從我們的aws ecr存儲庫中提取docker映像。 我不斷收到此錯誤消息:

Failed getting docker image by tag: unauthorized: access to the requested resource is not authorized

我已經通過aws configure命令使用訪問密鑰ID和秘密訪問密鑰登錄到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集成的任何想法?

您可能會遇到Cloud Controller中的錯誤。 您可以在這里看到故事。

https://www.pivotaltracker.com/n/projects/966314/stories/159373079

AWS ECR憑證相當長,可以在CCDB中被截斷。 然后,當它們用於獲取您的圖像時,它們將失敗,因為它們是不正確的。

在撰寫本文時,似乎沒有解決方法,但我希望很快能解決。 然后,您只需要將CF環境升級到包含此修復程序的版本。 您可以檢查故事,故事將在完成后進行更新。

更新 -從此更新開始,cf-deployment中提供了一個修復程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM