The specified RuntimeIdentifier 'linux-linux/amd64' is not recognized
See original GitHub issueDescribe the bug
When building an amd64 container on an arm64 device (MacBook Pro M2) I hit the problem with dotnet restore hanging forever. I mitigated this by using the BUILDPLATFORM env variable in tandem with the 8.0 nightly preview SDK.
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/nightly/sdk:8.0-preview as build-env
This worked well 9 days ago but seemingly running the same command now seems to suggest it’s trying to restore a linux-linux/arm64 RID which won’t exist.
To Reproduce
docker buildx build --platform linux/arm64,linux/amd64 --output "type=image,push=true" --no-cache --file ./Dockerfile . --compress --tag "REDACTED"
I have the relevant portion of my Dockerfile below
RUN echo "I am running on ${BUILDPLATFORM}"
RUN echo "building for ${TARGETPLATFORM}"
RUN export TARGETPLATFORM="${TARGETPLATFORM}"
RUN dotnet restore -a $TARGETPLATFORM
which outputs
=> [linux/arm64 build-env 5/9] RUN echo "I am running on linux/arm64" 0.2s
=> [linux/arm64->amd64 build-env 5/9] RUN echo "I am running on linux/arm64" 0.2s
=> [linux/arm64->amd64 build-env 6/9] RUN echo "building for linux/amd64" 0.0s
=> [linux/arm64 build-env 6/9] RUN echo "building for linux/arm64" 0.1s
=> [linux/arm64->amd64 build-env 7/9] RUN export TARGETPLATFORM="linux/amd64" 0.1s
=> [linux/arm64 build-env 7/9] RUN export TARGETPLATFORM="linux/arm64" 0.0s
=> ERROR [linux/arm64 build-env 8/9] RUN dotnet restore -a linux/arm64 1.4s
=> ERROR [linux/arm64->amd64 build-env 8/9] RUN dotnet restore -a linux/amd64
Exceptions (if any)
The specified RuntimeIdentifier ‘linux-linux/amd64’ is not recognized
Further technical details
- Include the output of
dotnet --info
- The IDE (VS / VS Code/ VS4Mac) you’re running on, and its version
Issue Analytics
- State:
- Created 6 months ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
error NETSDK1083: The specified RuntimeIdentifier ...
error NETSDK1083 : The specified RuntimeIdentifier 'ubuntu.22.04-x64' is not recognized when doing source building package for Ubuntu Jammy 22.04 ...
Read more >NET Runtime Identifier (RID) catalog
RID values are used to identify target platforms where the application runs. They're used by .NET packages to represent platform-specific assets ...
Read more >migrate .net core 2.2 to 3.1 issue
targets(59,5): error NETSDK1083: The specified RuntimeIdentifier 'win7-64' is not recognized. C:\Program Files\dotnet\sdk\3.1.101\Sdks\Microsoft ...
Read more >RuntimeIdentifiers error when multiple identifiers
Hi,. I'm facing the following error when I have more than one rutimeidentifier: The project 'XXXXXXXXX' ran into a problem during the last ......
Read more >.NET 6 and M1 problems when other SDKs are present in ...
NET 6, and older SDKs shoved into x64 directory. Steps to reproduce. Try to run .NET 5 or .NET Core 3.1 project: it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hello, I can confirm that on Preview 3 when changing TARGETARCH it does indeed resolve the issue and build the container. Thanks!
I just tested it. It works for me, on both x64 and Arm64 (with
--platform amd64
). Can you try this:Please clone the repo and build from this directory to validate: https://github.com/dotnet/dotnet-docker/tree/main/samples/aspnetapp
What I see: