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?

asked a year ago665 views
3 Answers
0
EXPERT
answered a year ago
  • 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
answered a year ago
  • 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
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions