How to push multi-arch docker image built with docker-compose to ECR

0

I want to dockerize and push my node app in development to a free tier ec2 instance. Unfortunately, they are all x86 instances and my computer is an arm based chip (M1 Apple silicon). I am using a docker-compose.yml file to build my container and also pull other dependent containers from docker hub (redis & postgres). I can't figure out a way to build the docker image to be multi arch with docker buildx, use the docker-compose file and push the generated image to ECR. And as a result of the other containers being pulled, how would that work with ECR, does that mean that the redis and postgres containers will also be pushed to ECR. Is there a better way to achieve this?

已提问 2 年前3123 查看次数
3 回答
0
AWS
专家
已回答 2 年前
  • Yh. I have seen that. It didn't help for my particular case. I am able to push a multi-arch image to ecr with buildx no problem. The issue arises when i try to build using a docker-compose file. If you look at the question properly, you'll understand.

0

We have good blog covering multi-arch images with ECR. Have you checked that? https://aws.amazon.com/blogs/containers/introducing-multi-architecture-container-images-for-amazon-ecr/ As for free tier, ARM instances also have free tier, for example t4g

Petro_K
已回答 2 年前
  • Yes i have. Doesn't solve my particular use case. Or at least i can't find a solution from that

0

I do multi-arch builds regularly, although not locally in that way (even though I do have arm and x86 machines). I use AWS CodeBuild which is insanely cheap for that.

See this blog post for logical explanations and these repositories for practical examples

profile picture
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则