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?

preguntada hace 2 años3181 visualizaciones
3 Respuestas
0
AWS
EXPERTO
respondido hace 2 años
  • 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
respondido hace 2 años
  • 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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas