跳至內容

當我的任務無法在 Amazon ECS 叢集中啟動時,如何解決 "Image does not exist" 錯誤?

2 分的閱讀內容
0

我的 Amazon Elastic Container Service (Amazon ECS) 服務無法啟動叢集中的任務,並且我收到以下錯誤:"CannotPullContainerError: Error response from daemon: manifest for 1234567890.dkr.ecr.us-east-1.amazonaws.com/test:curlnginx1234 not found."

簡短描述

當您從 Amazon Elastic Container Registry (Amazon ECR) 私有儲存庫提取映像檔時,會收到此錯誤訊息。

如果您沒有收到此錯誤訊息,請選擇以下其中一個解決方案來處理您的問題或錯誤訊息:

**注意:**若要對 Amazon ECS 服務問題進行疑難排解,請檢查服務事件日誌中的診斷資訊。

解決方法

**注意:**如果您在執行 AWS Command Line Interface (AWS CLI) 命令時收到錯誤,請參閱對 AWS CLI 錯誤進行疑難排解。此外,請確定您使用的是最新的 AWS CLI 版本

若要解決 Image does not exist 錯誤,請完成以下步驟:

  1. 請確認映像檔已在您的 Amazon ECS 任務定義中宣告。如需詳細資訊,請參閱映像檔
  2. 請確認該 Docker 映像檔存在於 Amazon ECR 儲存庫中。如需詳細資訊,請參閱查看 Amazon ECR 中的映像檔詳細資訊。若要查看儲存庫資訊,請使用 Amazon ECR 主控台。或者,執行以下命令。
    若要確認映像檔存在於 ECR 儲存庫中,請執行 list-images 命令:
    aws ecr list-images --repository-name "hello-world"  --region us-east-1
    若要篩選 ECR 儲存庫中的映像檔,請執行 describe-images 命令:
    aws ecr describe-images --repository-name "hello-world" --region us-east-1 --query 'sort_by(imageDetails,& imagePushedAt)[*]'
    **注意:**將 repository-nameregion 替換為您的值。
  3. 請在您的任務定義中指定 Amazon ECR 映像檔。使用映像檔的完整 URI。如需更多資訊,請參閱 Amazon ECR 映像檔和任務定義 IAM 角色
    **重要:**確認映像檔的 URI 中沒有前置或尾端的空白字元。

相關資訊

Amazon ECR 中的私有映像檔

AWS 官方已更新 2 年前