I am trying to use Amazon ECR for storing my images.
Now, I want my image:tag to work with different operating system and architectures like linux/amd64, linux/arm64, windows etc.
This is fine when I use docker but seems like I can’t make it work with ECR.
Docker says you can push it to an insecure registry:
docker buildx build --platform linux/amd64,linux/arm64 -t 5XXXXXXXXXX.dkr.ecr.ap-southeast-2.amazonaws.com/imagename:tag --push .
This command succeeds:
docker buildx build --platform linux/arm64 -t 5XXXXXXXXXX.dkr.ecr.ap-southeast-2.amazonaws.com/imagename:tag --push .
The multi-platform image can be pushed to Docker Hub.
I want to know a way how we can do this. This is my thought. Please correct me if I am wrong.
Can we create our own manifest file which contains the images already placed in ECR repository?
image: image:multi-arch manifests: - image: 5XXXXXXXXXX.dkr.ecr.ap-southeast-2.amazonaws.com/imagename:tag/i1-linuxamd64 platform: architecture: arm64 os: linux - image: 5XXXXXXXXXX.dkr.ecr.ap-southeast-2.amazonaws.com/imagename:tag/i2-intelx86 platform: architecture: intelx86 os: Windows
Now we have a new image called image:multi-arch. We then use this image and expect it to get the target architecture automatically based on the manifest.
If I push this final image to ECR, will it work?
Am I doing something wrong? Please feel free to correct me.