-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[release/7.0.4xx] Default all containers to linux instead of the current SDK's OS #32473
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
[release/7.0.4xx] Default all containers to linux instead of the current SDK's OS #32473
Conversation
Can it be considered as the breaking change? We recently had some PR implementing Windows containers too. |
This is a breaking change coming in dotnet-docker anyway for .NET 8, and container usage is vastly linux-oriented anyway. We can quantify this in telemetry though. |
I will also send a docs update PR to sdk-container-builds 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor comments
[Theory] | ||
public void WindowsUsersGetLinuxContainers(string sdkPortableRid, string expectedRid) | ||
{ | ||
var (project, logger, d) = ProjectInitializer.InitProject(new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor: for maintainability, consider a friendlier name than d
{ | ||
["TargetFrameworkVersion"] = "v6.0", | ||
["NETCoreSdkPortableRuntimeIdentifier"] = sdkPortableRid | ||
}, projectName: $"{nameof(WindowsUsersGetLinuxContainers)}_{sdkPortableRid}_{expectedRid}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor: though syntax is correct, the code does not feel very csharpie. Feels like some functional program written in c#. A respectful opinion, not a fact.
Most containers usage is Linux, even on Windows, and so our out-of-the-box defaults should make that pathway easy to use.
This changes the default container RID logic to prefer the Linux RID matching the architecture of the current SDK. This helps us ensure a minimal amount of emulation. Critically, it makes 'normal'
dotnet publish
commands for containers use a more reasonable default - in .NET 8dotnet publish -p PublishProfile=DefaultContainer
means 'a release mode Linux container'.