I’m building a Docker image on macOS like this:
$ docker build . --platform linux/arm64 -t foo
Then, I push it to AWS ECR:
$ docker push foo
As a result, I see three files in the ECR (it’s a multi-architecture manifest along with the image, I suppose). Is it possible to have only one image in ECR, without the multi-architecture manifest? In other words, I want to build for arm64
and deploy it to ECR as a single-platform image.
2
Answers
Since you are using a multi-platform setup, AWS is creating multiple images. This will help you to access your images across all the platforms. So, I would recommend to keep doing the same unless you absolutely want to change it. If you want to have only one image, then, you can follow the following steps:-
This will help you keep single image but will lose the cross-platform functionality you were getting.
With a recent version of docker engine API (1.46+) you can use the
--platform
flag when pushing, e.g.: