CircleCI-Public / aws-ecr-orb

CircleCI orb for interacting with Amazon's Elastic Container Registry (ECR)
https://circleci.com/orbs/registry/orb/circleci/aws-ecr
MIT License
80 stars 142 forks source link

build_and_push_image does not take in account the platform correctly #344

Closed mauro-justgiving closed 3 months ago

mauro-justgiving commented 5 months ago

Orb version

9.1.0

What happened

We are building an image using the commit ID as tag. Since upgrading from aws-ecr@8.2.1 to 9.10, when re-running a second time, the pipeline fails with e.g.

d7edb81: Pulling from vector/vector
no matching manifest for linux/amd64 in the manifest list entries

Our CircleCI configuration is below:

      - aws-ecr/build_and_push_image:
          name:  publish 
          auth:
            - aws-cli/setup:
                role_arn: ${BUILD_ROLE_ARN}
          account_id: "99999999"
          region: "${AWS_REGION}"
          repo: vector/vector
          tag: "${CIRCLE_SHA1:0:7}"
          platform: linux/arm64
          create_repo: false
          skip_when_tags_exist: true
          context: build
          requires:
            - test

The issue is that the platform is not provided when the image is found and attempted to pull: https://github.com/CircleCI-Public/aws-ecr-orb/blob/70f2cff671ca7b51b20d26d32bf259e20d197bc5/src/scripts/docker_buildx.sh#L47

Expected behavior

The pull of an existing image works, e.g. by specifying the --platform.

marboledacci commented 3 months ago

The issue is resolved in this version https://circleci.com/developer/orbs/orb/circleci/aws-ecr?version=9.3.1