Invalid runtimeconfig.json in sdk 10.0.302
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
I'm getting an error when running `dotnet restore` inside a docker build.
I'm using docker desktop, windows 11, x64, linux container.
This is the error:
```
> [stub-locations-api build 9/11] RUN dotnet restore "stubs/Hexon.Stub.Locations.Api/Hexon.Stub.Locations.Api.csproj":
0.229 Failed to map file. mmap(/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json) failed with error 22
0.229 Cannot use file stream for [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json]: Invalid argument
0.229 Failed to parse file [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json].
0.229 Invalid runtimeconfig.json [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json] [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.dev.json]
```
### Steps to reproduce
This is the simplified docker file (the .302 is not really in there).
```
FROM mcr.microsoft.com/dotnet/sdk:10.0.302 AS build
COPY props props
COPY NuGet.config .
COPY .editorconfig .
COPY Directory.Build.props .
COPY Directory.Packages.props .
COPY stubs/Hexon.Stub.Locations.Api/Hexon.Stub.Locations.Api.csproj stubs/Hexon.Stub.Locations.Api/Hexon.Stub.Locations.Api.csproj
RUN dotnet restore "stubs/Hexon.Stub.Locations.Api/Hexon.Stub.Locations.Api.csproj"
```
### Expected behavior
I'd expect it to run without error, just like mcr.microsoft.com/dotnet/sdk:10.0.301
### Actual behavior
Error about invalid runtimeconfig.json
### Is this a regression?
yes it works with mcr.microsoft.com/dotnet/sdk:10.0.301
### Are there any workarounds?
Few options.
1) Pin the 10.0.301 in docker files, or
2) remove the 10.0.302 and use 10.0.301 instead
Delete the newest tag (should point to 10.0.302)
`docker image remove mcr.microsoft.com/dotnet/sdk:10.0`
get 10.0.301
`docker image pull mcr.microsoft.com/dotnet/sdk:10.0.301`
tag 10.0.301
`docker image tag mcr.microsoft.com/dotnet/sdk:10.0.301 mcr.microsoft.com/dotnet/sdk:10.0`
### dotnet --info output
```console
#10 [build 3/12] RUN dotnet --info
#10 0.110 Failed to map file. mmap(/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json) failed with error 22
#10 0.110 Cannot use file stream for [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json]: Invalid argument
#10 0.110 Failed to parse file [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json].
#10 0.110 Invalid runtimeconfig.json [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.json] [/usr/share/dotnet/sdk/10.0.302/dotnet.runtimeconfig.dev.json]
#10 0.110
#10 0.110 Host:
#10 0.110 Version: 10.0.10
#10 0.110 Architecture: x64
#10 0.110 Commit: f7d90799ce
#10 0.110 RID: linux-x64
#10 0.110
#10 0.110 .NET SDKs installed:
#10 0.110 10.0.302 [/usr/share/dotnet/sdk]
#10 0.110
#10 0.110 .NET runtimes installed:
#10 0.110 Microsoft.AspNetCore.App 10.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
#10 0.110 Microsoft.NETCore.App 10.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
#10 0.110
#10 0.110 Other architectures found:
#10 0.110 None
#10 0.110
#10 0.110 Environment variables:
#10 0.110 DOTNET_GENERATE_ASPNET_CERTIFICATE [false]
#10 0.110 DOTNET_NOLOGO [true]
#10 0.110 DOTNET_RUNNING_IN_CONTAINER [true]
#10 0.110 DOTNET_SDK_VERSION [10.0.302]
#10 0.110 DOTNET_USE_POLLING_FILE_WATCHER [true]
#10 0.110 DOTNET_VERSION [10.0.10]
#10 0.110
#10 0.110 global.json file:
#10 0.110 Not found
#10 0.110
#10 0.110 Learn more:
#10 0.110 https://aka.ms/dotnet/info
#10 0.110
#10 0.110 Download .NET:
#10 0.110 https://aka.ms/dotnet/download
#10 ERROR: process "/bin/sh -c dotnet --info" did not complete successfully: exit code: 147
```
### IDE version
_No response_
### Other details
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.