-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building linux/amd64 Docker Image on Mac M1 #48420
Comments
Any new information on this? |
same error |
I got a similar error when trying to build a
Full logs here. |
Same issue, this time on dart version 2.17.5. As with above, the
|
@mraleph Is there is any solution to this? getting same error
|
My best guess would be that something is wrong when Dart is running under QEMU (e.g. qemu contains some bug which causes incorrect interpretation). I have experimented a bit with latest QEMU (built from their HEAD) as well as QEMU 7.0.0 and in both cases Dart SDK seems to work okay. I could not figure out which QEMU version Docker uses - it might be outdated. In general they have the following to say:
In summary I think your best bet is either to debug the crash yourself if you can reproduce it or report this issue to Docker and see if they can provide some explanation. I don't think there is much we can do here. |
In my case the official dart works without any problem but when I change to something like |
same error when trying to build image on MacBook M1 by running the command: It would be great if someone fixed this issue :)
|
this worked for me : |
Any movement here... Following are three attempts to build an image, each time it dies randomly.
It also happens in Random locations... And ONCE it made it all the way through. I did it once in quite a few attempts, but I have not been able to do it again. I am surprised this isn't getting more attention. It makes docker utterly useless on an ARM for building images for common target linux/adm64 targets.. |
@jamiegau You are asking in the wrong place. You have things like Reality is that this is a Docker bug most likely connected to qemu. |
@mraleph sorry, it was 2am. As it looked like a similar, random compiler crash, dart, g++. Seems all to revolve around the same problem. Still, same point. ARM/M1/M2 and building containers with dart would be broken for Dart developers too. Until this is fixed. Otherwise, I'll look for insight elsewhere. |
It's a pity that this is not solved yet - need to lug around my amd64 computer together with macbook - just to be able to build docker image based on dart shelf and deploy it to my server... |
@sasascekic did you report it to Docker? Did they investigate? Because it's a Docker's problem - not Dart's. |
Its morning, I am looking at the problem in a new light. I completely deleted all docker images etc. Just in case there was a conflict with the combining of how I initially compiled it (unknowing it defaults to ARM) and then switchng over to targeting amd64, and cache files may have been an issue. It got further after I did this but I need to do a number of builds from scratch test runs. May have been lucky. Do some more googling to see if others have a similar issue that may lead to an already existing open issue etc. For example, it got past a tool I compile into the image, but now its getting reliably stuck on installing the requirements file. Its now getting stuck on a pip requirements.. this error seems reliable, but again, does not exist if I build under amd64 computers. Its all so random etc. I'll have to do more investigation I feel. |
Don't know did they investigate - but I'm quite sure that they are aware of the problem. I mean, we are not taking about building Fortran here 😀 Btw how are you so sure that this is not a combination of dart-docker issue? |
I can't be 100% sure, but here are the data points:
This strongly indicates that something is wrong in the way that Docker+QEMU are working - rather than that all of these completely unrelated projects are somehow wrong. I don't have an access to Docker on Mac - so even if I were tempted to get to the bottom of this out of morbid curiosity, I can't really investigate it. I have tried reproducing things by running Linux in QEMU but that did not get me anywhere. Things run just fine on the newest QEMU builds. |
Ok, thanks - it sounds like a reasonable approach. I tried building in Ubuntu running on Parallels - but the same issue there. Probably because the same underlying issue is there... |
i'm getting the same issue on |
Just a note on this. |
With the available Docker images for ubuntu arm64 it seems like it's at least possible to compile flutter web apps. That would probably also mean with that container it could be possible to compile/run dart apps too. I just found this https://stackoverflow.com/a/75668217/8736883 when I faced the same problem. Maybe it helps. |
Same proble. Any resolution for this? |
@ZeroHans4 did you try this: https://stackoverflow.com/questions/75661539/building-a-docker-container-for-flutter-build-environment-fails-with-connectivit - it's meant for flutter but the solution should work for dart as well I guess. The Key point is to use |
I've filed a new issue with Dart-Docker after finding a way to reproduce this issue, which seems related to the use of carat syntax for the Dart SDK version in |
Potential fix incoming #54446 (comment) |
I'm getting this same error with dart 2.16.0 when trying to docker buildx linux/amd64 on a Mac M1.
pubspec.yaml
Dockerfile
Run command (tried from terminal and terminal running with rosetta):
docker buildx build --platform linux/amd64 -t dart_server:v1 .
Error:
Note: It does successfully build as arm using docker build.
The text was updated successfully, but these errors were encountered: