Image not found: 404 Client Error: Not Found: aws-ecr-push-image atlassian pipeline

Image not found: 404 Client Error: Not Found: aws-ecr-push-image atlassian pipeline

我正在使用 Atlassian 管道构建 docker 图像并将其推送到 AWS ECR,但构建正在被拆除并显示以下消息。

信息:正在执行 aws-ecr-push-image 管道...

信息:在环境变量中找到凭据。

信息:成功登录 https://XXXXXXX.dkr.ecr.us-east-1.amazonaws.com

✖ 未找到图像:404 客户端错误:未找到 ("no such image: image-test: No such image: image-test:latest")

这是我的 bitbucket-pipelines.yml 代码:

    - step:
        name: docker build running
        services: 
          - docker
        script: 
          - docker build -t image-test .
        artifacts:
          - Image_Test.zip  
    - step:
        name: Updating docker image
        script:
          - pipe: atlassian/aws-ecr-push-image:1.0.2
            variables:
              AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
              AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
              AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
              IMAGE_NAME: image-test
              TAGS: '${BITBUCKET_TAG} latest'

我确认此映像存在于我的 ECR 存储库中。

Docker 图像不会在流水线步骤之间保留。您必须在同一步骤中构建和推送镜像,例如:

- step:
    name: Updating docker image
    script:
      - docker build -t image-test .
      - pipe: atlassian/aws-ecr-push-image:1.0.2
        variables:
          AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
          AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
          AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
          IMAGE_NAME: image-test
          TAGS: '${BITBUCKET_TAG} latest'