Skip to content
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

Dotnet CLI --os and --arch flags are being ignored if RuntimeIdentifiers tag is declared in csproj #46282

Closed
Arkatufus opened this issue Jan 24, 2025 · 3 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@Arkatufus
Copy link

Describe the bug

Dotnet CLI --os and --arch flags are being ignored if RuntimeIdentifiers tag is declared in csproj (project is set as a multi-arch project).

To Reproduce

Create a C# project with these tags:

<PropertyGroup>
  <OutputType>Exe</OutputType>
  <EnableSdkContainerSupport>true</EnableSdkContainerSupport>
  <ContainerRepository>idle-cpu</ContainerRepository>
  <ContainerTitle>idle-cpu</ContainerTitle>
  <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
  <RuntimeIdentifiers>linux-x64;linux-arm64</RuntimeIdentifiers>
</PropertyGroup>

Publish the project using this CLI command:

dotnet publish --os linux --arch x64 -p:ContainerRepository=idle-cpu -p:ContainerImageTag=latest-x64 -c Release /t:PublishContainer

Expected Behavior

A single docker container image targeting linux-x64 runtime with "latest-x64" tag

Observed Behavior

Two docker container images were created and pushed with "latest-x64-linux-x64" and "latest-x64-linux-arm64" tags (tag names were mangled)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Jan 24, 2025
@baronfel
Copy link
Member

Sorry you're having this problem. This is a duplicate of #46053, which we've fixed in #46067 for next month's servicing releases. There's no good user-level fix for this issue, so the best suggestion I can give is to pin to last month's version of the SDK (either 8.0.404 or 9.0.101) for a couple of weeks until that is released.

@Aaronontheweb
Copy link

Thanks @baronfel

@Arkatufus
Copy link
Author

Thank you for the explanation @baronfel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants