Skip to content

Commit

Permalink
Update Container User Id to react to changes in dotnet/dotnet-docker#…
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Jul 20, 2023
2 parents 761a423 + acf76dd commit 8b67942
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 8b67942

Please sign in to comment.