cdklabs / cdk-ecr-deployment

A CDK construct to deploy docker image to Amazon ECR
Apache License 2.0
157 stars 31 forks source link

Support for arm64 copies #568

Open uncledru opened 7 months ago

uncledru commented 7 months ago

I am attempting to copy an arm64 image from one source to another and get an error:

sending status failed: copy image failed: choosing an image from manifest list docker://xxx.dkr.ecr.us-east-1.amazonaws.com/repo:latest: no image found in image index for architecture amd64, variant "", OS linux

I've attempted to set the GOARCH environment variable but that doesn't seem to help.

Nothing in the copy pkg docs stand out: https://pkg.go.dev/github.com/containers/image/v5/copy

Any suggestions? Do we need to build the customer resource with an arm64 architecture?

Edit:

Seems this is what we need - https://pkg.go.dev/github.com/containers/image/v5@v5.30.0/types#SystemContext

image

We can set this based on the env var set in the lambda GOARCH

https://github.com/cdklabs/cdk-ecr-deployment/blob/main/lambda/main.go#L106

uncledru commented 7 months ago

I see this is open https://github.com/cdklabs/cdk-ecr-deployment/pull/364

@wchaws is this the right approach? I can open another PR with similar changes if needed