Skip to content

[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

Conversation

baronfel
Copy link
Member

@baronfel baronfel commented May 12, 2023

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 8 dotnet publish -p PublishProfile=DefaultContainer means 'a release mode Linux container'.

@baronfel baronfel requested a review from a team as a code owner May 12, 2023 03:15
@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels May 12, 2023
@baronfel baronfel added Area-Containers Related to dotnet SDK containers functionality and removed Area-Infrastructure untriaged Request triage from a team member labels May 12, 2023
@baronfel baronfel changed the title Default all containers to linux instead of the current SDK's OS [release/7.0.4xx] Default all containers to linux instead of the current SDK's OS May 15, 2023
@vlada-shubina
Copy link
Member

Can it be considered as the breaking change? We recently had some PR implementing Windows containers too.

@baronfel
Copy link
Member Author

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.

@baronfel
Copy link
Member Author

I will also send a docs update PR to sdk-container-builds 👍

Copy link
Contributor

@donJoseLuis donJoseLuis left a 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()
Copy link
Contributor

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}");
Copy link
Contributor

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.

@baronfel baronfel merged commit 4f466da into dotnet:release/7.0.4xx May 20, 2023
@baronfel baronfel deleted the default-windows-users-to-linux-containers branch May 20, 2023 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Containers Related to dotnet SDK containers functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants