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?

gefragt vor 2 Jahren3181 Aufrufe
3 Antworten
0
AWS
EXPERTE
beantwortet vor 2 Jahren
  • 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

AWS
Petro_K
beantwortet vor 2 Jahren
  • 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
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen