skip to Main Content

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


  1. 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:-

    1. Build your image
      $ docker build . --platform linux/arm64 -t foo
      
      
    2. Add tag to your image
      docker tag foo <aws-address>/<image-name>
      
      
    3. Push the image
      docker push <tag-name>
      

    This will help you keep single image but will lose the cross-platform functionality you were getting.

    Login or Signup to reply.
  2. With a recent version of docker engine API (1.46+) you can use the --platform flag when pushing, e.g.:

    $ docker push foo --platform linux/arm64
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search