You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assert.Contains(logs.Messages, m =>m.Message?.Contains("'ContainerImageName' was not a valid container image name, it was normalized to 'dotnet-testimage'")==true);
@@ -68,13 +69,13 @@ public void RegexCatchesInvalidContainerNames()
instance.Build(new[]{ComputeContainerConfig},null,null,outvaroutputs).Should().BeTrue("Build should have succeeded");
114
+
instance.Build(new[]{ComputeContainerConfig},null,null,outvaroutputs).Should().BeTrue("Build should have succeeded but failed due to {0}",String.Join("\n",logger.AllMessages));
109
115
varlabels=instance.GetItems(ContainerLabel);
110
116
if(includeSourceControl)
111
117
{
@@ -121,29 +127,30 @@ public void ShouldNotIncludeSourceControlLabelsUnlessUserOptsIn(bool includeSour
<!-- Set the WorkingDirectory depending on the RID -->
88
-
<ContainerWorkingDirectoryCondition="'$(ContainerWorkingDirectory)' == '' and !$(ContainerRuntimeIdentifier.StartsWith('win')) ">/app</ContainerWorkingDirectory>
89
-
<ContainerWorkingDirectoryCondition="'$(ContainerWorkingDirectory)' == '' and $(ContainerRuntimeIdentifier.StartsWith('win')) ">C:\app</ContainerWorkingDirectory>
94
+
<ContainerWorkingDirectoryCondition="'$(ContainerWorkingDirectory)' == '' and !$(_ContainerIsTargetingWindows) ">/app</ContainerWorkingDirectory>
95
+
<ContainerWorkingDirectoryCondition="'$(ContainerWorkingDirectory)' == '' and $(_ContainerIsTargetingWindows) ">C:\app</ContainerWorkingDirectory>
90
96
</PropertyGroup>
91
97
92
98
<ItemGroupLabel="Entrypoint Assignment">
93
99
<!-- For non-apphosts, we need to invoke `dotnet` `app` as separate args -->
94
100
<ContainerEntrypointCondition="'$(ContainerEntrypoint)' == '' and '$(UseAppHost)' != 'true'"Include="dotnet;$(TargetFileName)" />
95
101
<!-- For apphosts, we need to invoke `app` as a single arg -->
96
-
<ContainerEntrypointCondition="'$(ContainerEntrypoint)' == '' and '$(UseAppHost)' == 'true' and !$(ContainerRuntimeIdentifier.StartsWith('win'))"Include="$(ContainerWorkingDirectory)/$(AssemblyName)$(_NativeExecutableExtension)" />
97
-
<ContainerEntrypointCondition="'$(ContainerEntrypoint)' == '' and '$(UseAppHost)' == 'true' and $(ContainerRuntimeIdentifier.StartsWith('win'))"Include="$(AssemblyName)$(_NativeExecutableExtension)" />
102
+
<ContainerEntrypointCondition="'$(ContainerEntrypoint)' == '' and '$(UseAppHost)' == 'true' and !$(_ContainerIsTargetingWindows)"Include="$(ContainerWorkingDirectory)/$(AssemblyName)$(_NativeExecutableExtension)" />
103
+
<ContainerEntrypointCondition="'$(ContainerEntrypoint)' == '' and '$(UseAppHost)' == 'true' and $(_ContainerIsTargetingWindows)"Include="$(AssemblyName)$(_NativeExecutableExtension)" />
98
104
</ItemGroup>
99
105
106
+
<!-- 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 -->
107
+
<PropertyGroupLabel="ContainerUser Assignment"Condition="$(_ContainerIsUsingMicrosoftDefaultImages) and $(_ContainerIsTargetingNet8TFM) and '$(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 -->
0 commit comments