-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
.NET8 docker build stuck on dotnet restore #97828
Comments
See this post: https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/ There are two options:
|
@richlander Rosetta emulation doesn't work. After a long wait, it's shutdown with that:
and exit code: 133 |
Did you consider the |
@richlander That's works fine. But Rosetta's behaviour is very strange here. |
Got it. Let's transfer this issue to dotnet/runtime. |
Hey @richlander, thanks for the link to that post. I'll read it and try to adopt my approach to utilize best practices. For me, the problem is that official microsoft images like https://hub.docker.com/_/microsoft-azure-functions-dotnet-isolated are linux/amd64 only... and the only way I know how to get this docker image working on my M1 Macbook is using rosetta emulation. But then that causes ENV DOTNET_EnableWriteXorExecute=0 |
[Triage] This doesn't seem like .NET setup issue. @richlander do you have a suggestion for who should take a look? |
Did you guys got it work. I am having similar problem.
I build it using buildctl/buildkit
It runs fine locally on Ubuntu machine, |
I just tried our sample w/o issue on macOS Arm64 w/Rosetta emulation enabled. I used Can you share a project file so that I can test that? Are you reliant on any authorized feeds? |
@richlander I have a simple project here that fails when running https://github.com/kurt-mueller-osumc/dotnet-amd64 |
Finally! I was able to fix this restore issue. Machine specsMacbook Pro M1 Pro chip I tried to build my docker image initially in default platform, it stuck in And here is my final Dockerfile
I didn't specify --platform because I've set But it seems wether you are building in |
It should go much faster if you follow this pattern. https://github.com/dotnet/dotnet-docker/blob/main/samples/aspnetapp/Dockerfile https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/ |
A potential workaround is to remove the This has been an ongoing issue unfortunately... And none of the answers to the dozens and dozens of github issues for this topic (Or the blog post) seem to work for any of my coworkers on Apple silicon (Who have been affected for nearly a year now) |
This specific comment is our guidance: dotnet/dotnet-docker#4225 (comment) |
Sorry. I misread what you said. Too much in a rush. Can you tell me more about your workaround? |
I had the same problem this solved my problem
To get a build you can just use the --platform argument in docker build. To build an image for linux/amd64 just use the following build command:
|
Had the same problem few moths ago, and I managed get it working just with For some reason today it refused to work |
Dotnet docker building is totally broken on my m2 mac, I don't know what's going on. I have tried the solutions listed above, but nothing works. docker system prune --all --force
mkdir docker-test && cd docker-test
curl https://raw.githubusercontent.com/dotnet/dotnet-docker/main/samples/aspnetapp/Dockerfile -o Dockerfile
new webapp -n aspnetapp
docker build --platform linux/amd64 -t app . And it just hangs forever....
|
Describe the Bug
Similar to dotnet/dotnet-docker#3338 and #71856, trying to emulate the
linux/amd64
platform when building a docker image on an arm64 computer (i.e. Macbook) cause the build to hang when thedotnet restore
command is ran.Steps to Reproduce
docker build --platform linux/amd64 .
This project source code is simply the default library template for the F# language.
Other Information
Output of
docker version
% docker version Client: Version: 24.0.7 API version: 1.43 Go version: go1.20.10 Git commit: afdd53b Built: Thu Oct 26 09:04:20 2023 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.26.1 (131620) Engine: Version: 24.0.7 API version: 1.43 (minimum version 1.12) Go version: go1.20.10 Git commit: 311b9ff Built: Thu Oct 26 09:08:15 2023 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.25 GitCommit: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f runc: Version: 1.1.10 GitCommit: v1.1.10-0-g18a0cb0 docker-init: Version: 0.19.0 GitCommit: de40ad0
Output of
docker info
The text was updated successfully, but these errors were encountered: