Multi platform build fails with Docker Destop 4.57

I’m running “docker buildx build -f ./Dockerfile --platform linux/amd64,linux/arm64 .” in WSL with Ubuntu 24.04 on Windows 11 Pro, Build 26200. It used to work up to Docker Desktop 4.55. When using Docker Desktop 4.57 it fails with

[+] Building 1.3s (13/13) FINISHED                                                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                                                             0.0s
 => => transferring dockerfile: 1.25kB                                                                                                           0.0s
 => [linux/amd64 internal] load metadata ...                                                           0.9s
 => [linux/arm64 internal] load metadata for docker.io/library/node:24-alpine                                                                    0.9s
 => [internal] load .dockerignore                                                                                                                0.0s
 => => transferring context: 2B                                                                                                                  0.0s
 => [linux/arm64 1/4] FROM docker.io/library/node:24-alpine@sha256:931d7d57f8c1fd0e2179dbff7cc7da4c9dd100998bc2b32afc85142d8efbc213              0.0s
 => => resolve ...
 => [internal] load build context                                                                                                                0.0s
 => => transferring context: 40.96kB                                                                                                             0.0s
 => [linux/amd64 1/4] FROM ...
 => => resolve ...
 => CACHED [linux/arm64 2/4] WORKDIR /usr/app                                                                                                    0.0s
 => CACHED [linux/arm64 3/4] COPY . .                                                                                                            0.0s
 => CACHED [linux/amd64 2/4] WORKDIR /usr/app                                                                                                    0.0s
 => CACHED [linux/amd64 3/4] COPY . .                                                                                                            0.0s
 => CACHED [linux/amd64 4/4] RUN npm install --omit=dev --no-update-notifier                                                                     0.0s
 => ERROR [linux/arm64 4/4] RUN npm install --omit=dev --no-update-notifier                                                                      0.3s
------
 > [linux/arm64 4/4] RUN npm install --omit=dev --no-update-notifier:
0.224 exec /bin/sh: exec format error

Is there a fix i can use to get around that issue ?

Can you create a demo project with a Dockerfile that you can share to reproduce the issue? I tried but I couldn’t.

Some lines seems to be missing from your code. If your emoved it because you couldn’t share links, please, use code blocks as you would on GitHub or other technical forums. You can use MarkDown like:

```
Here is the code between three backticks (ALTGR+7 usually)
```

If you need more help, you can check our formatting guide: https://forums.docker.com/t/how-to-format-your-forum-posts/127295`

If you remove parts of the log, that will make it harder to help.

I’m not a nodejs developer, but is it possible that some pre-built binaries are executed when you run npm install? Do you copy binaries or only source code?

My multi platform build works now with 4.57.

Here is what I did: I assembled a demo application for you but could not make it fail. So I went ahead and deleted everything I could find related to that docker image. After that I was able to build again.

Unfortunately, I didn’t find out what the issue was that caused my problem.

Thx a lot for your help.

Regards
Ulrich Wengert

Sometimes I recommended deleting the cache or just ignoring it by passing --no-cache, which helped. It is possible you had the same problem and deleting everything related fixed it.
Thanks for sharing what helped you eventually.