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

Update Container User Id to react to changes in dotnet/dotnet-docker#4715 #34128

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
<!-- We only set a default user when the base image is Microsoft-authored, and we're targeting a version of those images that supports a nonroot user -->
<PropertyGroup Label="ContainerUser Assignment" Condition="$(_ContainerIsUsingMicrosoftDefaultImages) and $(_ContainerIsTargetingNet8TFM) and '$(ContainerUser)' == ''">
<ContainerUser Condition="$(_ContainerIsTargetingWindows)">ContainerUser</ContainerUser>
<!-- For Linux, the MS images have an 'app' user set to user id 64198 but some container runtimes work better with user ids instead of names, so we defer to that -->
<ContainerUser Condition="!$(_ContainerIsTargetingWindows)">64198</ContainerUser>
<!-- For Linux, the MS images have an 'app' user set to user id 1654 but some container runtimes work better with user ids instead of names, so we defer to that -->
<ContainerUser Condition="!$(_ContainerIsTargetingWindows)">1654</ContainerUser>
</PropertyGroup>

<ParseContainerProperties FullyQualifiedBaseImageName="$(ContainerBaseImage)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ public void CanComputeTagsForSupportedSDKVersions(string sdkVersion, string tfm,
computedTag.Should().Be(expectedTag);
}

[InlineData("v8.0", "linux-x64", "64198")]
[InlineData("v8.0", "linux-x64", "1654")]
[InlineData("v8.0", "win-x64", "ContainerUser")]
[InlineData("v7.0", "linux-x64", null)]
[InlineData("v7.0", "win-x64", null)]
[InlineData("v9.0", "linux-x64", "64198")]
[InlineData("v9.0", "linux-x64", "1654")]
[InlineData("v9.0", "win-x64", "ContainerUser")]
[Theory]
public void CanComputeContainerUser(string tfm, string rid, string expectedUser)
Expand Down