skip to Main Content

We have been using docker build for our images.

The build takes place using Jenkins slave on ec2 amd64.

docker build .
The build takes around 5 minutes.

However, now when using docker buildx --platform linux/amd64, linux/arm64.
The build takes much longer around 30 minutes.
From what I understood, it’s because the node is amd64 and it’s using an emulator for building the arm64.

How can we make it faster?

We are having npm install command in our dockerfile and some shell commands.

2

Answers


  1. If you can run that command from an arm64 ec2 instance, like Graviton, it will run MUCH faster. When we build multi-arch images on arm64 we can build in a matter of minutes, but when doing the same thing on amd64, it can take well over half an hour depending on the image. arm64 chips seem to be able to handle the multi-arch builds much better than amd64, unfortunately.

    Login or Signup to reply.
  2. Another option besides running docker buildx from a single host, is to build both images on their native architectures quickly, push the resulting containers to the repo and then push the manifest to combine them into a multi-arch container. For larger builds this may be the way to go instead of waiting forever for a build to finish.

    Sample Refs:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search