Skip to content

Commit

Permalink
remove artificial block for linux-x64
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Dec 21, 2022
1 parent a00a519 commit 82b4793
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions packaging/build/Microsoft.NET.Build.Containers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
<Error Condition="'$(_IsSDKContainerAllowedVersion)' != 'true'" Code="CONTAINER002" Text="The current .NET SDK ($(NETCoreSdkVersion)) doesn't support containerization. Please use version 7.0.100 or higher to enable containerization." />
</Target>

<Target Name="_ContainerVerifyRuntime"
Condition="'$(WebPublishMethod)' == 'Container' or '$(PublishProfile)' == 'DefaultContainer'"
BeforeTargets="AfterPublish">
<!-- https://github.com/dotnet/sdk-container-builds/issues/91 -->
<Error Condition="'$(RuntimeIdentifier)' != 'linux-x64'" Code="CONTAINER006" Text="The Microsoft.NET.Build.Containers package does not (yet) support publishing for $([MSBuild]::ValueOrDefault('$(RuntimeIdentifier)', 'portable or no-RuntimeIdentifier-defined scenarios')). Please specify a runtime of &quot;linux-x64&quot;" />
</Target>

<Target Name="ComputeContainerConfig">
<!-- Reference data about this project -->
<PropertyGroup>
Expand All @@ -51,6 +44,8 @@
<ContainerRegistry Condition="'$(RegistryUrl)' != ''">$(RegistryUrl)</ContainerRegistry>
<!-- PublishImageTag is used by existing VS targets for Docker builds - this lets us fill that void -->
<ContainerImageTag Condition="'$(PublishImageTag)' != ''">$(PublishImageTag)</ContainerImageTag>
<!-- This line is a compatibility shim for VS support - the VS container targets define a container tag using this property and format. This lets us be a drop-in replacement for them. -->
<ContainerImageTag Condition="'$(AutoGenerateImageTag)' == 'true'">$([System.DateTime]::UtcNow.ToString('yyyyMMddhhmmss'))</ContainerImageTag>
</PropertyGroup>

<!-- Container Defaults -->
Expand All @@ -64,9 +59,9 @@
<ContainerImageName Condition="'$(ContainerImageName)' == ''">$(AssemblyName)</ContainerImageName>
<!-- Only default a tag name if no tag names at all are provided -->
<ContainerImageTag Condition="'$(ContainerImageTag)' == '' and '$(ContainerImageTags)' == ''">$(Version)</ContainerImageTag>
<ContainerImageTag Condition="'$(AutoGenerateImageTag)' == 'true'">$([System.DateTime]::UtcNow.ToString('yyyyMMddhhmmss'))</ContainerImageTag>
<ContainerWorkingDirectory Condition="'$(ContainerWorkingDirectory)' == ''">/app</ContainerWorkingDirectory>
<!-- Could be semicolon-delimited -->
<!-- The Container RID should default to the RID used for the entire build (to ensure things run on the platform they are built for), but the user knows best and so should be able to set it explicitly -->
<ContainerRuntimeIdentifier Condition="'$(ContainerRuntimeIdentifier)' == ''">$(RuntimeIdentifier)</ContainerRuntimeIdentifier>
</PropertyGroup>

<ItemGroup Label="Entrypoint Assignment">
Expand All @@ -77,6 +72,7 @@
</ItemGroup>

<ItemGroup Label="Conventional Label assignment">
<!-- TODO: This impacts build reproducibility - it should probably be settable/conditioned on a property -->
<ContainerLabel Include="org.opencontainers.image.created" Value="$([System.DateTime]::UtcNow.ToString('o'))" />
</ItemGroup>

Expand Down Expand Up @@ -108,7 +104,6 @@
<PropertyGroup>
<PublishContainerDependsOn>
_ContainerVerifySDKVersion;
_ContainerVerifyRuntime;
ComputeContainerConfig
</PublishContainerDependsOn>
</PropertyGroup>
Expand Down Expand Up @@ -137,7 +132,7 @@
Labels="@(ContainerLabel)"
ExposedPorts="@(ContainerPort)"
ContainerEnvironmentVariables="@(ContainerEnvironmentVariables)"
ContainerRuntimeIdentifier="$(RuntimeIdentifier)">
ContainerRuntimeIdentifier="$(ContainerRuntimeIdentifier)">
<Output TaskParameter="GeneratedContainerManifest" PropertyName="GeneratedContainerManifest" />
<Output TaskParameter="GeneratedContainerConfiguration" PropertyName="GeneratedContainerConfiguration" />
</CreateNewImage>
Expand Down

0 comments on commit 82b4793

Please sign in to comment.