I’m building a Docker image on macOS like this:
<code>$ docker build . --platform linux/arm64 -t foo
</code>
<code>$ docker build . --platform linux/arm64 -t foo
</code>
$ docker build . --platform linux/arm64 -t foo
Then, I push it to AWS ECR:
<code>$ docker push foo
</code>
<code>$ docker push foo
</code>
$ 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
With a recent version of docker engine API (1.46+) you can use the --platform
flag when pushing, e.g.:
<code>$ docker push foo --platform linux/arm64
</code>
<code>$ docker push foo --platform linux/arm64
</code>
$ docker push foo --platform linux/arm64