In case this might be useful for anyone else who stumbles on this... My solution ended up being to just not rely on CDK for the docker build. I have a CDK Pipeline that builds a multi-arch image using
docker buildx as part of the "synth" step in AWS CodeBuild before the CloudFormation templates are synthesized. See this link for how to get
buildx working in AWS CodeBuild.
That image (really two images and a manifest) is pushed to a staging repository that's created by the pipeline stack, similar to how CDK uses a dedicated assets repo for its Docker builds. Then after each stage in my pipeline is deployed, a "post"
CodeBuildStep runs that uses the
skopeo CLI to copy the image from the staging repo to a dedicated ECR repo for each stage. This is essentially what
cdk-ecr-deployment does for you if you're not dealing with a multi-arch image.
How to push multi-arch docker image built with docker-compose to ECRasked a year ago
Using Elastic Beanstalk - Docker Platform with ECR - Specifying a tag via environment variableasked a year ago
Multi-arch Docker image deployment using CDK Pipelinesasked 4 months ago
How to deploy a Docker image to AWS with the smallest number of CLI commands?asked 2 months ago
'docker push' to ECR failsasked 4 years ago
Docker push doesn't work even docker login succeeded during AWS CodePipeline Build stageAccepted Answerasked a year ago
How to create an container image and deploy it to an lambda function using CDK?Accepted Answerasked 5 months ago
Deploy updated container to existing CDK stackAccepted Answerasked 3 years ago
Docker cli won't push my image to ECRasked a year ago
Unable to push docker image to ECRasked 3 months ago