Buildx failing to build arm64 containers

Before the default docker remote version was updated to 20.x, specifying a docker remote platform version of 20.10.14 worked for building arm64 containers. However, now removing the setting to use the default of 20.10.21 and also specifying any other 20.x version fails to build an arm64 container. What has changed that caused this?

I’m using the circleci/aws-ecr orb to build images for specific platforms when PRs/feature branches are created on my repositories. For example:

  aws-cli: circleci/aws-cli@3
  aws-ecr: circleci/aws-ecr@8

        description: amd64 or arm64
        type: enum
        default: amd64
        enum: [ "amd64", "arm64" ]
    executor: python3
      - checkout
      - setup_remote_docker:
          docker_layer_caching: true
      - aws-ecr/build-image:
          platform: linux/<< parameters.platform >>
          repo: ${CIRCLE_PROJECT_REPONAME}
          push-image: false
          tag: << parameters.platform >>-${CIRCLE_SHA1}

this produces a command like:

docker buildx build -f ./Dockerfile -t my-nginx:arm64-781102287233d907e225a876dad8c5d3c6629134 --platform linux/arm64 --progress plain --load .

and an error like:

#6 [2/7] RUN apk --update --no-cache upgrade     && apk add --no-cache bash     && mkdir -p /data/nginx/cache
#6 0.295 exec /bin/sh: exec format error
#6 ERROR: executor failed running [/bin/sh -c apk --update --no-cache upgrade     && apk add --no-cache bash     && mkdir -p /data/nginx/cache]: exit code: 1

specifying the docker version used to work, like:

- setup_remote_docker:
          version: 20.10.14
          docker_layer_caching: true

but now that is not working as well. So, why did this just stop working, and how do I fix it?

Same issue here